diff options
Diffstat (limited to 'framework/src/onos/web/gui/src/main/webapp/app/view/intent/intent.js')
-rw-r--r-- | framework/src/onos/web/gui/src/main/webapp/app/view/intent/intent.js | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/framework/src/onos/web/gui/src/main/webapp/app/view/intent/intent.js b/framework/src/onos/web/gui/src/main/webapp/app/view/intent/intent.js index 5810f347..19f2c076 100644 --- a/framework/src/onos/web/gui/src/main/webapp/app/view/intent/intent.js +++ b/framework/src/onos/web/gui/src/main/webapp/app/view/intent/intent.js @@ -23,14 +23,37 @@ angular.module('ovIntent', []) .controller('OvIntentCtrl', - ['$log', '$scope', 'TableBuilderService', + ['$log', '$scope', 'TableBuilderService', 'NavService', - function ($log, $scope, tbs) { - tbs.buildTable({ - scope: $scope, - tag: 'intent' - }); + function ($log, $scope, tbs, ns) { - $log.log('OvIntentCtrl has been created'); - }]); + function selCb($event, row) { + $log.debug('Got a click on:', row); + var m = /(\d+)\s:\s(.*)/.exec(row.appId), + id = m ? m[1] : null, + name = m ? m[2] : null; + + $scope.intentData = ($scope.selId && m) ? { + intentAppId: id, + intentAppName: name, + intentKey: row.key + } : null; + } + + tbs.buildTable({ + scope: $scope, + tag: 'intent', + selCb: selCb, + idKey: 'key' + }); + + $scope.topoTip = 'Show selected intent on topology view'; + + $scope.showIntent = function () { + var d = $scope.intentData; + d && ns.navTo('topo', d); + }; + + $log.log('OvIntentCtrl has been created'); + }]); }()); |