blob: 1e8585dde2d3e9db090b00db303418ceeb51f6c6 [file] [log] [blame]
Bri Prebilic Coleac829e42015-05-05 13:42:06 -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 -- Port View Module
19 */
20
21(function () {
22 'use strict';
23
24 // injected references
Bri Prebilic Cole9b1fb9a2015-07-01 13:57:11 -070025 var $log, $scope, $location, fs, tbs, ns;
Bri Prebilic Coleac829e42015-05-05 13:42:06 -070026
27 angular.module('ovPort', [])
28 .controller('OvPortCtrl',
Bri Prebilic Cole9b1fb9a2015-07-01 13:57:11 -070029 ['$log', '$scope', '$location',
30 'FnService', 'TableBuilderService', 'NavService',
Bri Prebilic Coleac829e42015-05-05 13:42:06 -070031
Bri Prebilic Cole9b1fb9a2015-07-01 13:57:11 -070032 function (_$log_, _$scope_, _$location_, _fs_, _tbs_, _ns_) {
Bri Prebilic Coleac829e42015-05-05 13:42:06 -070033 var params;
34 $log = _$log_;
35 $scope = _$scope_;
36 $location = _$location_;
37 fs = _fs_;
Bri Prebilic Coleac829e42015-05-05 13:42:06 -070038 tbs = _tbs_;
Bri Prebilic Cole9b1fb9a2015-07-01 13:57:11 -070039 ns = _ns_;
Simon Hunt20856ec2015-11-16 15:58:14 -080040 $scope.deviceTip = 'Show device table';
Bri Prebilic Coleeef67ae2015-07-01 16:26:59 -070041 $scope.flowTip = 'Show flow view for this device';
42 $scope.groupTip = 'Show group view for this device';
Bri Prebilic Coleac829e42015-05-05 13:42:06 -070043
44 params = $location.search();
45 if (params.hasOwnProperty('devId')) {
46 $scope.devId = params['devId'];
47 }
48
49 tbs.buildTable({
50 scope: $scope,
51 tag: 'port',
52 query: params
53 });
54
Bri Prebilic Cole9b1fb9a2015-07-01 13:57:11 -070055 $scope.nav = function (path) {
56 if ($scope.devId) {
57 ns.navTo(path, { devId: $scope.devId });
58 }
59 };
60
Bri Prebilic Coleac829e42015-05-05 13:42:06 -070061 $log.log('OvPortCtrl has been created');
62 }]);
63}());