blob: e329874554e98e8310704912b23155907f95302e [file] [log] [blame]
Sean Condon0c577f62018-11-18 22:40:05 +00001<!--
2~ Copyright 2018-present Open Networking Foundation
3~
4~ Licensed under the Apache License, Version 2.0 (the "License");
5~ you may not use this file except in compliance with the License.
6~ You may obtain a copy of the License at
7~
8~ http://www.apache.org/licenses/LICENSE-2.0
9~
10~ Unless required by applicable law or agreed to in writing, software
11~ distributed under the License is distributed on an "AS IS" BASIS,
12~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13~ See the License for the specific language governing permissions and
14~ limitations under the License.
15-->
16<svg:g xmlns:svg="http://www.w3.org/2000/svg" #devSvg
17 [attr.transform]="'translate(' + device?.x + ',' + device?.y + '), scale(' + scale + ')'"
18 [ngClass]="['node', 'device', device.online?'online':'', selected?'selected':'']"
Sean Condon021f0fa2018-12-06 23:31:11 -080019 (click)="toggleSelected(device)">
Sean Condon0c577f62018-11-18 22:40:05 +000020 <svg:rect class="node-container" x="-18" y="-18" width="36" height="36">
21 <!--[attr.width]="devText.getComputedTextLength()+36" -->
22 <!--[@deviceLabelToggle]="{ value: labelToggle, params: {txtWidth: devSvg.getBBox().width+'px' }}">-->
23 </svg:rect>
24 <svg:rect x="-16" y="-16" width="32" height="32" [ngStyle]="{'fill': 'rgb(91, 153, 210)'}">
25 </svg:rect>
26 <svg:text #devText text-anchor="start" y="0.3em" x="22" [ngStyle]="{'transform': 'scale(' + scale + ')'}">
27 {{ labelToggle == 0 ? '': labelToggle == 1 ? device.id:device.props.name }}
28 </svg:text>
Sean Condon021f0fa2018-12-06 23:31:11 -080029 <!-- It's not possible to drive the following xref dynamically -->
30 <svg:use *ngIf="device.type == 'switch'" xlink:href="#m_switch" width="36" height="36" x="-18" y="-18">
31 </svg:use>
32 <svg:use *ngIf="device.type == 'roadm'" xlink:href="#m_roadm" width="36" height="36" x="-18" y="-18">
33 </svg:use>
Sean Condon0c577f62018-11-18 22:40:05 +000034</svg:g>