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