Sean Condon | f4f54a1 | 2018-10-10 23:25:46 +0100 | [diff] [blame] | 1 | <!-- |
| 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 Condon | 0c577f6 | 2018-11-18 22:40:05 +0000 | [diff] [blame] | 16 | <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 Condon | 021f0fa | 2018-12-06 23:31:11 -0800 | [diff] [blame] | 19 | <!-- Template explanation: Creates an SVG Group and in |
Sean Condon | 50855cf | 2018-12-23 15:37:42 +0000 | [diff] [blame] | 20 | line 1) use the svg component onos-linksvg, setting it's link |
Sean Condon | 021f0fa | 2018-12-06 23:31:11 -0800 | [diff] [blame] | 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 | --> |
Sean Condon | 50855cf | 2018-12-23 15:37:42 +0000 | [diff] [blame] | 25 | <svg:g onos-linksvg [link]="link" |
| 26 | *ngFor="let link of filteredLinks()" |
| 27 | (selectedEvent)="updateSelected($event)"> |
Sean Condon | 0c577f6 | 2018-11-18 22:40:05 +0000 | [diff] [blame] | 28 | </svg:g> |
| 29 | </svg:g> |
| 30 | <svg:g class="topo2-linkLabels" /> |
| 31 | <svg:g class="topo2-numLinkLabels" /> |
| 32 | <svg:g class="topo2-nodes"> |
Sean Condon | 021f0fa | 2018-12-06 23:31:11 -0800 | [diff] [blame] | 33 | <!-- 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 Condon | 0c577f6 | 2018-11-18 22:40:05 +0000 | [diff] [blame] | 45 | <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 Condon | 021f0fa | 2018-12-06 23:31:11 -0800 | [diff] [blame] | 50 | <!-- 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 Condon | 0c577f6 | 2018-11-18 22:40:05 +0000 | [diff] [blame] | 69 | </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 | <!--<!–TODO make each of these in to a component that can be inserted –>--> |
| 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 Condon | f4f54a1 | 2018-10-10 23:25:46 +0100 | [diff] [blame] | 88 | </svg:g> |