Committed by
Gerrit Code Review
[ONOS-4159] PCE Web GUI implementation:ClientsideChanges
Change-Id: Ib8397ecc9ebe5a28550263ebe6e4eaf05712c05e
Showing
3 changed files
with
46 additions
and
26 deletions
... | @@ -278,18 +278,16 @@ public class PceWebTopovMessageHandler extends UiMessageHandler { | ... | @@ -278,18 +278,16 @@ 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) { | 281 | + ObjectNode result = objectNode(); |
282 | - ObjectNode result = objectNode(); | 282 | + ArrayNode arrayNode = arrayNode(); |
283 | - ArrayNode arrayNode = arrayNode(); | 283 | + for (Tunnel tunnel : tunnelSet) { |
284 | - | 284 | + if (tunnel.type() == MPLS) { |
285 | - for (Tunnel tunnel : tunnelSet) { | 285 | + arrayNode.add(tunnel.tunnelId().toString()); |
286 | - if (tunnel.type() == MPLS) { | ||
287 | - arrayNode.add(tunnel.tunnelId().toString()); | ||
288 | - } | ||
289 | } | 286 | } |
290 | - result.putArray(BUFFER_ARRAY).addAll(arrayNode); | 287 | + } |
291 | - sendMessage(PCEWEB_SHOW_TUNNEL, sid, result); | 288 | + |
292 | - } | 289 | + result.putArray(BUFFER_ARRAY).addAll(arrayNode); |
290 | + sendMessage(PCEWEB_SHOW_TUNNEL, sid, result); | ||
293 | } | 291 | } |
294 | } | 292 | } |
295 | 293 | ||
... | @@ -342,18 +340,17 @@ public class PceWebTopovMessageHandler extends UiMessageHandler { | ... | @@ -342,18 +340,17 @@ 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) { | 343 | + ObjectNode result = objectNode(); |
346 | - ObjectNode result = objectNode(); | 344 | + ArrayNode arrayNode = arrayNode(); |
347 | - ArrayNode arrayNode = arrayNode(); | 345 | + |
348 | - | 346 | + for (Tunnel tunnel : tunnelSet) { |
349 | - for (Tunnel tunnel : tunnelSet) { | 347 | + if (tunnel.type() == MPLS) { |
350 | - if (tunnel.type() == MPLS) { | 348 | + arrayNode.add(tunnel.tunnelId().toString()); |
351 | - arrayNode.add(tunnel.tunnelId().toString()); | ||
352 | - } | ||
353 | } | 349 | } |
354 | - result.putArray(BUFFER_ARRAY).addAll(arrayNode); | 350 | + } |
355 | - sendMessage(PCEWEB_SHOW_TUNNEL_REMOVE, sid, result); | 351 | + |
356 | - } | 352 | + result.putArray(BUFFER_ARRAY).addAll(arrayNode); |
353 | + sendMessage(PCEWEB_SHOW_TUNNEL_REMOVE, sid, result); | ||
357 | } | 354 | } |
358 | } | 355 | } |
359 | 356 | ... | ... |
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