Sean Condon | f4f54a1 | 2018-10-10 23:25:46 +0100 | [diff] [blame] | 1 | <!-- |
Sean Condon | 9148182 | 2019-01-01 13:56:14 +0000 | [diff] [blame] | 2 | ~ Copyright 2019-present Open Networking Foundation |
Sean Condon | f4f54a1 | 2018-10-10 23:25:46 +0100 | [diff] [blame] | 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 | 9148182 | 2019-01-01 13:56:14 +0000 | [diff] [blame] | 16 | <svg:desc xmlns:svg="http://www.w3.org/2000/svg">The force layout layer. This is |
| 17 | an SVG component that displays Nodes (Devices, Hosts and SubRegions) and |
| 18 | Links. Positions of each are driven by a forces computation engine</svg:desc> |
| 19 | <svg:g xmlns:svg="http://www.w3.org/2000/svg" class="topo2-links"> |
| 20 | <svg:desc>Topology links</svg:desc> |
| 21 | <!-- Template explanation: Creates an SVG Group and in |
| 22 | line 1) use the svg component onos-linksvg, setting it's link |
| 23 | Input parameter to the link item from the next line |
| 24 | line 2) Use the built in NgFor directive to iterate through the |
| 25 | set of links filtered by the filteredLinks() function. |
| 26 | --> |
| 27 | <svg:g onos-linksvg [link]="link" |
| 28 | *ngFor="let link of filteredLinks()" |
| 29 | [highlightsEnabled]="highlightPorts" |
| 30 | (selectedEvent)="updateSelected($event)"> |
| 31 | </svg:g> |
| 32 | </svg:g> |
| 33 | <svg:g xmlns:svg="http://www.w3.org/2000/svg" class="topo2-nodes"> |
| 34 | <svg:desc>Topology nodes</svg:desc> |
| 35 | <!-- Template explanation - create an SVG Group and |
| 36 | line 1) use the svg component onos-devicenodesvg, setting it's device |
| 37 | Input parameter to the device item from the next line |
| 38 | line 2) Use the built in NgFor directive to iterate through all |
| 39 | of the devices in the chosen layer index. The current iteration |
| 40 | is in the device variable |
| 41 | line 3) Use the onosDraggable directive and pass this device in to |
| 42 | its draggableNode Input parameter and setting the draggableInGraph |
| 43 | Input parameter to 'graph' |
| 44 | line 4) when the onos-devicenodesvg component emits the selectedEvent |
| 45 | call the updateSelected() method of this (forcesvg) component |
| 46 | --> |
| 47 | <svg:g onos-devicenodesvg [device]="device" |
| 48 | *ngFor="let device of regionData.devices[visibleLayerIdx()]" |
| 49 | onosDraggableNode [draggableNode]="device" [draggableInGraph]="graph" |
Sean Condon | b2c483c | 2019-01-16 20:28:55 +0000 | [diff] [blame] | 50 | (selectedEvent)="updateSelected($event)" |
| 51 | [labelToggle]="deviceLabelToggle"> |
Sean Condon | 9148182 | 2019-01-01 13:56:14 +0000 | [diff] [blame] | 52 | <svg:desc>Device nodes</svg:desc> |
| 53 | </svg:g> |
| 54 | <!-- Template explanation - only display the hosts if 'showHosts' is set true --> |
| 55 | <svg:g *ngIf="showHosts"> |
| 56 | <!-- Template explanation - create an SVG Group and |
| 57 | line 1) use the svg component onos-hostnodesvg, setting it's host |
| 58 | Input parameter to the host item from the next line |
| 59 | line 2) Use the built in NgFor directive to iterate through all |
| 60 | of the hosts in the chosen layer index. The current iteration |
| 61 | is in the 'host' variable |
| 62 | line 3) Use the onosDraggable directive and pass this host in to |
| 63 | its draggableNode Input parameter and setting the draggableInGraph |
| 64 | Input parameter to 'graph' |
| 65 | line 4) when the onos-hostnodesvg component emits the selectedEvent |
| 66 | call the updateSelected() method of this (forcesvg) component |
| 67 | --> |
| 68 | <svg:g onos-hostnodesvg [host]="host" |
| 69 | *ngFor="let host of regionData.hosts[visibleLayerIdx()]" |
| 70 | onosDraggableNode [draggableNode]="host" [draggableInGraph]="graph" |
Sean Condon | b2c483c | 2019-01-16 20:28:55 +0000 | [diff] [blame] | 71 | (selectedEvent)="updateSelected($event)" |
| 72 | [labelToggle]="hostLabelToggle"> |
Sean Condon | 9148182 | 2019-01-01 13:56:14 +0000 | [diff] [blame] | 73 | <svg:desc>Host nodes</svg:desc> |
Sean Condon | 0c577f6 | 2018-11-18 22:40:05 +0000 | [diff] [blame] | 74 | </svg:g> |
| 75 | </svg:g> |
Sean Condon | 9148182 | 2019-01-01 13:56:14 +0000 | [diff] [blame] | 76 | <svg:g onos-subregionnodesvg [subRegion]="subRegion" |
| 77 | *ngFor="let subRegion of regionData.subregions" |
| 78 | onosDraggableNode [draggableNode]="host" [draggableInGraph]="graph"> |
| 79 | <svg:desc>Subregion nodes</svg:desc> |
| 80 | </svg:g> |
Sean Condon | f4f54a1 | 2018-10-10 23:25:46 +0100 | [diff] [blame] | 81 | </svg:g> |