dashboard.ts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. canShare?: boolean;
  16. canStar?: boolean;
  17. canAdmin?: boolean;
  18. url?: string;
  19. folderId?: number;
  20. fullscreen?: boolean;
  21. isEditing?: boolean;
  22. canMakeEditable?: boolean;
  23. submenuEnabled?: boolean;
  24. provisioned?: boolean;
  25. focusPanelId?: boolean;
  26. isStarred?: boolean;
  27. showSettings?: boolean;
  28. expires?: string;
  29. isSnapshot?: boolean;
  30. folderTitle?: string;
  31. folderUrl?: string;
  32. created?: string;
  33. }
  34. export interface DashboardDataDTO {
  35. title: string;
  36. }
  37. export enum DashboardRouteInfo {
  38. Home = 'home-dashboard',
  39. New = 'new-dashboard',
  40. Normal = 'normal-dashboard',
  41. Scripted = 'scripted-dashboard',
  42. }
  43. export enum DashboardInitPhase {
  44. NotStarted = 'Not started',
  45. Fetching = 'Fetching',
  46. Services = 'Services',
  47. Failed = 'Failed',
  48. Completed = 'Completed',
  49. }
  50. export interface DashboardInitError {
  51. message: string;
  52. error: any;
  53. }
  54. export const KIOSK_MODE_TV = 'tv';
  55. export type KioskUrlValue = 'tv' | '1' | true;
  56. export interface DashboardState {
  57. model: MutableDashboard | null;
  58. initPhase: DashboardInitPhase;
  59. isInitSlow: boolean;
  60. initError?: DashboardInitError;
  61. permissions: DashboardAcl[] | null;
  62. }