Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor fixes on node type, name, color and subgroupsize #608

Merged
merged 1 commit into from
Jan 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@ export class NetworkVisualizerComponent extends VisualizerServiceClass implement
if (_.startsWith(d.data.name, 'Edge Routers') || _.includes(d.data.type, 'Edge Router')) {
className = 'edge-router';
}
if (_.includes(d.data.name, 'Identities') || _.includes(d.data.name, 'Associated Identities') || _.includes(d.data.type, 'Identity') || _.includes(d.data.type, 'BrowZer Identity')) {
if (_.includes(d.data.name, 'Identities') || _.includes(d.data.name, 'Identity') || _.includes(d.data.name, 'Associated Identities') || _.includes(d.data.type, 'Identity') || _.includes(d.data.type, 'BrowZer Identity')) {
className = 'endpoint';
}
if (_.startsWith(d.data.name, 'Services') || _.startsWith(d.data.type, 'Service')) {
Expand All @@ -1235,7 +1235,7 @@ export class NetworkVisualizerComponent extends VisualizerServiceClass implement
if (_.includes(d.data.name, 'Service Policies') || _.includes(d.data.type, 'Service Policy')) {
className = 'service-policy';
}
if (_.startsWith(d.data.name, 'Edge Router Policies') || _.startsWith(d.data.type, 'Router Policy')) {
if (_.startsWith(d.data.name, 'Edge Router Policies') || _.startsWith(d.data.type, 'Edge Router Policy')) {
className = 'edge-router-policy';
}
if (
Expand Down Expand Up @@ -1351,7 +1351,7 @@ export class NetworkVisualizerComponent extends VisualizerServiceClass implement
disableLi('#liSingleUT');

this.contextmenuNodeType = 'service-policy';
} else if (d && d.data && d.data.type === 'Router Policy') {
} else if (d && d.data && d.data.type === 'Edge Router Policy') {
disableLi('#liMet');
disableLi('#liIns');
enableLi('#liVC');
Expand Down Expand Up @@ -1417,20 +1417,23 @@ export class NetworkVisualizerComponent extends VisualizerServiceClass implement
})
.on('click', async ( event, d: any) => {
if (d.data.rootNode && d.data.rootNode === 'Yes' && d.data.clickProcess === 'Not Yet') {
d3.select(event.currentTarget).transition()
.duration(600)
.style("stroke-width", "10")
d3.select(event.currentTarget).transition()
.duration(400)
.style("1stroke-width", "10")
.transition()
.duration(1600)
.style("stroke-width", "6")
.transition()
.duration(600)
.style("stroke-width", "6")
.transition()
.duration(600)
.style("stroke-width", "3")
.style("stroke-width", "3")
.transition()
.duration(1600)
.style("stroke-width", "6")
.transition()
.duration(600)
.style("stroke-width", "9")
.transition()
.duration(600)
.duration(1000)
.style("stroke-width", "12");
}
if (d && d.data && d.data.contextMenu === 'Yes') {
Expand All @@ -1449,7 +1452,8 @@ export class NetworkVisualizerComponent extends VisualizerServiceClass implement
this.openNodes.push(d.data.id);
}
if (d.data.clickProcess === 'Not Yet') {
d._children = null;
let transitionLoop = true;
d._children = null;
if (
d.data &&
d.data.rootNode &&
Expand Down Expand Up @@ -1544,7 +1548,7 @@ export class NetworkVisualizerComponent extends VisualizerServiceClass implement
d.data &&
d.data.rootNode &&
d.data.rootNode === 'Yes' &&
d.data.type === 'Router Policy' &&
d.data.type === 'Edge Router Policy' &&
!d.children &&
!d._children
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ export class NetworkVisualizerHelper {
// erpolicy.id = createId();
erpolicy.uuid = rawObj.id;
erpolicy.name = rawObj.name;
erpolicy.type = 'Router Policy';
erpolicy.type = 'Edge Router Policy';
erpolicy.rootNode = isRootNode;
erpolicy.isSystem = rawObj.isSystem;
erpolicy.semantic = rawObj.semantic;
Expand Down Expand Up @@ -376,7 +376,7 @@ export class NetworkVisualizerHelper {

}
function subGrouping(name, mainGroup) {
const pageSize = 50;
const pageSize = 25;
mainGroup.children.sort(function (a, b) {
return a.name.localeCompare(b.name);
});
Expand Down Expand Up @@ -685,13 +685,13 @@ export class NetworkVisualizerHelper {
erpolicy.id = createId();
erpolicy.uuid = edgeRouterPolicies[i].id;
erpolicy.name = edgeRouterPolicies[i].name;
erpolicy.type = 'Router Policy';
erpolicy.type = 'Edge Router Policy';
erpolicy.rootNode = 'Yes';
erpolicy.isSystem = edgeRouterPolicies[i].isSystem;
erpolicy.semantic = edgeRouterPolicies[i].semantic;
policies_Array.push(erpolicy);
} // end of main for loop
return grouping('RouterPolicies',edgeRouterPoliciesChildren,policies_Array);
return grouping('Edge Router Policies',edgeRouterPoliciesChildren,policies_Array);
} // end

function processServiceEdgeRouterPoliciesForTree(
Expand Down Expand Up @@ -743,7 +743,7 @@ export class NetworkVisualizerHelper {
}
} // end main for loop
// return routersChildren;
return grouping('Router', routersChildren, er_objects);
return grouping('Edge Router', routersChildren, er_objects);
}

// createId() generates node Id 1,2,3,4,5 for the following five nodes. this id is used to search capability.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ export class TreeNodeProcessor {
if (rawEp.roleAttributes) {rawEpAttributes = rawEp.roleAttributes};

for (let i = 0; i < rawEpAttributes.length; i++) {
const attribute = new Attribute();
attribute.id = this.createId();
attribute.name = rawEpAttributes[i];
attribute.type = 'Identity Attribute';
identityNode.data.children.push(attribute);
}
const attribute = new Attribute();
attribute.id = this.createId();
attribute.name = rawEpAttributes[i];
attribute.type = 'Identity Attribute';
identityNode.data.children.push(attribute);
}

const bindServices = new Children();
const dialServices = new Children();
Expand All @@ -56,15 +56,15 @@ export class TreeNodeProcessor {
const paging = this.getPagingObject(pagesize);
const erChailds = new Children();
erChailds.id = this.createId();
erChailds.name= 'Associated Routers';
erChailds.type= 'Associated Routers';
erChailds.name= 'Associated Edge Routers';
erChailds.type= 'Edge Routers';
const associatedRoutersPromise = await zitiService.get(url, paging, [])
.then( (result) => {
result.data.forEach( (re) => {
const tmp = new ERouter();
tmp.id = this.createId();
tmp.name = re.name;
tmp.type = 'Router';
tmp.type = 'Edge Router';
erChailds.children.push(tmp);
} );
});
Expand Down Expand Up @@ -391,14 +391,14 @@ export class TreeNodeProcessor {
const erOb = new ERouter();
erOb.id = this.createId();
erOb.name = er.name;
er.type = 'Router';
er.type = 'Edge Router';
associatedRouters.push(erOb);
});
}
})
const tmp = new Children();
tmp.name = "Associated Routers(" + associatedRouters.length +')';
tmp.type = "Routers";
tmp.name = "Associated Edge Routers(" + associatedRouters.length +')';
tmp.type = "Edge Routers";
tmp.children = associatedRouters;
tmp.id = this.createId();
serviceNode.data.children.push(tmp);
Expand Down Expand Up @@ -618,7 +618,7 @@ export class TreeNodeProcessor {
policy.id = this.createId();
policy.uuid = pol.id;
policy.name = pol.name;
policy.type = 'Router Policy';
policy.type = 'Edge Router Policy';
policy.isSystem = pol.isSystem;
policy.semantic = pol.semantic;
policy.rootNode = 'No';
Expand Down Expand Up @@ -819,16 +819,16 @@ export class TreeNodeProcessor {
let associatedRouters = [];
const paging = this.getPagingObject(pagesize);
const erChailds = new Children();
erChailds.name= 'Associated Routers';
erChailds.type= 'Associated Routers';
erChailds.name= 'Associated Edge Routers';
erChailds.type= 'Edge Routers';
erChailds.id = this.createId();
const associatedRoutersPromise = await zitiService.get(er_url, paging, [])
.then( (result) => {
result.data.forEach( (er) => {
const tmp = new ERouter();
tmp.id = this.createId();
tmp.name = er.name;
tmp.type = 'Router';
tmp.type = 'Edge Router';
tmp.verified = er.isVerified? 'Yes': 'No';
tmp.online = er.isOnline? 'Yes': 'No';
tmp.disabled = er.disabled? 'Yes': 'No';
Expand Down Expand Up @@ -935,7 +935,7 @@ export class TreeNodeProcessor {
idOb.type = 'Edge Router';
erChilds.children.push(idOb);
});
erChilds.name = "EdgeRouters("+ erChilds.children.length +')';
erChilds.name = "Edge Routers("+ erChilds.children.length +')';
serviceErPolicyNode.data.children.push(erChilds);
});
});
Expand Down
Loading