summaryrefslogtreecommitdiffstats
path: root/vbd/gui/module/src/main/resources/vpp/vpp.module.js
blob: 04367de4558f8aa86e4cb089b3403d70d35cf85b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/*
 * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/epl-v10.html
 */
define(['angularAMD', 'app/routingConfig', 'ui-bootstrap', 'Restangular', 'angular-animate', 'angular-aria', 'angular-material', 'angular-smart-table', 'angular-translate', 'angular-translate-loader-partial'], function() {

  var vpp = angular.module('app.vpp', ['ui.router.state','app.core', 'ui.bootstrap', 'restangular', 'ngAnimate', 'ngAria', 'ngMaterial', 'smart-table', 'pascalprecht.translate']);

  vpp.register = vpp;

  vpp.config(function ($stateProvider, $compileProvider, $controllerProvider, $provide, $translateProvider, $translatePartialLoaderProvider, NavHelperProvider, $filterProvider, $mdThemingProvider) {

    $translatePartialLoaderProvider.addPart('app/vpp/assets/data/locale');

    vpp.register = {
      directive : $compileProvider.directive,
      controller : $controllerProvider.register,
      filter: $filterProvider.register,
      factory : $provide.factory,
      service : $provide.service
    };

    NavHelperProvider.addControllerUrl('app/vpp/vpp.controller');
    NavHelperProvider.addToMenu('vpp', {
      "link": "#/vpp/index",
      "active": "main.vpp",
      "title": "VPP",
      "icon": "icon-code-fork",
      "page": {
        "title": "VPP",
        "description": "VPP"
      }
    });

    var access = routingConfig.accessLevels;
      $stateProvider.state('main.vpp', {
          url: 'vpp',
          abstract: true,
          views : {
            'content' : {
              templateUrl: 'src/app/vpp/views/root.tpl.html'
            }
          }
      });

      $stateProvider.state('main.vpp.index', {
          url: '/index',
          access: access.admin,
          views: {
              '': {
                  controller: 'vppCtrl',
                  templateUrl: 'src/app/vpp/views/index.tpl.html'
              }
          }
      });

      $mdThemingProvider.definePalette('odl-gray', {
          '50': 'BDBDBD',
          '100': 'BDBDBD',
          '200': 'BDBDBD',
          '300': 'BDBDBD',
          '400': 'BDBDBD',
          '500': '414040',
          '600': '414040',
          '700': '414040',
          '800': '414040',
          '900': '414040',
          'A100': '414040',
          'A200': '414040',
          'A400': '414040',
          'A700': '414040',
          'contrastDefaultColor': 'light',    // whether, by default, text (contrast)
                                              // on this palette should be dark or light
          'contrastDarkColors': [],
          'contrastLightColors': undefined    // could also specify this if default was 'dark'
    });

    $mdThemingProvider.definePalette('odl-orange', {
        '50': 'FFA500',
        '100': 'FFA500',
        '200': 'FFA500',
        '300': 'FFA500',
        '400': 'FFA500',
        '500': 'FFA500',
        '600': 'FFA500',
        '700': 'FFA500',
        '800': 'FFA500',
        '900': 'FFA500',
        'A100': 'FFA500',
        'A200': 'FFA500',
        'A400': 'FFA500',
        'A700': 'FFA500',
        'contrastDefaultColor': 'light',    // whether, by default, text (contrast)
                                            // on this palette should be dark or light
        'contrastDarkColors': [],
        'contrastLightColors': undefined    // could also specify this if default was 'dark'
    });

    $mdThemingProvider.theme('default')
        .primaryPalette('odl-gray',{
            'default': '500'
        })
        .accentPalette('odl-orange');

      // $stateProvider.state('main.vpp.inventory', {
      //     url: '/inventory',
      //     access: access.admin,
      //     views: {
      //         '': {
      //             controller: 'InventoryController',
      //             controllerAs: 'InventoryCtrl',
      //             templateUrl: 'src/app/vpp/views/inventory.html'
      //         }
      //     }
      // });

      // $stateProvider.state('main.vpp.bridgedomains', {
      //     url: '/bridgedomains',
      //     access: access.admin,
      //     views: {
      //         '': {
      //             controller: 'BridgeDomainsController',
      //             controllerAs: 'BridgeDomainsCtrl',
      //             templateUrl: 'src/app/vpp/views/bridge-domains.html'
      //         }
      //     }
      // });
  });

  return vpp;
});