Matteo Scandolo | e3de73d | 2015-12-04 10:14:40 -0800 | [diff] [blame] | 1 | 'use strict'; |
| 2 | |
| 3 | angular.module('xos.ceilometerDashboard', [ |
| 4 | 'ngResource', |
| 5 | 'ngCookies', |
Matteo Scandolo | e3de73d | 2015-12-04 10:14:40 -0800 | [diff] [blame] | 6 | 'ui.router', |
| 7 | 'xos.helpers', |
Matteo Scandolo | c2d3110 | 2015-12-08 14:35:55 -0800 | [diff] [blame] | 8 | 'ngAnimate', |
Matteo Scandolo | 0f5e163 | 2015-12-09 16:09:59 -0800 | [diff] [blame] | 9 | 'chart.js', |
| 10 | 'ui.bootstrap.accordion' |
Matteo Scandolo | e3de73d | 2015-12-04 10:14:40 -0800 | [diff] [blame] | 11 | ]) |
Matteo Scandolo | c2d3110 | 2015-12-08 14:35:55 -0800 | [diff] [blame] | 12 | .config(($stateProvider, $urlRouterProvider) => { |
Matteo Scandolo | e3de73d | 2015-12-04 10:14:40 -0800 | [diff] [blame] | 13 | $stateProvider |
| 14 | .state('ceilometerDashboard', { |
| 15 | url: '/', |
| 16 | template: '<ceilometer-dashboard></ceilometer-dashboard>' |
Matteo Scandolo | ec8ad42 | 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 | e3de73d | 2015-12-04 10:14:40 -0800 | [diff] [blame] | 21 | }); |
Matteo Scandolo | c2d3110 | 2015-12-08 14:35:55 -0800 | [diff] [blame] | 22 | $urlRouterProvider.otherwise('/'); |
Matteo Scandolo | e3de73d | 2015-12-04 10:14:40 -0800 | [diff] [blame] | 23 | }) |
| 24 | .config(function($httpProvider){ |
| 25 | $httpProvider.interceptors.push('NoHyperlinks'); |
| 26 | }) |
Matteo Scandolo | c2d3110 | 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 | c2d3110 | 2015-12-08 14:35:55 -0800 | [diff] [blame] | 30 | $rootScope.stateName = toState.name; |
| 31 | }) |
Matteo Scandolo | 78b8045 | 2016-03-21 17:27:42 -0700 | [diff] [blame] | 32 | }); |