dashboard.ts 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. import { DashboardAcl } from './acl';
  2. export interface MutableDashboard {
  3. title: string;
  4. meta: DashboardMeta;
  5. destroy: () => void;
  6. }
  7. export interface DashboardDTO {
  8. redirectUri?: string;
  9. dashboard: DashboardDataDTO;
  10. meta: DashboardMeta;
  11. }
  12. export interface DashboardMeta {
  13. canSave?: boolean;
  14. canEdit?: boolean;
  15. canDelete?: boolean;
  16. canShare?: boolean;
  17. canStar?: boolean;
  18. canAdmin?: boolean;
  19. url?: string;
  20. folderId?: number;
  21. fullscreen?: boolean;
  22. isEditing?: boolean;
  23. canMakeEditable?: boolean;
  24. submenuEnabled?: boolean;
  25. provisioned?: boolean;
  26. provisionedExternalId?: string;
  27. focusPanelId?: number;
  28. isStarred?: boolean;
  29. showSettings?: boolean;
  30. expires?: string;
  31. isSnapshot?: boolean;
  32. folderTitle?: string;
  33. folderUrl?: string;
  34. created?: string;
  35. }
  36. export interface DashboardDataDTO {
  37. title: string;
  38. }
  39. export enum DashboardRouteInfo {
  40. Home = 'home-dashboard',
  41. New = 'new-dashboard',
  42. Normal = 'normal-dashboard',
  43. Scripted = 'scripted-dashboard',
  44. }
  45. export enum DashboardInitPhase {
  46. NotStarted = 'Not started',
  47. Fetching = 'Fetching',
  48. Services = 'Services',
  49. Failed = 'Failed',
  50. Completed = 'Completed',
  51. }
  52. export interface DashboardInitError {
  53. message: string;
  54. error: any;
  55. }
  56. export const KIOSK_MODE_TV = 'tv';
  57. export type KioskUrlValue = 'tv' | '1' | true;
  58. export interface DashboardState {
  59. model: MutableDashboard | null;
  60. initPhase: DashboardInitPhase;
  61. isInitSlow: boolean;
  62. initError?: DashboardInitError;
  63. permissions: DashboardAcl[] | null;
  64. }