dashboard.ts 1.5 KB

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