mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-04-24 13:05:48 +00:00
Bug fixed
This commit is contained in:
parent
42f1f8b49a
commit
02be6b2449
@ -34,31 +34,39 @@ export class GraphDataManager {
|
||||
) {}
|
||||
|
||||
public setNodes(nodes: Node[]) {
|
||||
const mapNodes = nodes.map(n => this.nodeToMapNode.convert(n));
|
||||
this.mapNodesDataSource.set(mapNodes);
|
||||
if (nodes) {
|
||||
const mapNodes = nodes.map(n => this.nodeToMapNode.convert(n));
|
||||
this.mapNodesDataSource.set(mapNodes);
|
||||
|
||||
this.assignDataToLinks();
|
||||
this.onDataUpdate();
|
||||
this.assignDataToLinks();
|
||||
this.onDataUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
public setLinks(links: Link[]) {
|
||||
const mapLinks = links.map(l => this.linkToMapLink.convert(l));
|
||||
this.mapLinksDataSource.set(mapLinks);
|
||||
if (links) {
|
||||
const mapLinks = links.map(l => this.linkToMapLink.convert(l));
|
||||
this.mapLinksDataSource.set(mapLinks);
|
||||
|
||||
this.assignDataToLinks();
|
||||
this.onDataUpdate();
|
||||
this.assignDataToLinks();
|
||||
this.onDataUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
public setDrawings(drawings: Drawing[]) {
|
||||
const mapDrawings = drawings.map(d => this.drawingToMapDrawing.convert(d));
|
||||
this.mapDrawingsDataSource.set(mapDrawings);
|
||||
|
||||
this.onDataUpdate();
|
||||
if (drawings) {
|
||||
const mapDrawings = drawings.map(d => this.drawingToMapDrawing.convert(d));
|
||||
this.mapDrawingsDataSource.set(mapDrawings);
|
||||
|
||||
this.onDataUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
public setSymbols(symbols: Symbol[]) {
|
||||
const mapSymbols = symbols.map(s => this.symbolToMapSymbol.convert(s));
|
||||
this.mapSymbolsDataSource.set(mapSymbols);
|
||||
if (symbols) {
|
||||
const mapSymbols = symbols.map(s => this.symbolToMapSymbol.convert(s));
|
||||
this.mapSymbolsDataSource.set(mapSymbols);
|
||||
}
|
||||
}
|
||||
|
||||
public getNodes() {
|
||||
|
@ -16,16 +16,17 @@ export class InterfaceStatusWidget implements Widget {
|
||||
const link_group = select<SVGGElement, MapLink>(this);
|
||||
const link_path = link_group.select<SVGPathElement>('path');
|
||||
|
||||
const start_point: SVGPoint = link_path.node().getPointAtLength(45);
|
||||
const end_point: SVGPoint = link_path.node().getPointAtLength(link_path.node().getTotalLength() - 45);
|
||||
|
||||
let statuses = [];
|
||||
if (link_path.node()) {
|
||||
const start_point: SVGPoint = link_path.node().getPointAtLength(45);
|
||||
const end_point: SVGPoint = link_path.node().getPointAtLength(link_path.node().getTotalLength() - 45);
|
||||
|
||||
if (link_path.node().getTotalLength() > 2 * 45 + 10) {
|
||||
statuses = [
|
||||
new LinkStatus(start_point.x, start_point.y, l.source.status),
|
||||
new LinkStatus(end_point.x, end_point.y, l.target.status)
|
||||
];
|
||||
if (link_path.node().getTotalLength() > 2 * 45 + 10) {
|
||||
statuses = [
|
||||
new LinkStatus(start_point.x, start_point.y, l.source.status),
|
||||
new LinkStatus(end_point.x, end_point.y, l.target.status)
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
const status_started = link_group
|
||||
|
Loading…
x
Reference in New Issue
Block a user