Bri Prebilic Cole | ff3dc67 | 2015-05-06 12:59:38 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 Open Networking Laboratory |
| 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 -- Group View Module |
| 19 | */ |
| 20 | |
| 21 | (function () { |
| 22 | 'use strict'; |
| 23 | |
| 24 | // injected references |
| 25 | var $log, $scope, $location, fs, ts, tbs; |
| 26 | |
| 27 | angular.module('ovGroup', []) |
| 28 | .controller('OvGroupCtrl', |
| 29 | ['$log', '$scope', '$location', |
| 30 | 'FnService', 'TableService', 'TableBuilderService', |
| 31 | |
| 32 | function (_$log_, _$scope_, _$location_, _fs_, _ts_, _tbs_) { |
| 33 | var params; |
| 34 | $log = _$log_; |
| 35 | $scope = _$scope_; |
| 36 | $location = _$location_; |
| 37 | fs = _fs_; |
| 38 | ts = _ts_; |
| 39 | tbs = _tbs_; |
| 40 | |
| 41 | params = $location.search(); |
| 42 | if (params.hasOwnProperty('devId')) { |
| 43 | $scope.devId = params['devId']; |
| 44 | } |
| 45 | |
| 46 | tbs.buildTable({ |
| 47 | scope: $scope, |
| 48 | tag: 'group', |
| 49 | query: params |
| 50 | }); |
| 51 | |
| 52 | $scope.refresh = function () { |
| 53 | $log.debug('Refreshing groups page'); |
| 54 | ts.resetSortIcons(); |
| 55 | $scope.sortCallback(); |
| 56 | }; |
| 57 | |
| 58 | $log.log('OvGroupCtrl has been created'); |
| 59 | }]); |
| 60 | }()); |