blob: bcd471b52f573d65c79363cd5a513c450912ee2d [file] [log] [blame]
Simon Hunt1002cd82015-04-23 14:44:03 -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 -- Flow View Module
19 */
20
21(function () {
22 'use strict';
23
Bri Prebilic Colecdc188d2015-04-24 16:40:11 -070024 // injected references
Bri Prebilic Cole3d4d01c2015-04-30 13:48:36 -070025 var $log, $scope, $location, fs, ts, tbs;
Bri Prebilic Colecdc188d2015-04-24 16:40:11 -070026
Simon Hunt1002cd82015-04-23 14:44:03 -070027 angular.module('ovFlow', [])
28 .controller('OvFlowCtrl',
Bri Prebilic Cole3d4d01c2015-04-30 13:48:36 -070029 ['$log', '$scope', '$location',
30 'FnService', 'TableService', 'TableBuilderService',
Simon Hunt1002cd82015-04-23 14:44:03 -070031
Bri Prebilic Cole3d4d01c2015-04-30 13:48:36 -070032 function (_$log_, _$scope_, _$location_, _fs_, _ts_, _tbs_) {
Bri Prebilic Colecdc188d2015-04-24 16:40:11 -070033 var self = this,
34 params;
35 $log = _$log_;
36 $scope = _$scope_;
37 $location = _$location_;
38 fs = _fs_;
Bri Prebilic Cole3d4d01c2015-04-30 13:48:36 -070039 ts = _ts_;
Bri Prebilic Colecdc188d2015-04-24 16:40:11 -070040 tbs = _tbs_;
41
42 params = $location.search();
43 if (params.hasOwnProperty('devId')) {
44 self.devId = params['devId'];
45 }
46
47 tbs.buildTable({
48 self: self,
49 scope: $scope,
50 tag: 'flow',
51 query: params
52 });
Bri Prebilic Cole3d4d01c2015-04-30 13:48:36 -070053
54 $scope.refresh = function () {
55 $log.debug('Refreshing flows page');
56 ts.resetSortIcons();
57 $scope.sortCallback();
58 };
Simon Hunt1002cd82015-04-23 14:44:03 -070059
60 $log.log('OvFlowCtrl has been created');
61 }]);
62}());