2018-04-04 08:26:23 -05:00
|
|
|
import angular from 'angular';
|
2019-07-18 01:03:04 -05:00
|
|
|
import { PlaylistSrv } from './playlist_srv';
|
2018-04-04 08:26:23 -05:00
|
|
|
|
2018-04-09 14:33:18 -05:00
|
|
|
/** @ngInject */
|
2019-07-18 01:03:04 -05:00
|
|
|
function grafanaRoutes($routeProvider: any) {
|
2018-04-04 08:26:23 -05:00
|
|
|
$routeProvider
|
|
|
|
.when('/playlists', {
|
|
|
|
templateUrl: 'public/app/features/playlist/partials/playlists.html',
|
|
|
|
controllerAs: 'ctrl',
|
|
|
|
controller: 'PlaylistsCtrl',
|
|
|
|
})
|
|
|
|
.when('/playlists/create', {
|
|
|
|
templateUrl: 'public/app/features/playlist/partials/playlist.html',
|
|
|
|
controllerAs: 'ctrl',
|
|
|
|
controller: 'PlaylistEditCtrl',
|
|
|
|
})
|
|
|
|
.when('/playlists/edit/:id', {
|
|
|
|
templateUrl: 'public/app/features/playlist/partials/playlist.html',
|
|
|
|
controllerAs: 'ctrl',
|
|
|
|
controller: 'PlaylistEditCtrl',
|
|
|
|
})
|
|
|
|
.when('/playlists/play/:id', {
|
2018-08-30 04:52:31 -05:00
|
|
|
template: '',
|
2018-04-04 08:26:23 -05:00
|
|
|
resolve: {
|
2019-07-18 01:03:04 -05:00
|
|
|
init: (playlistSrv: PlaylistSrv, $route: any) => {
|
2018-08-26 10:14:40 -05:00
|
|
|
const playlistId = $route.current.params.id;
|
2018-04-04 08:26:23 -05:00
|
|
|
playlistSrv.start(playlistId);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
angular.module('grafana.routes').config(grafanaRoutes);
|