blob: 1f1d757911b63e2f0d2f749ccad84acf2f11797a [file] [log] [blame]
Sean Condonf4f54a12018-10-10 23:25:46 +01001<!--
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-->
Sean Condon0c577f62018-11-18 22:40:05 +000016<svg:g class="topo2-force" xmlns:svg="http://www.w3.org/2000/svg">
17 <svg:g id="new-zoom-layer">
18 <svg:g class="topo2-links">
Sean Condon021f0fa2018-12-06 23:31:11 -080019 <!-- Template explanation: Creates an SVG Group and in
20 line 1) use the svg component onos-linkvisual, setting it's link
21 Input parameter to the link item from the next line
22 line 2) Use the built in NgFor directive to iterate through the
23 set of links filtered by the filteredLinks() function.
24 -->
25 <svg:g onos-linkvisual [link]="link"
26 *ngFor="let link of filteredLinks()">
Sean Condon0c577f62018-11-18 22:40:05 +000027 </svg:g>
28 </svg:g>
29 <svg:g class="topo2-linkLabels" />
30 <svg:g class="topo2-numLinkLabels" />
31 <svg:g class="topo2-nodes">
Sean Condon021f0fa2018-12-06 23:31:11 -080032 <!-- Template explanation - create an SVG Group and
33 line 1) use the svg component onos-devicenodesvg, setting it's device
34 Input parameter to the device item from the next line
35 line 2) Use the built in NgFor directive to iterate through all
36 of the devices in the chosen layer index. The current iteration
37 is in the device variable
38 line 3) Use the onosDraggable directive and pass this device in to
39 its draggableNode Input parameter and setting the draggableInGraph
40 Input parameter to 'graph'
41 line 4) when the onos-devicenodesvg component emits the selectedEvent
42 call the updateSelected() method of this (forcesvg) component
43 -->
Sean Condon0c577f62018-11-18 22:40:05 +000044 <svg:g onos-devicenodesvg [device]="device"
45 *ngFor="let device of regionData.devices[visibleLayerIdx()]"
46 onosDraggableNode [draggableNode]="device" [draggableInGraph]="graph"
47 (selectedEvent)="updateSelected($event)">
48 </svg:g>
Sean Condon021f0fa2018-12-06 23:31:11 -080049 <!-- Template explanation - only display the hosts if 'showHosts' is set true -->
50 <svg:g *ngIf="showHosts">
51 <!-- Template explanation - create an SVG Group and
52 line 1) use the svg component onos-hostnodesvg, setting it's host
53 Input parameter to the host item from the next line
54 line 2) Use the built in NgFor directive to iterate through all
55 of the hosts in the chosen layer index. The current iteration
56 is in the 'host' variable
57 line 3) Use the onosDraggable directive and pass this host in to
58 its draggableNode Input parameter and setting the draggableInGraph
59 Input parameter to 'graph'
60 line 4) when the onos-hostnodesvg component emits the selectedEvent
61 call the updateSelected() method of this (forcesvg) component
62 -->
63 <svg:g onos-hostnodesvg [host]="host"
64 *ngFor="let host of regionData.hosts[visibleLayerIdx()]"
65 onosDraggableNode [draggableNode]="host" [draggableInGraph]="graph"
66 (selectedEvent)="updateSelected($event)">
67 </svg:g>
Sean Condon0c577f62018-11-18 22:40:05 +000068 </svg:g>
69 <svg:g onos-subregionnodesvg [subRegion]="subRegion"
70 *ngFor="let subRegion of regionData.subregions"
71 onosDraggableNode [draggableNode]="host" [draggableInGraph]="graph">
72 </svg:g>
73 </svg:g>
74 </svg:g>
75 <!--<svg:g class="topo2-portLabels">-->
76 <!--&lt;!&ndash;TODO make each of these in to a component that can be inserted &ndash;&gt;-->
77 <!--<svg:g *ngIf="selectedLink !== null" id="topo-port-src" class="portLabel" opacity="1">-->
78 <!--<rect x="0" y="0" width="1" height="1" [ngStyle]="{'transform': 'scale(1)'}"></rect>-->
79 <!--<text dy="0.3em" [ngStyle]="{'transform': 'scale(1)'}">{{ selectedLink.portA }}</text>-->
80 <!--</svg:g>-->
81
82 <!--<svg:g *ngIf="selectedLink !== null" id="topo-port-tgt" class="portLabel" opacity="1">-->
83 <!--<rect x="0" y="0" width="1" height="1" [ngStyle]="{'transform': 'scale(1)'}"></rect>-->
84 <!--<text dy="0.3em" [ngStyle]="{'transform': 'scale(1)'}">{{ selectedLink.portA }}</text>-->
85 <!--</svg:g>-->
86 <!--</svg:g>-->
Sean Condonf4f54a12018-10-10 23:25:46 +010087</svg:g>