Simon Hunt | 1002cd8 | 2015-04-23 14:44:03 -0700 | [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 | 1002cd8 | 2015-04-23 14:44:03 -0700 | [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 -- Flow View Module |
| 19 | */ |
| 20 | |
| 21 | (function () { |
| 22 | 'use strict'; |
| 23 | |
Bri Prebilic Cole | cdc188d | 2015-04-24 16:40:11 -0700 | [diff] [blame] | 24 | // injected references |
Simon Hunt | caed041 | 2017-08-12 13:49:17 -0700 | [diff] [blame] | 25 | var $log, $scope, $location, fs, tbs, ns, mast, ps, wss, is; |
Viswanath KSP | 7bdc917 | 2016-10-19 20:19:17 +0530 | [diff] [blame] | 26 | |
| 27 | // internal state |
| 28 | var detailsPanel, |
| 29 | pStartY, |
| 30 | pHeight, |
| 31 | top, |
Viswanath KSP | 70e0d14 | 2016-10-28 21:58:32 +0530 | [diff] [blame] | 32 | topTable, |
Simon Hunt | 8f057ee | 2017-07-19 14:05:26 -0700 | [diff] [blame] | 33 | trtDiv, |
Viswanath KSP | ed55ecf | 2016-12-22 18:15:45 +0530 | [diff] [blame] | 34 | selDiv, |
| 35 | topSelTable, |
Simon Hunt | 8f057ee | 2017-07-19 14:05:26 -0700 | [diff] [blame] | 36 | topTrtTable, |
Viswanath KSP | 7bdc917 | 2016-10-19 20:19:17 +0530 | [diff] [blame] | 37 | iconDiv, |
Viswanath KSP | 7bdc917 | 2016-10-19 20:19:17 +0530 | [diff] [blame] | 38 | wSize; |
| 39 | |
Viswanath KSP | 7bdc917 | 2016-10-19 20:19:17 +0530 | [diff] [blame] | 40 | // constants |
| 41 | var topPdg = 28, |
Viswanath KSP | 7bdc917 | 2016-10-19 20:19:17 +0530 | [diff] [blame] | 42 | wtPdg = 532, |
| 43 | |
| 44 | pName = 'flow-details-panel', |
| 45 | detailsReq = 'flowDetailsRequest', |
Viswanath KSP | 70e0d14 | 2016-10-28 21:58:32 +0530 | [diff] [blame] | 46 | detailsResp = 'flowDetailsResponse', |
| 47 | |
| 48 | propOrder = [ |
Simon Hunt | 9bff595 | 2017-07-13 14:05:09 -0700 | [diff] [blame] | 49 | 'flowId', |
| 50 | 'state', |
| 51 | |
| 52 | 'bytes', |
| 53 | 'packets', |
| 54 | 'duration', |
| 55 | |
| 56 | 'priority', |
Yi Tseng | 18177a5 | 2017-09-08 01:26:59 -0700 | [diff] [blame^] | 57 | 'tableName', |
Simon Hunt | 36b658d | 2017-07-14 16:20:11 -0700 | [diff] [blame] | 58 | 'appName', |
Simon Hunt | 9bff595 | 2017-07-13 14:05:09 -0700 | [diff] [blame] | 59 | 'appId', |
| 60 | |
| 61 | 'groupId', |
| 62 | 'timeout', |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 63 | 'permanent', |
Viswanath KSP | 70e0d14 | 2016-10-28 21:58:32 +0530 | [diff] [blame] | 64 | ], |
| 65 | friendlyProps = [ |
Simon Hunt | 9bff595 | 2017-07-13 14:05:09 -0700 | [diff] [blame] | 66 | 'Flow ID', |
| 67 | 'State', |
| 68 | |
| 69 | 'Bytes', |
| 70 | 'Packets', |
| 71 | 'Duration', |
| 72 | |
| 73 | 'Flow Priority', |
Yi Tseng | 18177a5 | 2017-09-08 01:26:59 -0700 | [diff] [blame^] | 74 | 'Table Name', |
Simon Hunt | 36b658d | 2017-07-14 16:20:11 -0700 | [diff] [blame] | 75 | 'App Name', |
Simon Hunt | 9bff595 | 2017-07-13 14:05:09 -0700 | [diff] [blame] | 76 | 'App ID', |
| 77 | |
| 78 | 'Group ID', |
| 79 | 'Timeout', |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 80 | 'Permanent', |
Viswanath KSP | 70e0d14 | 2016-10-28 21:58:32 +0530 | [diff] [blame] | 81 | ]; |
Viswanath KSP | 7bdc917 | 2016-10-19 20:19:17 +0530 | [diff] [blame] | 82 | |
| 83 | function closePanel() { |
| 84 | if (detailsPanel.isVisible()) { |
| 85 | $scope.selId = null; |
| 86 | detailsPanel.hide(); |
| 87 | return true; |
| 88 | } |
| 89 | return false; |
| 90 | } |
| 91 | |
| 92 | function addCloseBtn(div) { |
| 93 | is.loadEmbeddedIcon(div, 'close', 20); |
| 94 | div.on('click', closePanel); |
| 95 | } |
| 96 | |
Viswanath KSP | 70e0d14 | 2016-10-28 21:58:32 +0530 | [diff] [blame] | 97 | function handleEscape() { |
| 98 | return closePanel(); |
| 99 | } |
| 100 | |
Viswanath KSP | 7bdc917 | 2016-10-19 20:19:17 +0530 | [diff] [blame] | 101 | function setUpPanel() { |
Simon Hunt | caed041 | 2017-08-12 13:49:17 -0700 | [diff] [blame] | 102 | var container, closeBtn; |
Viswanath KSP | 7bdc917 | 2016-10-19 20:19:17 +0530 | [diff] [blame] | 103 | detailsPanel.empty(); |
Viswanath KSP | 7bdc917 | 2016-10-19 20:19:17 +0530 | [diff] [blame] | 104 | container = detailsPanel.append('div').classed('container', true); |
Simon Hunt | 8f057ee | 2017-07-19 14:05:26 -0700 | [diff] [blame] | 105 | |
Viswanath KSP | 7bdc917 | 2016-10-19 20:19:17 +0530 | [diff] [blame] | 106 | top = container.append('div').classed('top', true); |
| 107 | closeBtn = top.append('div').classed('close-btn', true); |
| 108 | addCloseBtn(closeBtn); |
| 109 | iconDiv = top.append('div').classed('dev-icon', true); |
| 110 | top.append('h2'); |
Viswanath KSP | 70e0d14 | 2016-10-28 21:58:32 +0530 | [diff] [blame] | 111 | topTable = top.append('div').classed('top-content', true) |
| 112 | .append('table'); |
Viswanath KSP | 7bdc917 | 2016-10-19 20:19:17 +0530 | [diff] [blame] | 113 | top.append('hr'); |
Simon Hunt | 9bff595 | 2017-07-13 14:05:09 -0700 | [diff] [blame] | 114 | |
Simon Hunt | 8f057ee | 2017-07-19 14:05:26 -0700 | [diff] [blame] | 115 | selDiv = container.append('div').classed('top', true); |
Simon Hunt | 239f09e | 2017-05-18 13:10:09 -0700 | [diff] [blame] | 116 | selDiv.append('h2').text('Selector'); |
Viswanath KSP | ed55ecf | 2016-12-22 18:15:45 +0530 | [diff] [blame] | 117 | topSelTable = selDiv.append('div').classed('top-content', true) |
| 118 | .append('table'); |
Simon Hunt | 9bff595 | 2017-07-13 14:05:09 -0700 | [diff] [blame] | 119 | selDiv.append('hr'); |
Viswanath KSP | 7bdc917 | 2016-10-19 20:19:17 +0530 | [diff] [blame] | 120 | |
Simon Hunt | 8f057ee | 2017-07-19 14:05:26 -0700 | [diff] [blame] | 121 | trtDiv = container.append('div').classed('top', true); |
| 122 | trtDiv.append('h2').text('Treatment'); |
| 123 | topTrtTable = trtDiv.append('div').classed('top-content', true) |
Simon Hunt | 9bff595 | 2017-07-13 14:05:09 -0700 | [diff] [blame] | 124 | .append('table'); |
Viswanath KSP | 7bdc917 | 2016-10-19 20:19:17 +0530 | [diff] [blame] | 125 | } |
| 126 | |
Simon Hunt | 8f057ee | 2017-07-19 14:05:26 -0700 | [diff] [blame] | 127 | function addProp(tbody, label, value) { |
Viswanath KSP | ed55ecf | 2016-12-22 18:15:45 +0530 | [diff] [blame] | 128 | var tr = tbody.append('tr'); |
| 129 | |
| 130 | function addCell(cls, txt) { |
Simon Hunt | 239f09e | 2017-05-18 13:10:09 -0700 | [diff] [blame] | 131 | tr.append('td').attr('class', cls).text(txt); |
Viswanath KSP | ed55ecf | 2016-12-22 18:15:45 +0530 | [diff] [blame] | 132 | } |
| 133 | addCell('label', label + ' :'); |
| 134 | addCell('value', value); |
| 135 | } |
| 136 | |
Simon Hunt | 8f057ee | 2017-07-19 14:05:26 -0700 | [diff] [blame] | 137 | // deferred fetching of user-visible strings, so that lion context is set |
| 138 | function getLionProps() { |
| 139 | // TODO: Localization... (see cluster.js for the pattern) |
| 140 | // var l = $scope.lion; |
| 141 | // return [ |
| 142 | // l('flow_id'), |
| 143 | // ... |
| 144 | // ]; |
| 145 | return friendlyProps; |
| 146 | } |
| 147 | |
| 148 | function getLionClearDeferred() { |
| 149 | // TODO: Localization... |
| 150 | return 'Clear deferred'; |
| 151 | } |
| 152 | |
Viswanath KSP | 70e0d14 | 2016-10-28 21:58:32 +0530 | [diff] [blame] | 153 | function populateTop(details) { |
| 154 | is.loadEmbeddedIcon(iconDiv, 'flowTable', 40); |
Simon Hunt | 239f09e | 2017-05-18 13:10:09 -0700 | [diff] [blame] | 155 | top.select('h2').text(details.flowId); |
Viswanath KSP | 70e0d14 | 2016-10-28 21:58:32 +0530 | [diff] [blame] | 156 | |
Simon Hunt | 8f057ee | 2017-07-19 14:05:26 -0700 | [diff] [blame] | 157 | var tbody = topTable.append('tbody'), |
| 158 | tbodySel = topSelTable.append('tbody'), |
| 159 | tbodyTrt = topTrtTable.append('tbody'), |
| 160 | selArray = details.selector, |
| 161 | treat = details.treatment, |
| 162 | propLabels = getLionProps(); |
Viswanath KSP | 70e0d14 | 2016-10-28 21:58:32 +0530 | [diff] [blame] | 163 | |
Simon Hunt | 8f057ee | 2017-07-19 14:05:26 -0700 | [diff] [blame] | 164 | function addLabVal(tbody, lv) { |
| 165 | var bits = lv.match(/^([^:]*):(.*)/); |
| 166 | addProp(tbody, bits[1], bits[2]); |
| 167 | } |
Viswanath KSP | ed55ecf | 2016-12-22 18:15:45 +0530 | [diff] [blame] | 168 | |
Simon Hunt | 8f057ee | 2017-07-19 14:05:26 -0700 | [diff] [blame] | 169 | function popInstrList(items, tag) { |
| 170 | items.forEach(function (item) { |
| 171 | addLabVal(tbodyTrt, tag + item); |
| 172 | }); |
| 173 | } |
Viswanath KSP | ed55ecf | 2016-12-22 18:15:45 +0530 | [diff] [blame] | 174 | |
Simon Hunt | 8f057ee | 2017-07-19 14:05:26 -0700 | [diff] [blame] | 175 | // basic flow properties |
Viswanath KSP | 70e0d14 | 2016-10-28 21:58:32 +0530 | [diff] [blame] | 176 | propOrder.forEach(function (prop, i) { |
Simon Hunt | 8f057ee | 2017-07-19 14:05:26 -0700 | [diff] [blame] | 177 | addProp(tbody, propLabels[i], details[prop]); |
Viswanath KSP | 70e0d14 | 2016-10-28 21:58:32 +0530 | [diff] [blame] | 178 | }); |
Viswanath KSP | ed55ecf | 2016-12-22 18:15:45 +0530 | [diff] [blame] | 179 | |
Simon Hunt | 8f057ee | 2017-07-19 14:05:26 -0700 | [diff] [blame] | 180 | // selection criteria |
| 181 | selArray.forEach(function (lv) { |
| 182 | addLabVal(tbodySel, lv); |
Viswanath KSP | ed55ecf | 2016-12-22 18:15:45 +0530 | [diff] [blame] | 183 | }); |
| 184 | |
Simon Hunt | 8f057ee | 2017-07-19 14:05:26 -0700 | [diff] [blame] | 185 | // traffic treatment |
| 186 | treat.immed && popInstrList(treat.immed, '[imm]'); |
| 187 | treat.defer && popInstrList(treat.defer, '[def]'); |
| 188 | treat.meter && addLabVal(tbodyTrt, treat.meter); |
| 189 | treat.table && addLabVal(tbodyTrt, treat.table); |
| 190 | treat.meta && addLabVal(tbodyTrt, treat.meta); |
| 191 | addProp(tbodyTrt, getLionClearDeferred(), treat.clearDef); |
Viswanath KSP | 7bdc917 | 2016-10-19 20:19:17 +0530 | [diff] [blame] | 192 | } |
| 193 | |
| 194 | function createDetailsPane() { |
| 195 | detailsPanel = ps.createPanel(pName, { |
| 196 | width: wSize.width, |
| 197 | margin: 0, |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 198 | hideMargin: 0, |
Viswanath KSP | 7bdc917 | 2016-10-19 20:19:17 +0530 | [diff] [blame] | 199 | }); |
| 200 | detailsPanel.el().style({ |
| 201 | position: 'absolute', |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 202 | top: pStartY + 'px', |
Viswanath KSP | 7bdc917 | 2016-10-19 20:19:17 +0530 | [diff] [blame] | 203 | }); |
| 204 | $scope.hidePanel = function () { detailsPanel.hide(); }; |
| 205 | detailsPanel.hide(); |
| 206 | } |
| 207 | |
| 208 | function populateDetails(details) { |
Viswanath KSP | 7bdc917 | 2016-10-19 20:19:17 +0530 | [diff] [blame] | 209 | setUpPanel(); |
| 210 | populateTop(details); |
| 211 | |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 212 | // ToDo add more details |
Viswanath KSP | 7bdc917 | 2016-10-19 20:19:17 +0530 | [diff] [blame] | 213 | detailsPanel.height(pHeight); |
| 214 | detailsPanel.width(wtPdg); |
Viswanath KSP | 7bdc917 | 2016-10-19 20:19:17 +0530 | [diff] [blame] | 215 | } |
| 216 | |
| 217 | function respDetailsCb(data) { |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 218 | $log.debug('Got response from server :', data); |
Viswanath KSP | 70e0d14 | 2016-10-28 21:58:32 +0530 | [diff] [blame] | 219 | $scope.panelData = data.details; |
| 220 | $scope.$apply(); |
Viswanath KSP | 7bdc917 | 2016-10-19 20:19:17 +0530 | [diff] [blame] | 221 | } |
Bri Prebilic Cole | cdc188d | 2015-04-24 16:40:11 -0700 | [diff] [blame] | 222 | |
Simon Hunt | 1002cd8 | 2015-04-23 14:44:03 -0700 | [diff] [blame] | 223 | angular.module('ovFlow', []) |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 224 | .controller('OvFlowCtrl', |
| 225 | ['$log', '$scope', '$location', |
| 226 | 'FnService', 'TableBuilderService', 'NavService', |
| 227 | 'MastService', 'PanelService', 'KeyService', 'IconService', |
| 228 | 'WebSocketService', |
Simon Hunt | 1002cd8 | 2015-04-23 14:44:03 -0700 | [diff] [blame] | 229 | |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 230 | function (_$log_, _$scope_, _$location_, _fs_, _tbs_, _ns_, |
| 231 | _mast_, _ps_, _ks_, _is_, _wss_) { |
| 232 | var params, |
| 233 | handlers = {}; |
Viswanath KSP | 7bdc917 | 2016-10-19 20:19:17 +0530 | [diff] [blame] | 234 | |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 235 | $log = _$log_; |
| 236 | $scope = _$scope_; |
| 237 | $location = _$location_; |
| 238 | fs = _fs_; |
| 239 | tbs = _tbs_; |
| 240 | ns = _ns_; |
| 241 | is = _is_; |
| 242 | wss = _wss_; |
| 243 | mast = _mast_; |
| 244 | ps = _ps_; |
| 245 | $scope.deviceTip = 'Show device table'; |
| 246 | $scope.portTip = 'Show port view for this device'; |
| 247 | $scope.groupTip = 'Show group view for this device'; |
| 248 | $scope.meterTip = 'Show meter view for selected device'; |
| 249 | $scope.briefTip = 'Switch to brief view'; |
| 250 | $scope.detailTip = 'Switch to detailed view'; |
| 251 | $scope.brief = true; |
| 252 | params = $location.search(); |
| 253 | if (params.hasOwnProperty('devId')) { |
| 254 | $scope.devId = params['devId']; |
Viswanath KSP | 7bdc917 | 2016-10-19 20:19:17 +0530 | [diff] [blame] | 255 | } |
Viswanath KSP | 7bdc917 | 2016-10-19 20:19:17 +0530 | [diff] [blame] | 256 | |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 257 | tbs.buildTable({ |
| 258 | scope: $scope, |
| 259 | tag: 'flow', |
| 260 | selCb: selCb, |
| 261 | query: params, |
| 262 | }); |
| 263 | |
| 264 | $scope.nav = function (path) { |
| 265 | if ($scope.devId) { |
| 266 | ns.navTo(path, { devId: $scope.devId }); |
| 267 | } |
| 268 | }; |
| 269 | |
| 270 | // details panel handlers |
| 271 | handlers[detailsResp] = respDetailsCb; |
| 272 | wss.bindHandlers(handlers); |
| 273 | |
| 274 | function selCb($event, row) { |
| 275 | if ($scope.selId) { |
Simon Hunt | f257a96 | 2017-08-25 18:58:47 -0700 | [diff] [blame] | 276 | wss.sendEvent(detailsReq, { |
| 277 | flowId: row.id, |
| 278 | appId: row.appId |
| 279 | }); |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 280 | } else { |
| 281 | $scope.hidePanel(); |
| 282 | } |
| 283 | $log.debug('Got a click on:', row); |
| 284 | } |
| 285 | |
| 286 | $scope.$on('$destroy', function () { |
| 287 | wss.unbindHandlers(handlers); |
| 288 | }); |
| 289 | |
| 290 | $scope.briefToggle = function () { |
| 291 | $scope.brief = !$scope.brief; |
| 292 | }; |
| 293 | |
| 294 | Object.defineProperty($scope, 'queryFilter', { |
| 295 | get: function () { |
| 296 | var out = {}; |
| 297 | out[$scope.queryBy || '$'] = $scope.queryTxt; |
| 298 | return out; |
| 299 | }, |
| 300 | }); |
| 301 | |
| 302 | $log.log('OvFlowCtrl has been created'); |
| 303 | }]) |
| 304 | |
| 305 | .directive('flowDetailsPanel', |
| 306 | ['$rootScope', '$window', '$timeout', 'KeyService', |
Simon Hunt | f257a96 | 2017-08-25 18:58:47 -0700 | [diff] [blame] | 307 | function ($rootScope, $window, $timeout, ks) { |
| 308 | return function (scope) { |
| 309 | var unbindWatch; |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 310 | |
Simon Hunt | f257a96 | 2017-08-25 18:58:47 -0700 | [diff] [blame] | 311 | function heightCalc() { |
| 312 | var tabhead = d3.select('.tabular-header'); |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 313 | |
Simon Hunt | f257a96 | 2017-08-25 18:58:47 -0700 | [diff] [blame] | 314 | pStartY = fs.noPxStyle(tabhead, 'height') + |
| 315 | mast.mastHeight() + topPdg; |
| 316 | wSize = fs.windowSize(pStartY); |
| 317 | pHeight = wSize.height; |
| 318 | } |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 319 | |
Simon Hunt | f257a96 | 2017-08-25 18:58:47 -0700 | [diff] [blame] | 320 | function initPanel() { |
| 321 | heightCalc(); |
| 322 | createDetailsPane(); |
| 323 | } |
| 324 | |
| 325 | // Safari has a bug where it renders the fixed-layout |
| 326 | // table wrong if you ask for the window's size too early |
| 327 | if (scope.onos.browser === 'safari') { |
| 328 | $timeout(initPanel); |
| 329 | } else { |
| 330 | initPanel(); |
| 331 | } |
| 332 | // create key bindings to handle panel |
| 333 | ks.keyBindings({ |
| 334 | esc: [handleEscape, 'Close the details panel'], |
| 335 | _helpFormat: ['esc'], |
| 336 | }); |
| 337 | ks.gestureNotes([ |
| 338 | ['click', 'Select a row to show cluster node details'], |
| 339 | ['scroll down', 'See available cluster nodes'], |
| 340 | ]); |
| 341 | // if the panelData changes |
| 342 | scope.$watch('panelData', function () { |
| 343 | if (!fs.isEmptyObject(scope.panelData)) { |
| 344 | populateDetails(scope.panelData); |
| 345 | detailsPanel.show(); |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 346 | } |
Simon Hunt | f257a96 | 2017-08-25 18:58:47 -0700 | [diff] [blame] | 347 | }); |
| 348 | // if the window size changes |
| 349 | unbindWatch = $rootScope.$watchCollection( |
| 350 | function () { |
| 351 | return { |
| 352 | h: $window.innerHeight, |
| 353 | w: $window.innerWidth, |
| 354 | }; |
| 355 | }, function () { |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 356 | if (!fs.isEmptyObject(scope.panelData)) { |
Simon Hunt | f257a96 | 2017-08-25 18:58:47 -0700 | [diff] [blame] | 357 | heightCalc(); |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 358 | populateDetails(scope.panelData); |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 359 | } |
Simon Hunt | f257a96 | 2017-08-25 18:58:47 -0700 | [diff] [blame] | 360 | } |
| 361 | ); |
Steven Burrows | 1c2a968 | 2017-07-14 16:52:46 +0100 | [diff] [blame] | 362 | |
Simon Hunt | f257a96 | 2017-08-25 18:58:47 -0700 | [diff] [blame] | 363 | scope.$on('$destroy', function () { |
| 364 | unbindWatch(); |
| 365 | ps.destroyPanel(pName); |
| 366 | }); |
| 367 | }; |
| 368 | }]); |
Viswanath KSP | 7bdc917 | 2016-10-19 20:19:17 +0530 | [diff] [blame] | 369 | |
Simon Hunt | 1002cd8 | 2015-04-23 14:44:03 -0700 | [diff] [blame] | 370 | }()); |