blob: a0deeced17800684f9c4ecb5ffbe77ca6d328683 [file] [log] [blame]
Bri Prebilic Coleff3dc672015-05-06 12:59:38 -07001/*
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
Bri Prebilic Colee1be1b72015-05-12 16:07:24 -070025 var $log, $scope, $location, fs, tbs;
Bri Prebilic Coleff3dc672015-05-06 12:59:38 -070026
27 angular.module('ovGroup', [])
28 .controller('OvGroupCtrl',
29 ['$log', '$scope', '$location',
Bri Prebilic Colee1be1b72015-05-12 16:07:24 -070030 'FnService', 'TableBuilderService',
Bri Prebilic Coleff3dc672015-05-06 12:59:38 -070031
Bri Prebilic Colee1be1b72015-05-12 16:07:24 -070032 function (_$log_, _$scope_, _$location_, _fs_, _tbs_) {
Bri Prebilic Coleff3dc672015-05-06 12:59:38 -070033 var params;
34 $log = _$log_;
35 $scope = _$scope_;
36 $location = _$location_;
37 fs = _fs_;
Bri Prebilic Coleff3dc672015-05-06 12:59:38 -070038 tbs = _tbs_;
39
40 params = $location.search();
41 if (params.hasOwnProperty('devId')) {
42 $scope.devId = params['devId'];
43 }
44
45 tbs.buildTable({
46 scope: $scope,
47 tag: 'group',
48 query: params
49 });
50
Bri Prebilic Cole76f632c2015-05-28 17:06:02 -070051 $scope.$watch('tableData', function () {
52 if (!fs.isEmptyObject($scope.tableData)) {
53 $scope.tableData.forEach(function (group) {
54 group.buckets = $sce.trustAsHtml(group.buckets);
55 });
56 }
57 });
58
Bri Prebilic Coleff3dc672015-05-06 12:59:38 -070059 $log.log('OvGroupCtrl has been created');
60 }]);
61}());