mirror of
https://github.com/grafana/grafana.git
synced 2025-02-11 16:15:42 -06:00
44 lines
1.3 KiB
JavaScript
44 lines
1.3 KiB
JavaScript
define([
|
|
'angular',
|
|
'app/core/config',
|
|
'lodash'
|
|
],
|
|
function (angular) {
|
|
'use strict';
|
|
|
|
var module = angular.module('grafana.routes');
|
|
|
|
module.config(function($routeProvider) {
|
|
$routeProvider
|
|
.when('/playlists', {
|
|
templateUrl: 'app/features/playlist/partials/playlists.html',
|
|
controller : 'PlaylistsCtrl'
|
|
})
|
|
.when('/playlists/create', {
|
|
templateUrl: 'app/features/playlist/partials/playlist.html',
|
|
controller : 'PlaylistEditCtrl'
|
|
})
|
|
.when('/playlists/edit/:id', {
|
|
templateUrl: 'app/features/playlist/partials/playlist.html',
|
|
controller : 'PlaylistEditCtrl'
|
|
})
|
|
.when('/playlists/play/:id', {
|
|
templateUrl: 'app/partials/dashboard.html',
|
|
controller : 'LoadDashboardCtrl',
|
|
resolve: {
|
|
init: function(backendSrv, playlistSrv, $route) {
|
|
var playlistId = $route.current.params.id;
|
|
|
|
return backendSrv.get('/api/playlists/' + playlistId)
|
|
.then(function(playlist) {
|
|
return backendSrv.get('/api/playlists/' + playlistId + '/dashboards')
|
|
.then(function(dashboards) {
|
|
playlistSrv.start(dashboards, playlist.interval);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|