Design changes p. 1
[honeycomb.git] / vbd / gui / module / src / main / resources / vpp / controllers / vpp.controller.js
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 var modules = [
10     // module
11     'app/vpp/vpp.module',
12     // services
13     'app/vpp/services/vpp.services',
14     'app/vpp/services/inventory.service',
15     'app/vpp/services/bdm.service',
16     'app/vpp/services/bdm.bridgedomain.service',
17     'app/vpp/services/bdm.interface.service',
18     'app/vpp/services/bdm.vpp.service',
19     //controllers
20     'app/vpp/controllers/inventory.controller',
21     'app/vpp/controllers/bdm.controller',
22     'app/vpp/controllers/bdm.bridgedomain.controller',
23     'app/vpp/controllers/bdm.vpp.controller',
24     'app/vpp/controllers/bdm.interface.controller'
25 ];
26
27
28 define(modules, function(vpp) {
29
30     vpp.controller('vppCtrl', ['$scope', '$rootScope', '$timeout', 'toastService', '$mdSidenav', '$mdDialog',
31         function ($scope, $rootScope, $timeout, toastService, $mdSidenav, $mdDialog) {
32
33             $rootScope['section_logo'] = 'src/app/vpp/assets/images/vpp.gif';
34             $scope.view_path =  'src/app/vpp/views/';
35                 
36             $scope.mainView = "inventory";
37             $scope.selectedVpp = null;
38
39             $scope.setMainView = function(viewName) {
40                 $scope.mainView = viewName;
41             };
42
43             $scope.selectVpp = function(vpp) {
44                 $scope.selectedVpp = vpp;
45                 $scope.$broadcast('RELOAD_SELECTED_VPP');
46             };
47
48             // filter used in inventory to filter interfaceList of vxlan_tunnel interfaces
49             $scope.filterRemoveVxlanIf = function (item) {
50                 return item.name.indexOf('vxlan') !== 0;
51             };
52
53             // filter used in inventory to return vxlan_tunnel interfaces
54             $scope.filterGetVxlanIf = function (item) {
55                 return item.name.indexOf('vxlan') === 0;
56             };
57
58         }]);
59
60
61 });
62
63