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