Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Foundation |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [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 | */ |
| 16 | |
| 17 | /* |
| 18 | ONOS GUI -- Topology Traffic Module. |
| 19 | Defines behavior for viewing different traffic modes. |
| 20 | */ |
| 21 | |
| 22 | (function () { |
| 23 | 'use strict'; |
| 24 | |
| 25 | // injected refs |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 26 | var $log, flash, wss, api; |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 27 | |
Simon Hunt | caed041 | 2017-08-12 13:49:17 -0700 | [diff] [blame] | 28 | // function to be replaced by the localization bundle function |
| 29 | var topoLion = function (x) { |
| 30 | return '#ttraf#' + x + '#'; |
| 31 | }; |
| 32 | |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 33 | /* |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 34 | API to topoForce |
| 35 | hovered() |
| 36 | somethingSelected() |
| 37 | selectOrder() |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 38 | */ |
| 39 | |
Simon Hunt | 21281fd | 2017-03-30 22:28:28 -0700 | [diff] [blame] | 40 | var allTrafficTypes = [ |
| 41 | 'flowStatsBytes', |
| 42 | 'portStatsBitSec', |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 43 | 'portStatsPktSec', |
Simon Hunt | 21281fd | 2017-03-30 22:28:28 -0700 | [diff] [blame] | 44 | ], |
Simon Hunt | caed041 | 2017-08-12 13:49:17 -0700 | [diff] [blame] | 45 | allTrafficMsgs = []; // filled in with localized messages |
Simon Hunt | 21281fd | 2017-03-30 22:28:28 -0700 | [diff] [blame] | 46 | |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 47 | // internal state |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 48 | var trafficMode = null, |
Simon Hunt | 21281fd | 2017-03-30 22:28:28 -0700 | [diff] [blame] | 49 | hoverMode = null, |
Thomas Vachuska | 2b4de87 | 2021-03-30 16:31:34 -0700 | [diff] [blame^] | 50 | allTrafficIndex = 0, |
| 51 | customTrafficIndex = 0; |
Simon Hunt | 21281fd | 2017-03-30 22:28:28 -0700 | [diff] [blame] | 52 | |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 53 | |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 54 | // === ----------------------------------------------------- |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 55 | // Helper functions |
| 56 | |
Simon Hunt | caed041 | 2017-08-12 13:49:17 -0700 | [diff] [blame] | 57 | function setLionBundle(bundle) { |
| 58 | $log.debug('topoTraffic: setting Lion bundle'); |
| 59 | topoLion = bundle; |
| 60 | allTrafficMsgs = [ |
| 61 | topoLion('tr_fl_fstats_bytes'), |
| 62 | topoLion('tr_fl_pstats_bits'), |
| 63 | topoLion('tr_fl_pstats_pkts'), |
| 64 | ]; |
| 65 | } |
| 66 | |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 67 | // invoked in response to change in selection and/or mouseover/out: |
Simon Hunt | d2862c3 | 2015-08-24 17:41:51 -0700 | [diff] [blame] | 68 | function requestTrafficForMode(mouse) { |
Simon Hunt | a17fa67 | 2015-08-19 18:42:22 -0700 | [diff] [blame] | 69 | if (trafficMode === 'flows') { |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 70 | requestDeviceLinkFlows(); |
Simon Hunt | a17fa67 | 2015-08-19 18:42:22 -0700 | [diff] [blame] | 71 | } else if (trafficMode === 'intents') { |
Simon Hunt | d2862c3 | 2015-08-24 17:41:51 -0700 | [diff] [blame] | 72 | if (!mouse || hoverMode === 'intents') { |
| 73 | requestRelatedIntents(); |
| 74 | } |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 75 | } else { |
Simon Hunt | d2862c3 | 2015-08-24 17:41:51 -0700 | [diff] [blame] | 76 | // do nothing |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 77 | } |
| 78 | } |
| 79 | |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 80 | function requestDeviceLinkFlows() { |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 81 | // generates payload based on current hover-state |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 82 | var hov = api.hovered(); |
| 83 | |
| 84 | function hoverValid() { |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 85 | return hoverMode === 'flows' && |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 86 | hov && (hov.class === 'device'); |
| 87 | } |
| 88 | |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 89 | if (api.somethingSelected()) { |
Simon Hunt | 237676b5 | 2015-03-10 19:04:26 -0700 | [diff] [blame] | 90 | wss.sendEvent('requestDeviceLinkFlows', { |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 91 | ids: api.selectOrder(), |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 92 | hover: hoverValid() ? hov.id : '', |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 93 | }); |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | function requestRelatedIntents() { |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 98 | // generates payload based on current hover-state |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 99 | var hov = api.hovered(); |
| 100 | |
| 101 | function hoverValid() { |
Prince Pereira | 46c82d4 | 2016-09-19 13:30:50 +0530 | [diff] [blame] | 102 | return hoverMode === 'intents' && hov && ( |
| 103 | hov.class === 'host' || |
| 104 | hov.class === 'device' || |
| 105 | hov.class === 'link'); |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 106 | } |
| 107 | |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 108 | if (api.somethingSelected()) { |
Simon Hunt | 237676b5 | 2015-03-10 19:04:26 -0700 | [diff] [blame] | 109 | wss.sendEvent('requestRelatedIntents', { |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 110 | ids: api.selectOrder(), |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 111 | hover: hoverValid() ? hov.id : '', |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 112 | }); |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 117 | // === ------------------------------------------------------------- |
| 118 | // Traffic requests invoked from keystrokes or toolbar buttons... |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 119 | |
Simon Hunt | d2862c3 | 2015-08-24 17:41:51 -0700 | [diff] [blame] | 120 | function cancelTraffic(forced) { |
| 121 | if (!trafficMode || (!forced && trafficMode === 'allFlowPort')) { |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 122 | return false; |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 123 | } |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 124 | |
| 125 | trafficMode = hoverMode = null; |
| 126 | wss.sendEvent('cancelTraffic'); |
Simon Hunt | caed041 | 2017-08-12 13:49:17 -0700 | [diff] [blame] | 127 | flash.flash(topoLion('fl_monitoring_canceled')); |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 128 | return true; |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 129 | } |
| 130 | |
Simon Hunt | 21281fd | 2017-03-30 22:28:28 -0700 | [diff] [blame] | 131 | function showAllTraffic() { |
Simon Hunt | d2862c3 | 2015-08-24 17:41:51 -0700 | [diff] [blame] | 132 | trafficMode = 'allFlowPort'; |
| 133 | hoverMode = null; |
Simon Hunt | 21281fd | 2017-03-30 22:28:28 -0700 | [diff] [blame] | 134 | wss.sendEvent('requestAllTraffic', { |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 135 | trafficType: allTrafficTypes[allTrafficIndex], |
Simon Hunt | 21281fd | 2017-03-30 22:28:28 -0700 | [diff] [blame] | 136 | }); |
| 137 | flash.flash(allTrafficMsgs[allTrafficIndex]); |
| 138 | allTrafficIndex = (allTrafficIndex + 1) % 3; |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 139 | } |
| 140 | |
Thomas Vachuska | 2b4de87 | 2021-03-30 16:31:34 -0700 | [diff] [blame^] | 141 | function showCustomTraffic() { |
| 142 | trafficMode = 'allCustom'; |
| 143 | hoverMode = null; |
| 144 | wss.sendEvent('requestCustomTraffic', { |
| 145 | index: customTrafficIndex, |
| 146 | }); |
| 147 | flash.flash('Custom Traffic'); |
| 148 | customTrafficIndex = customTrafficIndex + 1; |
| 149 | } |
| 150 | |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 151 | function showDeviceLinkFlows() { |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 152 | trafficMode = hoverMode = 'flows'; |
| 153 | requestDeviceLinkFlows(); |
Simon Hunt | caed041 | 2017-08-12 13:49:17 -0700 | [diff] [blame] | 154 | flash.flash(topoLion('tr_fl_dev_flows')); |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 155 | } |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 156 | |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 157 | function showRelatedIntents() { |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 158 | trafficMode = hoverMode = 'intents'; |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 159 | requestRelatedIntents(); |
Simon Hunt | caed041 | 2017-08-12 13:49:17 -0700 | [diff] [blame] | 160 | flash.flash(topoLion('tr_fl_rel_paths')); |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 161 | } |
| 162 | |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 163 | function showPrevIntent() { |
| 164 | if (trafficMode === 'intents') { |
| 165 | hoverMode = null; |
| 166 | wss.sendEvent('requestPrevRelatedIntent'); |
Simon Hunt | caed041 | 2017-08-12 13:49:17 -0700 | [diff] [blame] | 167 | flash.flash(topoLion('tr_fl_prev_rel_int')); |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 168 | } |
| 169 | } |
| 170 | |
| 171 | function showNextIntent() { |
| 172 | if (trafficMode === 'intents') { |
| 173 | hoverMode = null; |
| 174 | wss.sendEvent('requestNextRelatedIntent'); |
Simon Hunt | caed041 | 2017-08-12 13:49:17 -0700 | [diff] [blame] | 175 | flash.flash(topoLion('tr_fl_next_rel_int')); |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 176 | } |
| 177 | } |
| 178 | |
| 179 | function showSelectedIntentTraffic() { |
| 180 | if (trafficMode === 'intents') { |
| 181 | hoverMode = null; |
| 182 | wss.sendEvent('requestSelectedIntentTraffic'); |
Simon Hunt | caed041 | 2017-08-12 13:49:17 -0700 | [diff] [blame] | 183 | flash.flash(topoLion('tr_fl_traf_on_path')); |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 184 | } |
| 185 | } |
| 186 | |
Simon Hunt | 4a6b54b | 2015-10-27 22:08:25 -0700 | [diff] [blame] | 187 | // force the system to create a single intent selection |
| 188 | function selectIntent(data) { |
| 189 | trafficMode = 'intents'; |
| 190 | hoverMode = null; |
| 191 | wss.sendEvent('selectIntent', data); |
Simon Hunt | caed041 | 2017-08-12 13:49:17 -0700 | [diff] [blame] | 192 | flash.flash(topoLion('fl_selecting_intent') + ' ' + data.key); |
Simon Hunt | 4a6b54b | 2015-10-27 22:08:25 -0700 | [diff] [blame] | 193 | } |
| 194 | |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 195 | |
| 196 | // === ------------------------------------------------------ |
| 197 | // action buttons on detail panel (multiple selection) |
| 198 | |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 199 | function addHostIntent() { |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 200 | var so = api.selectOrder(); |
Simon Hunt | caed041 | 2017-08-12 13:49:17 -0700 | [diff] [blame] | 201 | |
Simon Hunt | 237676b5 | 2015-03-10 19:04:26 -0700 | [diff] [blame] | 202 | wss.sendEvent('addHostIntent', { |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 203 | one: so[0], |
| 204 | two: so[1], |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 205 | ids: so, |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 206 | }); |
Simon Hunt | d2862c3 | 2015-08-24 17:41:51 -0700 | [diff] [blame] | 207 | trafficMode = 'intents'; |
| 208 | hoverMode = null; |
Simon Hunt | caed041 | 2017-08-12 13:49:17 -0700 | [diff] [blame] | 209 | flash.flash(topoLion('tr_fl_h2h_flow_added')); |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 210 | } |
| 211 | |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 212 | function removeIntent(d) { |
Simon Hunt | caed041 | 2017-08-12 13:49:17 -0700 | [diff] [blame] | 213 | var action = topoLion(d.intentPurge ? 'purged' : 'withdrawn'); |
| 214 | |
Viswanath KSP | 0f29770 | 2016-08-13 18:02:43 +0530 | [diff] [blame] | 215 | wss.sendEvent('removeIntent', { |
| 216 | appId: d.appId, |
| 217 | appName: d.appName, |
Viswanath KSP | 813a20d | 2016-09-13 04:25:41 +0530 | [diff] [blame] | 218 | key: d.key, |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 219 | purge: d.intentPurge, |
Viswanath KSP | 0f29770 | 2016-08-13 18:02:43 +0530 | [diff] [blame] | 220 | }); |
| 221 | trafficMode = 'intents'; |
| 222 | hoverMode = null; |
Simon Hunt | caed041 | 2017-08-12 13:49:17 -0700 | [diff] [blame] | 223 | flash.flash(topoLion('intent') + ' ' + action); |
Viswanath KSP | 0f29770 | 2016-08-13 18:02:43 +0530 | [diff] [blame] | 224 | } |
| 225 | |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 226 | function resubmitIntent(d) { |
Viswanath KSP | 14aee09 | 2016-10-02 01:47:40 +0530 | [diff] [blame] | 227 | wss.sendEvent('resubmitIntent', { |
| 228 | appId: d.appId, |
| 229 | appName: d.appName, |
| 230 | key: d.key, |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 231 | purge: d.intentPurge, |
Viswanath KSP | 14aee09 | 2016-10-02 01:47:40 +0530 | [diff] [blame] | 232 | }); |
| 233 | trafficMode = 'intents'; |
| 234 | hoverMode = null; |
Simon Hunt | caed041 | 2017-08-12 13:49:17 -0700 | [diff] [blame] | 235 | flash.flash(topoLion('intent') + ' ' + topoLion('resubmitted')); |
Viswanath KSP | 14aee09 | 2016-10-02 01:47:40 +0530 | [diff] [blame] | 236 | } |
| 237 | |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 238 | function addMultiSourceIntent() { |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 239 | var so = api.selectOrder(); |
Simon Hunt | caed041 | 2017-08-12 13:49:17 -0700 | [diff] [blame] | 240 | |
Simon Hunt | 237676b5 | 2015-03-10 19:04:26 -0700 | [diff] [blame] | 241 | wss.sendEvent('addMultiSourceIntent', { |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 242 | src: so.slice(0, so.length - 1), |
| 243 | dst: so[so.length - 1], |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 244 | ids: so, |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 245 | }); |
Simon Hunt | d2862c3 | 2015-08-24 17:41:51 -0700 | [diff] [blame] | 246 | trafficMode = 'intents'; |
| 247 | hoverMode = null; |
Simon Hunt | caed041 | 2017-08-12 13:49:17 -0700 | [diff] [blame] | 248 | flash.flash(topoLion('tr_fl_multisrc_flow') + ' ' + topoLion('added')); |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 249 | } |
| 250 | |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 251 | function removeIntents() { |
Deepa Vaddireddy | 6334092 | 2017-01-19 08:15:31 +0530 | [diff] [blame] | 252 | wss.sendEvent('removeIntents', {}); |
| 253 | trafficMode = 'intents'; |
| 254 | hoverMode = null; |
Simon Hunt | caed041 | 2017-08-12 13:49:17 -0700 | [diff] [blame] | 255 | flash.flash(topoLion('intents') + ' ' + topoLion('purged')); |
Deepa Vaddireddy | 6334092 | 2017-01-19 08:15:31 +0530 | [diff] [blame] | 256 | } |
| 257 | |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 258 | |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 259 | // === ----------------------------------------------------- |
| 260 | // === MODULE DEFINITION === |
| 261 | |
| 262 | angular.module('ovTopo') |
Simon Hunt | 75ec969 | 2015-02-11 16:40:36 -0800 | [diff] [blame] | 263 | .factory('TopoTrafficService', |
Simon Hunt | caed041 | 2017-08-12 13:49:17 -0700 | [diff] [blame] | 264 | ['$log', 'FlashService', 'WebSocketService', |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 265 | |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 266 | function (_$log_, _flash_, _wss_) { |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 267 | $log = _$log_; |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 268 | flash = _flash_; |
Simon Hunt | 237676b5 | 2015-03-10 19:04:26 -0700 | [diff] [blame] | 269 | wss = _wss_; |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 270 | |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 271 | return { |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 272 | initTraffic: function (_api_) { api = _api_; }, |
| 273 | destroyTraffic: function () { }, |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 274 | |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 275 | // invoked from toolbar overlay buttons or keystrokes |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 276 | cancelTraffic: cancelTraffic, |
Simon Hunt | 21281fd | 2017-03-30 22:28:28 -0700 | [diff] [blame] | 277 | showAllTraffic: showAllTraffic, |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 278 | showDeviceLinkFlows: showDeviceLinkFlows, |
| 279 | showRelatedIntents: showRelatedIntents, |
| 280 | showPrevIntent: showPrevIntent, |
| 281 | showNextIntent: showNextIntent, |
| 282 | showSelectedIntentTraffic: showSelectedIntentTraffic, |
Simon Hunt | 4a6b54b | 2015-10-27 22:08:25 -0700 | [diff] [blame] | 283 | selectIntent: selectIntent, |
Thomas Vachuska | 2b4de87 | 2021-03-30 16:31:34 -0700 | [diff] [blame^] | 284 | showCustomTraffic: showCustomTraffic, |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 285 | |
| 286 | // invoked from mouseover/mouseout and selection change |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 287 | requestTrafficForMode: requestTrafficForMode, |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 288 | |
| 289 | // invoked from buttons on detail (multi-select) panel |
| 290 | addHostIntent: addHostIntent, |
Viswanath KSP | 0f29770 | 2016-08-13 18:02:43 +0530 | [diff] [blame] | 291 | addMultiSourceIntent: addMultiSourceIntent, |
Viswanath KSP | 14aee09 | 2016-10-02 01:47:40 +0530 | [diff] [blame] | 292 | removeIntent: removeIntent, |
Deepa Vaddireddy | 6334092 | 2017-01-19 08:15:31 +0530 | [diff] [blame] | 293 | resubmitIntent: resubmitIntent, |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 294 | removeIntents: removeIntents, |
Simon Hunt | caed041 | 2017-08-12 13:49:17 -0700 | [diff] [blame] | 295 | |
| 296 | setLionBundle: setLionBundle, |
Simon Hunt | f542d84 | 2015-02-11 16:20:33 -0800 | [diff] [blame] | 297 | }; |
| 298 | }]); |
| 299 | }()); |