From e228ac2654179076cc5128ce89df5cd89bdc5e5d Mon Sep 17 00:00:00 2001 From: piotrpekala7 <31202938+piotrpekala7@users.noreply.github.com> Date: Tue, 21 Jul 2020 20:02:55 +0200 Subject: [PATCH] Update interface-status.ts --- src/app/cartography/widgets/interface-status.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/app/cartography/widgets/interface-status.ts b/src/app/cartography/widgets/interface-status.ts index e6687b42..57f755ba 100644 --- a/src/app/cartography/widgets/interface-status.ts +++ b/src/app/cartography/widgets/interface-status.ts @@ -70,7 +70,9 @@ export class InterfaceStatusWidget implements Widget { status_started .merge(status_started_enter) .attr('class', 'status_started') - .attr('width', 60) + .attr('width', (ls: LinkStatus) => { + return (ls.port.length * 8) + 10; + }) .attr('height', 20) .attr('x', (ls: LinkStatus) => ls.x - 30) .attr('y', (ls: LinkStatus) => ls.y - 10) @@ -100,7 +102,9 @@ export class InterfaceStatusWidget implements Widget { status_stopped .merge(status_stopped_enter) .attr('class', 'status_stopped') - .attr('width', 60) + .attr('width', (ls: LinkStatus) => { + return (ls.port.length * 8) + 10; + }) .attr('height', 20) .attr('x', (ls: LinkStatus) => ls.x - 30) .attr('y', (ls: LinkStatus) => ls.y - 10) @@ -130,7 +134,9 @@ export class InterfaceStatusWidget implements Widget { status_suspended .merge(status_suspended_enter) .attr('class', 'status_suspended') - .attr('width', 60) + .attr('width', (ls: LinkStatus) => { + return (ls.port.length * 8) + 10; + }) .attr('height', 20) .attr('x', (ls: LinkStatus) => ls.x - 30) .attr('y', (ls: LinkStatus) => ls.y - 10)