diff --git a/Data/HnsDatasource.cs b/Data/HnsDatasource.cs index ab4826b..4f61435 100644 --- a/Data/HnsDatasource.cs +++ b/Data/HnsDatasource.cs @@ -20,7 +20,6 @@ public class HnsDatasource public TreeNode RoutesNode { get; private set; } public TreeNode ActivitiesNode { get; private set; } public TreeNode OrphansNode { get; private set; } - public TreeNode NamespacesNode { get; private set; } public HnsDatasource() { @@ -32,7 +31,6 @@ public HnsDatasource() RoutesNode = new TreeNode(); ActivitiesNode = new TreeNode(); OrphansNode = new TreeNode(); - NamespacesNode = new TreeNode(); } private void UpdateLoadingState(string message) @@ -52,7 +50,6 @@ public void Reset() RoutesNode = new TreeNode(); ActivitiesNode = new TreeNode(); OrphansNode = new TreeNode(); - NamespacesNode = new TreeNode(); } public void Load() @@ -103,11 +100,14 @@ public void Load() UpdateLoadingState("Building activities tree..."); var orphanedActivities = ActivitiesNode.Nodes.InsertNestedChildren(activitiesData, "ID", "parentId", "Activity", "Allocators.Tag"); + UpdateLoadingState("Inserting namespace children..."); + var orphanedNamesaces = ActivitiesNode.Nodes.InsertNestedChildren(namespaceData, "ID", "ActivityId", "Namespace", "ID"); + UpdateLoadingState("Inserting network children..."); var orphanedNetworks = ActivitiesNode.Nodes.InsertNestedChildren(networkData, "ID", "Resources.ID", "Network", "Name,' ',ManagementIP"); UpdateLoadingState("Inserting endpoint children..."); - var orphanedEndpoints = ActivitiesNode.Nodes.InsertNestedChildren(endpointData, "ID", "Resources.ID", "Endpoint", "Name,' ',IPAddress"); + var orphanedEndpoints = ActivitiesNode.Nodes.InsertNestedChildren(endpointData, "ID", "Namespace.ID", "Endpoint", "Name,' ',IPAddress"); UpdateLoadingState("Inserting policy children..."); var orphanedPolicies = ActivitiesNode.Nodes.InsertNestedChildren(policyData, "ID", "Resources.ID", "Policy", "Policies.Type,' ',Policies.SourceVIP,' ->',Policies.VIPs,' ',Policies.ExternalPort,':',Policies.InternalPort"); @@ -124,26 +124,19 @@ public void Load() ActivitiesNode.Nodes.InsertNestedChildren(endpointStatsData, "InstanceId", "EndpointId", "Endpoint Stats", "Name"); UpdateLoadingState("Inserting virtualmachine children..."); - var orphanedCompute = ActivitiesNode.Nodes.InsertChildrenWithMatchingParentReference(computeData, endpointData, "Id", "ID", "VirtualMachine", "Virtual Machine", "Owner"); + var orphanedCompute = ActivitiesNode.Nodes.InsertChildrenWithMatchingParentReference(computeData, endpointData, "RuntimeId", "ID", "VirtualMachine", "Virtual Machine", "Owner"); UpdateLoadingState("Inserting container children..."); orphanedCompute = ActivitiesNode.Nodes.InsertChildrenWithMatchingParentReference(orphanedCompute, endpointData, "Id", "ID", "SharedContainers", "Container", "Owner"); UpdateLoadingState("Building orphan tree..."); OrphansNode = new TreeNode("Orphaned Data"); + OrphansNode.Nodes.InsertChildren(orphanedNamesaces, "ID", "Namespace", "ID"); OrphansNode.Nodes.InsertChildren(orphanedActivities, "ID", "Activities", "Allocators.Tag"); OrphansNode.Nodes.InsertChildren(orphanedNetworks, "ID", "Network", "Name"); OrphansNode.Nodes.InsertChildren(orphanedEndpoints, "ID", "Endpoint", "Name"); OrphansNode.Nodes.InsertChildren(orphanedPolicies, "ID", "Endpoint", "Name"); OrphansNode.Nodes.InsertChildren(orphanedCompute, "ID", "Compute", "Name"); - UpdateLoadingState("Building namespaces tree..."); - NamespacesNode = new TreeNode - { - Text = "Namespaces", - Tag = $"{namespaceData.Count()} namespaces" - }; - NamespacesNode.Nodes.InsertChildren(namespaceData, "ID", "Namespace", "CompartmentId"); - UpdateLoadingState("Building data snapshot..."); var allData = new Dictionary> { diff --git a/Extensions/JsonElementExtensions.cs b/Extensions/JsonElementExtensions.cs index 0311097..7d26975 100644 --- a/Extensions/JsonElementExtensions.cs +++ b/Extensions/JsonElementExtensions.cs @@ -162,7 +162,7 @@ public static bool HasJsonData(this JsonElement element, string properties) { result = innerElement.GetString() ?? string.Empty; } - if (result.Contains(expectedValue)) + if (result.Contains(expectedValue, StringComparison.InvariantCultureIgnoreCase)) { return element; } diff --git a/SummaryForm.cs b/SummaryForm.cs index cf8fec8..fbaaf36 100644 --- a/SummaryForm.cs +++ b/SummaryForm.cs @@ -44,7 +44,6 @@ private void LoadTreeview() richTextBox1.Text = datasource.SummaryOutput; treeView1.Nodes.Clear(); treeView1.Nodes.Add(datasource.ActivitiesNode); - treeView1.Nodes.Add(datasource.NamespacesNode); treeView1.Nodes.Add(datasource.RoutesNode); if (datasource.OrphansNode.Nodes.Count > 0)