blob: af33384a5a8fa9371e9842feb3d0772e8e48d8b8 [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
Sean Condon50855cf2018-12-23 15:37:42 +000020 line 1) use the svg component onos-linksvg, setting it's link
Sean Condon021f0fa2018-12-06 23:31:11 -080021 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 -->
Sean Condon50855cf2018-12-23 15:37:42 +000025 <svg:g onos-linksvg [link]="link"
26 *ngFor="let link of filteredLinks()"
27 (selectedEvent)="updateSelected($event)">
Sean Condon0c577f62018-11-18 22:40:05 +000028 </svg:g>
29 </svg:g>
30 <svg:g class="topo2-linkLabels" />
31 <svg:g class="topo2-numLinkLabels" />
32 <svg:g class="topo2-nodes">
Sean Condon021f0fa2018-12-06 23:31:11 -080033 <!-- Template explanation - create an SVG Group and
34 line 1) use the svg component onos-devicenodesvg, setting it's device
35 Input parameter to the device item from the next line
36 line 2) Use the built in NgFor directive to iterate through all
37 of the devices in the chosen layer index. The current iteration
38 is in the device variable
39 line 3) Use the onosDraggable directive and pass this device in to
40 its draggableNode Input parameter and setting the draggableInGraph
41 Input parameter to 'graph'
42 line 4) when the onos-devicenodesvg component emits the selectedEvent
43 call the updateSelected() method of this (forcesvg) component
44 -->
Sean Condon0c577f62018-11-18 22:40:05 +000045 <svg:g onos-devicenodesvg [device]="device"
46 *ngFor="let device of regionData.devices[visibleLayerIdx()]"
47 onosDraggableNode [draggableNode]="device" [draggableInGraph]="graph"
48 (selectedEvent)="updateSelected($event)">
49 </svg:g>
Sean Condon021f0fa2018-12-06 23:31:11 -080050 <!-- Template explanation - only display the hosts if 'showHosts' is set true -->
51 <svg:g *ngIf="showHosts">
52 <!-- Template explanation - create an SVG Group and
53 line 1) use the svg component onos-hostnodesvg, setting it's host
54 Input parameter to the host item from the next line
55 line 2) Use the built in NgFor directive to iterate through all
56 of the hosts in the chosen layer index. The current iteration
57 is in the 'host' variable
58 line 3) Use the onosDraggable directive and pass this host in to
59 its draggableNode Input parameter and setting the draggableInGraph
60 Input parameter to 'graph'
61 line 4) when the onos-hostnodesvg component emits the selectedEvent
62 call the updateSelected() method of this (forcesvg) component
63 -->
64 <svg:g onos-hostnodesvg [host]="host"
65 *ngFor="let host of regionData.hosts[visibleLayerIdx()]"
66 onosDraggableNode [draggableNode]="host" [draggableInGraph]="graph"
67 (selectedEvent)="updateSelected($event)">
68 </svg:g>
Sean Condon0c577f62018-11-18 22:40:05 +000069 </svg:g>
70 <svg:g onos-subregionnodesvg [subRegion]="subRegion"
71 *ngFor="let subRegion of regionData.subregions"
72 onosDraggableNode [draggableNode]="host" [draggableInGraph]="graph">
73 </svg:g>
74 </svg:g>
75 </svg:g>
76 <!--<svg:g class="topo2-portLabels">-->
77 <!--&lt;!&ndash;TODO make each of these in to a component that can be inserted &ndash;&gt;-->
78 <!--<svg:g *ngIf="selectedLink !== null" id="topo-port-src" class="portLabel" opacity="1">-->
79 <!--<rect x="0" y="0" width="1" height="1" [ngStyle]="{'transform': 'scale(1)'}"></rect>-->
80 <!--<text dy="0.3em" [ngStyle]="{'transform': 'scale(1)'}">{{ selectedLink.portA }}</text>-->
81 <!--</svg:g>-->
82
83 <!--<svg:g *ngIf="selectedLink !== null" id="topo-port-tgt" class="portLabel" opacity="1">-->
84 <!--<rect x="0" y="0" width="1" height="1" [ngStyle]="{'transform': 'scale(1)'}"></rect>-->
85 <!--<text dy="0.3em" [ngStyle]="{'transform': 'scale(1)'}">{{ selectedLink.portA }}</text>-->
86 <!--</svg:g>-->
87 <!--</svg:g>-->
Sean Condonf4f54a12018-10-10 23:25:46 +010088</svg:g>