Skip to content

Commit

Permalink
Merge pull request #591 from openziti/VW_component_count_Fix
Browse files Browse the repository at this point in the history
nw visualizer component count fix, groups, subgroups
  • Loading branch information
rgallettonf authored Jan 14, 2025
2 parents 6f25976 + c50ad46 commit fa0e49c
Show file tree
Hide file tree
Showing 2 changed files with 180 additions and 279 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export class NetworkVisualizerComponent extends VisualizerServiceClass implement
treeData;
graphtooltip;
searchCache;
allPromises = [];

constructor(
@Inject(SETTINGS_SERVICE) public settingsService: SettingsService,
Expand Down Expand Up @@ -171,6 +172,7 @@ export class NetworkVisualizerComponent extends VisualizerServiceClass implement
});
});
promises.push(tmp_promise);
this.allPromises.push(tmp_promise);
}
Promise.all(promises).then(() => {
// this.identities_totalCount = this.identities.length;
Expand Down Expand Up @@ -209,6 +211,7 @@ export class NetworkVisualizerComponent extends VisualizerServiceClass implement
});
});
s_promises.push(tmp_promise);
this.allPromises.push(tmp_promise);
}
Promise.all(s_promises).then(() => {
// this.services_totalCount = this.services.length;
Expand Down Expand Up @@ -247,6 +250,7 @@ export class NetworkVisualizerComponent extends VisualizerServiceClass implement
});
});
sp_promises.push(tmp_promise);
this.allPromises.push(tmp_promise);
}

Promise.all(sp_promises).then(() => {
Expand Down Expand Up @@ -286,6 +290,7 @@ export class NetworkVisualizerComponent extends VisualizerServiceClass implement
});
});
r_promises.push(tmp_promise);
this.allPromises.push(tmp_promise);
}
Promise.all(r_promises).then(() => {
// this.edgerouters_totalCount = this.edgerouters.length;
Expand Down Expand Up @@ -324,6 +329,7 @@ export class NetworkVisualizerComponent extends VisualizerServiceClass implement
});
});
r_promises.push(tmp_promise);
this.allPromises.push(tmp_promise);
}

Promise.all(r_promises).then(() => {
Expand All @@ -345,7 +351,7 @@ export class NetworkVisualizerComponent extends VisualizerServiceClass implement
if (!this.service_router_policies || this.service_router_policies.length === 0) {
this.isLoading = false;
} else if (this.service_router_policies_totalCount < this.maxObjectsPerNode) {
this.all_service_router_policies_fetched = false;
this.all_service_router_policies_fetched = true;
const pages = Math.ceil(result.meta.pagination.totalCount / pagesize);
const r_promises = [];
for (let page = 2; page <= pages; page++) {
Expand All @@ -362,6 +368,7 @@ export class NetworkVisualizerComponent extends VisualizerServiceClass implement
});
});
r_promises.push(tmp_promise);
this.allPromises.push(tmp_promise);
}
Promise.all(r_promises).then(() => {
// this.service_router_policies_totalCount = this.service_router_policies.length;
Expand Down Expand Up @@ -398,6 +405,7 @@ export class NetworkVisualizerComponent extends VisualizerServiceClass implement
});
});
r_promises.push(tmp_promise);
this.allPromises.push(tmp_promise);
}
Promise.all(r_promises).then(() => {
const configs_totalCount = this.configs.length;
Expand All @@ -414,17 +422,21 @@ export class NetworkVisualizerComponent extends VisualizerServiceClass implement
let networkVisPromises =[];
const pagesize = 500;
const eps = this.fetchIdentities(pagesize);
this.allPromises.push(eps);
const ss = this.fetchServices(pagesize);
this.allPromises.push(ss);
const sps = this.fetchServicePolicies(pagesize);
this.allPromises.push(sps);
const ers = this.fetchEdgeRouters(pagesize);
this.allPromises.push(eps);
const erps = this.findEdgeRouterPolicies(pagesize);
this.allPromises.push(erps);
const serps = this.fetchServiceEdgeRouterPolicies(pagesize);
this.allPromises.push(serps);
const cfg = this.fetchConfigs(pagesize);
Promise.all([eps, ss, sps, ers, erps, erps, serps, cfg]).then(() => {
resolve('end');
});
this.allPromises.push(cfg);
Promise.all(this.allPromises).then((res) => {resolve('end'); });
});

}

processFirstNetworkGraph() {
Expand Down Expand Up @@ -775,6 +787,7 @@ export class NetworkVisualizerComponent extends VisualizerServiceClass implement
}
return targetNodes;
}

clearSearchLinkColors() {
this.svg.selectAll('path.link').each( function (this: any, d:any) {
d3.select(this).style('stroke', 'white');
Expand Down
Loading

0 comments on commit fa0e49c

Please sign in to comment.