dashboard.ts 1.5 KB

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