mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2024-12-20 13:33:06 +00:00
InterfaceStatus updated
This commit is contained in:
parent
7ee47d2e86
commit
01ea42e930
@ -20,6 +20,7 @@ export class MapLink implements Indexed {
|
|||||||
target: MapNode; // this is not from server
|
target: MapNode; // this is not from server
|
||||||
|
|
||||||
isSelected = false; // this is not from server
|
isSelected = false; // this is not from server
|
||||||
|
isMultiplied = false; // this is not from server
|
||||||
x: number; // this is not from server
|
x: number; // this is not from server
|
||||||
y: number; // this is not from server
|
y: number; // this is not from server
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,22 @@ export class InterfaceStatusWidget implements Widget {
|
|||||||
|
|
||||||
public draw(view: SVGSelection) {
|
public draw(view: SVGSelection) {
|
||||||
const self = this;
|
const self = this;
|
||||||
|
let mapLinks: MapLink[] = [];
|
||||||
|
|
||||||
|
view.each(function(this: SVGGElement, l: MapLink) {
|
||||||
|
mapLinks.push(l);
|
||||||
|
});
|
||||||
|
mapLinks.forEach(mapLink => {
|
||||||
|
mapLinks.forEach(n => {
|
||||||
|
if (n.nodes[0].linkId !== mapLink.nodes[0].linkId){
|
||||||
|
if ((mapLink.nodes[0].nodeId === n.nodes[0].nodeId && mapLink.nodes[1].nodeId === n.nodes[1].nodeId) ||
|
||||||
|
(mapLink.nodes[0].nodeId === n.nodes[1].nodeId && mapLink.nodes[1].nodeId === n.nodes[0].nodeId) ||
|
||||||
|
(mapLink.nodes[1].nodeId === n.nodes[0].nodeId && mapLink.nodes[0].nodeId === n.nodes[1].nodeId)) {
|
||||||
|
mapLink.isMultiplied = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
view.each(function(this: SVGGElement, l: MapLink) {
|
view.each(function(this: SVGGElement, l: MapLink) {
|
||||||
const link_group = select<SVGGElement, MapLink>(this);
|
const link_group = select<SVGGElement, MapLink>(this);
|
||||||
@ -62,7 +78,7 @@ export class InterfaceStatusWidget implements Widget {
|
|||||||
link_group
|
link_group
|
||||||
.selectAll<SVGTextElement, LinkStatus>('text.status_suspended_label').remove();
|
.selectAll<SVGTextElement, LinkStatus>('text.status_suspended_label').remove();
|
||||||
|
|
||||||
if (self.mapSettingsService.integrateLinkLabelsToLinks) {
|
if (self.mapSettingsService.integrateLinkLabelsToLinks && !l.isMultiplied) {
|
||||||
const status_started = link_group
|
const status_started = link_group
|
||||||
.selectAll<SVGRectElement, LinkStatus>('rect.status_started')
|
.selectAll<SVGRectElement, LinkStatus>('rect.status_started')
|
||||||
.data(statuses.filter((link_status: LinkStatus) => link_status.status === 'started'));
|
.data(statuses.filter((link_status: LinkStatus) => link_status.status === 'started'));
|
||||||
|
Loading…
Reference in New Issue
Block a user