Committed by
Gerrit Code Review
[ONOS-4159] PCE Web GUI implementation:ClientsideChanges
Change-Id: Ib8397ecc9ebe5a28550263ebe6e4eaf05712c05e
Showing
3 changed files
with
29 additions
and
9 deletions
| ... | @@ -278,20 +278,18 @@ public class PceWebTopovMessageHandler extends UiMessageHandler { | ... | @@ -278,20 +278,18 @@ public class PceWebTopovMessageHandler extends UiMessageHandler { |
| 278 | .valueOf(dstDevice.annotations().value("lsrId"))); | 278 | .valueOf(dstDevice.annotations().value("lsrId"))); |
| 279 | 279 | ||
| 280 | Collection<Tunnel> tunnelSet = tunnelService.queryTunnel(tunSrc, tunDst); | 280 | Collection<Tunnel> tunnelSet = tunnelService.queryTunnel(tunSrc, tunDst); |
| 281 | - if (tunnelSet != null) { | ||
| 282 | ObjectNode result = objectNode(); | 281 | ObjectNode result = objectNode(); |
| 283 | ArrayNode arrayNode = arrayNode(); | 282 | ArrayNode arrayNode = arrayNode(); |
| 284 | - | ||
| 285 | for (Tunnel tunnel : tunnelSet) { | 283 | for (Tunnel tunnel : tunnelSet) { |
| 286 | if (tunnel.type() == MPLS) { | 284 | if (tunnel.type() == MPLS) { |
| 287 | arrayNode.add(tunnel.tunnelId().toString()); | 285 | arrayNode.add(tunnel.tunnelId().toString()); |
| 288 | } | 286 | } |
| 289 | } | 287 | } |
| 288 | + | ||
| 290 | result.putArray(BUFFER_ARRAY).addAll(arrayNode); | 289 | result.putArray(BUFFER_ARRAY).addAll(arrayNode); |
| 291 | sendMessage(PCEWEB_SHOW_TUNNEL, sid, result); | 290 | sendMessage(PCEWEB_SHOW_TUNNEL, sid, result); |
| 292 | } | 291 | } |
| 293 | } | 292 | } |
| 294 | - } | ||
| 295 | 293 | ||
| 296 | /** | 294 | /** |
| 297 | * Handles the 'update path' event received from the client. | 295 | * Handles the 'update path' event received from the client. |
| ... | @@ -342,7 +340,6 @@ public class PceWebTopovMessageHandler extends UiMessageHandler { | ... | @@ -342,7 +340,6 @@ public class PceWebTopovMessageHandler extends UiMessageHandler { |
| 342 | .valueOf(dstDevice.annotations().value("lsrId"))); | 340 | .valueOf(dstDevice.annotations().value("lsrId"))); |
| 343 | 341 | ||
| 344 | Collection<Tunnel> tunnelSet = tunnelService.queryTunnel(tunSrc, tunDst); | 342 | Collection<Tunnel> tunnelSet = tunnelService.queryTunnel(tunSrc, tunDst); |
| 345 | - if (tunnelSet != null) { | ||
| 346 | ObjectNode result = objectNode(); | 343 | ObjectNode result = objectNode(); |
| 347 | ArrayNode arrayNode = arrayNode(); | 344 | ArrayNode arrayNode = arrayNode(); |
| 348 | 345 | ||
| ... | @@ -351,11 +348,11 @@ public class PceWebTopovMessageHandler extends UiMessageHandler { | ... | @@ -351,11 +348,11 @@ public class PceWebTopovMessageHandler extends UiMessageHandler { |
| 351 | arrayNode.add(tunnel.tunnelId().toString()); | 348 | arrayNode.add(tunnel.tunnelId().toString()); |
| 352 | } | 349 | } |
| 353 | } | 350 | } |
| 351 | + | ||
| 354 | result.putArray(BUFFER_ARRAY).addAll(arrayNode); | 352 | result.putArray(BUFFER_ARRAY).addAll(arrayNode); |
| 355 | sendMessage(PCEWEB_SHOW_TUNNEL_REMOVE, sid, result); | 353 | sendMessage(PCEWEB_SHOW_TUNNEL_REMOVE, sid, result); |
| 356 | } | 354 | } |
| 357 | } | 355 | } |
| 358 | - } | ||
| 359 | 356 | ||
| 360 | /** | 357 | /** |
| 361 | * Handles the 'remove path' event received from the client. | 358 | * Handles the 'remove path' event received from the client. | ... | ... |
This diff is collapsed. Click to expand it.
| ... | @@ -34,7 +34,6 @@ | ... | @@ -34,7 +34,6 @@ |
| 34 | glyphId: 'topo', | 34 | glyphId: 'topo', |
| 35 | tooltip: 'PCE web Topo Overlay', | 35 | tooltip: 'PCE web Topo Overlay', |
| 36 | 36 | ||
| 37 | - | ||
| 38 | activate: function () { | 37 | activate: function () { |
| 39 | $log.debug("PCE web topology overlay ACTIVATED"); | 38 | $log.debug("PCE web topology overlay ACTIVATED"); |
| 40 | }, | 39 | }, |
| ... | @@ -112,11 +111,32 @@ | ... | @@ -112,11 +111,32 @@ |
| 112 | }, | 111 | }, |
| 113 | 1: { | 112 | 1: { |
| 114 | cb: function () { | 113 | cb: function () { |
| 115 | - pps.setMode("shortest"); | 114 | + pps.setMode(); |
| 115 | + }, | ||
| 116 | + tt: 'Setup path', | ||
| 117 | + gid: 'plus' | ||
| 118 | + }, | ||
| 119 | + 2: { | ||
| 120 | + cb: function () { | ||
| 121 | + pps.updatePath(selection); | ||
| 116 | }, | 122 | }, |
| 117 | - tt: 'Select constraints for LSP', | 123 | + tt: 'Update path', |
| 118 | gid: '*jp' | 124 | gid: '*jp' |
| 119 | }, | 125 | }, |
| 126 | + 3: { | ||
| 127 | + cb: function () { | ||
| 128 | + pps.remPath(selection); | ||
| 129 | + }, | ||
| 130 | + tt: 'Remove path', | ||
| 131 | + gid: 'minus' | ||
| 132 | + }, | ||
| 133 | + 4: { | ||
| 134 | + cb: function () { | ||
| 135 | + pps.queryTunnelDisplay(); | ||
| 136 | + }, | ||
| 137 | + tt: 'Show Tunnels', | ||
| 138 | + gid: 'checkMark' | ||
| 139 | + }, | ||
| 120 | 0: { | 140 | 0: { |
| 121 | cb: function () { | 141 | cb: function () { |
| 122 | pps.clear(); | 142 | pps.clear(); |
| ... | @@ -126,7 +146,7 @@ | ... | @@ -126,7 +146,7 @@ |
| 126 | }, | 146 | }, |
| 127 | 147 | ||
| 128 | _keyOrder: [ | 148 | _keyOrder: [ |
| 129 | - 'openBracket', 'closeBracket', '1', '0' | 149 | + 'openBracket', 'closeBracket', '1', '2', '3', '4', '0' |
| 130 | ] | 150 | ] |
| 131 | }, | 151 | }, |
| 132 | hooks: { | 152 | hooks: { |
| ... | @@ -145,6 +165,9 @@ | ... | @@ -145,6 +165,9 @@ |
| 145 | }, | 165 | }, |
| 146 | single: function (data) { | 166 | single: function (data) { |
| 147 | selectionCallback(data); | 167 | selectionCallback(data); |
| 168 | + }, | ||
| 169 | + multi: function (selectOrder) { | ||
| 170 | + selectionCallback(selectOrder); | ||
| 148 | } | 171 | } |
| 149 | } | 172 | } |
| 150 | }; | 173 | }; | ... | ... |
-
Please register or login to post a comment