Matteo Scandolo | 68c2e72 | 2015-12-04 10:14:40 -0800 | [diff] [blame] | 1 | 'use strict'; |
| 2 | |
| 3 | angular.module('xos.ceilometerDashboard', [ |
| 4 | 'ngResource', |
| 5 | 'ngCookies', |
Matteo Scandolo | 68c2e72 | 2015-12-04 10:14:40 -0800 | [diff] [blame] | 6 | 'ui.router', |
| 7 | 'xos.helpers', |
Matteo Scandolo | 6885608 | 2015-12-08 14:35:55 -0800 | [diff] [blame] | 8 | 'ngAnimate', |
Matteo Scandolo | c058211 | 2015-12-09 16:09:59 -0800 | [diff] [blame] | 9 | 'chart.js', |
| 10 | 'ui.bootstrap.accordion' |
Matteo Scandolo | 68c2e72 | 2015-12-04 10:14:40 -0800 | [diff] [blame] | 11 | ]) |
Matteo Scandolo | 6885608 | 2015-12-08 14:35:55 -0800 | [diff] [blame] | 12 | .config(($stateProvider, $urlRouterProvider) => { |
Matteo Scandolo | 68c2e72 | 2015-12-04 10:14:40 -0800 | [diff] [blame] | 13 | $stateProvider |
| 14 | .state('ceilometerDashboard', { |
| 15 | url: '/', |
| 16 | template: '<ceilometer-dashboard></ceilometer-dashboard>' |
Matteo Scandolo | 7b80d84 | 2015-12-04 15:55:20 -0800 | [diff] [blame] | 17 | }) |
| 18 | .state('samples', { |
| 19 | url: '/:name/:tenant/samples', |
| 20 | template: '<ceilometer-samples></ceilometer-samples>' |
Matteo Scandolo | 68c2e72 | 2015-12-04 10:14:40 -0800 | [diff] [blame] | 21 | }); |
Matteo Scandolo | 6885608 | 2015-12-08 14:35:55 -0800 | [diff] [blame] | 22 | $urlRouterProvider.otherwise('/'); |
Matteo Scandolo | 68c2e72 | 2015-12-04 10:14:40 -0800 | [diff] [blame] | 23 | }) |
| 24 | .config(function($httpProvider){ |
| 25 | $httpProvider.interceptors.push('NoHyperlinks'); |
| 26 | }) |
Matteo Scandolo | 6885608 | 2015-12-08 14:35:55 -0800 | [diff] [blame] | 27 | .run(function($rootScope){ |
| 28 | $rootScope.stateName = 'ceilometerDashboard'; |
| 29 | $rootScope.$on('$stateChangeStart', (event, toState) => { |
Matteo Scandolo | 6885608 | 2015-12-08 14:35:55 -0800 | [diff] [blame] | 30 | $rootScope.stateName = toState.name; |
| 31 | }) |
Matteo Scandolo | f0577ac | 2016-03-21 17:27:42 -0700 | [diff] [blame] | 32 | }); |