blob: a15a1ed67667208b0ae5284c38be4bf4538d9ae7 [file] [log] [blame]
Matteo Scandolod2044a42017-08-07 16:08:28 -07001
2/*
3 * Copyright 2017-present Open Networking Foundation
4
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8
9 * http://www.apache.org/licenses/LICENSE-2.0
10
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18
Matteo Scandolo68c2e722015-12-04 10:14:40 -080019'use strict';
20
21angular.module('xos.ceilometerDashboard', [
22 'ngResource',
23 'ngCookies',
Matteo Scandolo68c2e722015-12-04 10:14:40 -080024 'ui.router',
25 'xos.helpers',
Matteo Scandolo68856082015-12-08 14:35:55 -080026 'ngAnimate',
Matteo Scandoloc0582112015-12-09 16:09:59 -080027 'chart.js',
28 'ui.bootstrap.accordion'
Matteo Scandolo68c2e722015-12-04 10:14:40 -080029])
Matteo Scandolo68856082015-12-08 14:35:55 -080030.config(($stateProvider, $urlRouterProvider) => {
Matteo Scandolo68c2e722015-12-04 10:14:40 -080031 $stateProvider
32 .state('ceilometerDashboard', {
33 url: '/',
34 template: '<ceilometer-dashboard></ceilometer-dashboard>'
Matteo Scandolo7b80d842015-12-04 15:55:20 -080035 })
36 .state('samples', {
37 url: '/:name/:tenant/samples',
38 template: '<ceilometer-samples></ceilometer-samples>'
Matteo Scandolo68c2e722015-12-04 10:14:40 -080039 });
Matteo Scandolo68856082015-12-08 14:35:55 -080040 $urlRouterProvider.otherwise('/');
Matteo Scandolo68c2e722015-12-04 10:14:40 -080041})
42.config(function($httpProvider){
43 $httpProvider.interceptors.push('NoHyperlinks');
44})
Matteo Scandolo68856082015-12-08 14:35:55 -080045.run(function($rootScope){
46 $rootScope.stateName = 'ceilometerDashboard';
47 $rootScope.$on('$stateChangeStart', (event, toState) => {
Matteo Scandolo68856082015-12-08 14:35:55 -080048 $rootScope.stateName = toState.name;
49 })
Matteo Scandolof0577ac2016-03-21 17:27:42 -070050});