Matteo Scandolo | d2044a4 | 2017-08-07 16:08:28 -0700 | [diff] [blame] | 1 | |
| 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 Scandolo | 68c2e72 | 2015-12-04 10:14:40 -0800 | [diff] [blame] | 19 | 'use strict'; |
| 20 | |
| 21 | angular.module('xos.ceilometerDashboard', [ |
| 22 | 'ngResource', |
| 23 | 'ngCookies', |
Matteo Scandolo | 68c2e72 | 2015-12-04 10:14:40 -0800 | [diff] [blame] | 24 | 'ui.router', |
| 25 | 'xos.helpers', |
Matteo Scandolo | 6885608 | 2015-12-08 14:35:55 -0800 | [diff] [blame] | 26 | 'ngAnimate', |
Matteo Scandolo | c058211 | 2015-12-09 16:09:59 -0800 | [diff] [blame] | 27 | 'chart.js', |
| 28 | 'ui.bootstrap.accordion' |
Matteo Scandolo | 68c2e72 | 2015-12-04 10:14:40 -0800 | [diff] [blame] | 29 | ]) |
Matteo Scandolo | 6885608 | 2015-12-08 14:35:55 -0800 | [diff] [blame] | 30 | .config(($stateProvider, $urlRouterProvider) => { |
Matteo Scandolo | 68c2e72 | 2015-12-04 10:14:40 -0800 | [diff] [blame] | 31 | $stateProvider |
| 32 | .state('ceilometerDashboard', { |
| 33 | url: '/', |
| 34 | template: '<ceilometer-dashboard></ceilometer-dashboard>' |
Matteo Scandolo | 7b80d84 | 2015-12-04 15:55:20 -0800 | [diff] [blame] | 35 | }) |
| 36 | .state('samples', { |
| 37 | url: '/:name/:tenant/samples', |
| 38 | template: '<ceilometer-samples></ceilometer-samples>' |
Matteo Scandolo | 68c2e72 | 2015-12-04 10:14:40 -0800 | [diff] [blame] | 39 | }); |
Matteo Scandolo | 6885608 | 2015-12-08 14:35:55 -0800 | [diff] [blame] | 40 | $urlRouterProvider.otherwise('/'); |
Matteo Scandolo | 68c2e72 | 2015-12-04 10:14:40 -0800 | [diff] [blame] | 41 | }) |
| 42 | .config(function($httpProvider){ |
| 43 | $httpProvider.interceptors.push('NoHyperlinks'); |
| 44 | }) |
Matteo Scandolo | 6885608 | 2015-12-08 14:35:55 -0800 | [diff] [blame] | 45 | .run(function($rootScope){ |
| 46 | $rootScope.stateName = 'ceilometerDashboard'; |
| 47 | $rootScope.$on('$stateChangeStart', (event, toState) => { |
Matteo Scandolo | 6885608 | 2015-12-08 14:35:55 -0800 | [diff] [blame] | 48 | $rootScope.stateName = toState.name; |
| 49 | }) |
Matteo Scandolo | f0577ac | 2016-03-21 17:27:42 -0700 | [diff] [blame] | 50 | }); |