playlist_routes.ts 1005 B

123456789101112131415161718192021222324252627282930313233
  1. import angular from 'angular';
  2. import { PlaylistSrv } from './playlist_srv';
  3. /** @ngInject */
  4. function grafanaRoutes($routeProvider: any) {
  5. $routeProvider
  6. .when('/playlists', {
  7. templateUrl: 'public/app/features/playlist/partials/playlists.html',
  8. controllerAs: 'ctrl',
  9. controller: 'PlaylistsCtrl',
  10. })
  11. .when('/playlists/create', {
  12. templateUrl: 'public/app/features/playlist/partials/playlist.html',
  13. controllerAs: 'ctrl',
  14. controller: 'PlaylistEditCtrl',
  15. })
  16. .when('/playlists/edit/:id', {
  17. templateUrl: 'public/app/features/playlist/partials/playlist.html',
  18. controllerAs: 'ctrl',
  19. controller: 'PlaylistEditCtrl',
  20. })
  21. .when('/playlists/play/:id', {
  22. template: '',
  23. resolve: {
  24. init: (playlistSrv: PlaylistSrv, $route: any) => {
  25. const playlistId = $route.current.params.id;
  26. playlistSrv.start(playlistId);
  27. },
  28. },
  29. });
  30. }
  31. angular.module('grafana.routes').config(grafanaRoutes);