1c0a7cb850
Phase 4 — New Widget Types: - Clock/Weather, System Stats, RSS/Feed, Calendar, Markdown, Metric/Counter, Link Group, Camera/Stream widgets - Backend services with caching for each data source - Full creation form with dynamic config fields per type Phase 5 — Visual & Styling Enhancements: - Glassmorphism card style (solid/glass/outline) - Board-level themes with per-board hue/saturation - Animated SVG status rings replacing static dots - Card size options (compact/medium/large) - Custom CSS injection (admin + per-board, sanitized) - Wallpaper backgrounds with blur/overlay/parallax Phase 6 — Functional Features: - Favorites bar with drag-and-drop reordering - Recent apps tracking with privacy toggle - Uptime dashboard page (/status, guest-accessible) - Notifications system (Discord/Slack/Telegram/HTTP webhooks) - App tags with filtering in board view - Multi-URL app cards with expandable sub-links - Personal API tokens with scoped permissions - Audit log with retention and admin viewer Phase 7 — Quality of Life: - Onboarding wizard (5-step first-launch setup) - App URL health preview with favicon/title detection - Board templates (4 built-in + custom import/export) - Keyboard shortcut overlay (j/k nav, 1-9 boards, ? help) 212 files changed, 15641 insertions, 980 deletions. Build, lint, type check, and 222 tests all pass.
163 lines
4.0 KiB
TypeScript
163 lines
4.0 KiB
TypeScript
// User roles
|
|
export const UserRole = {
|
|
ADMIN: 'admin',
|
|
USER: 'user'
|
|
} as const;
|
|
export type UserRole = (typeof UserRole)[keyof typeof UserRole];
|
|
|
|
// Authentication modes
|
|
export const AuthMode = {
|
|
LOCAL: 'local',
|
|
OAUTH: 'oauth',
|
|
BOTH: 'both'
|
|
} as const;
|
|
export type AuthMode = (typeof AuthMode)[keyof typeof AuthMode];
|
|
|
|
// Auth providers
|
|
export const AuthProvider = {
|
|
LOCAL: 'local',
|
|
OAUTH: 'oauth'
|
|
} as const;
|
|
export type AuthProvider = (typeof AuthProvider)[keyof typeof AuthProvider];
|
|
|
|
// App status values
|
|
export const AppStatusValue = {
|
|
ONLINE: 'online',
|
|
OFFLINE: 'offline',
|
|
DEGRADED: 'degraded',
|
|
UNKNOWN: 'unknown'
|
|
} as const;
|
|
export type AppStatusValue = (typeof AppStatusValue)[keyof typeof AppStatusValue];
|
|
|
|
// Widget types
|
|
export const WidgetType = {
|
|
APP: 'app',
|
|
BOOKMARK: 'bookmark',
|
|
NOTE: 'note',
|
|
EMBED: 'embed',
|
|
STATUS: 'status',
|
|
CLOCK: 'clock',
|
|
SYSTEM_STATS: 'system_stats',
|
|
RSS: 'rss',
|
|
CALENDAR: 'calendar',
|
|
MARKDOWN: 'markdown',
|
|
METRIC: 'metric',
|
|
LINK_GROUP: 'link_group',
|
|
CAMERA: 'camera'
|
|
} as const;
|
|
export type WidgetType = (typeof WidgetType)[keyof typeof WidgetType];
|
|
|
|
// Icon types
|
|
export const IconType = {
|
|
LUCIDE: 'lucide',
|
|
SIMPLE: 'simple',
|
|
URL: 'url',
|
|
EMOJI: 'emoji'
|
|
} as const;
|
|
export type IconType = (typeof IconType)[keyof typeof IconType];
|
|
|
|
// Permission levels (ordered by privilege)
|
|
export const PermissionLevel = {
|
|
VIEW: 'view',
|
|
EDIT: 'edit',
|
|
ADMIN: 'admin'
|
|
} as const;
|
|
export type PermissionLevel = (typeof PermissionLevel)[keyof typeof PermissionLevel];
|
|
|
|
// Permission hierarchy for comparison
|
|
export const PERMISSION_HIERARCHY: Record<string, number> = {
|
|
[PermissionLevel.VIEW]: 1,
|
|
[PermissionLevel.EDIT]: 2,
|
|
[PermissionLevel.ADMIN]: 3
|
|
};
|
|
|
|
// Entity types for permissions
|
|
export const EntityType = {
|
|
BOARD: 'board',
|
|
APP: 'app'
|
|
} as const;
|
|
export type EntityType = (typeof EntityType)[keyof typeof EntityType];
|
|
|
|
// Target types for permissions
|
|
export const TargetType = {
|
|
USER: 'user',
|
|
GROUP: 'group'
|
|
} as const;
|
|
export type TargetType = (typeof TargetType)[keyof typeof TargetType];
|
|
|
|
// Healthcheck method
|
|
export const HealthcheckMethod = {
|
|
GET: 'GET',
|
|
HEAD: 'HEAD'
|
|
} as const;
|
|
export type HealthcheckMethod = (typeof HealthcheckMethod)[keyof typeof HealthcheckMethod];
|
|
|
|
// Card sizes
|
|
export const CardSize = {
|
|
COMPACT: 'compact',
|
|
MEDIUM: 'medium',
|
|
LARGE: 'large'
|
|
} as const;
|
|
export type CardSize = (typeof CardSize)[keyof typeof CardSize];
|
|
|
|
// Notification channel types
|
|
export const NotificationType = {
|
|
DISCORD: 'discord',
|
|
SLACK: 'slack',
|
|
TELEGRAM: 'telegram',
|
|
HTTP: 'http'
|
|
} as const;
|
|
export type NotificationType = (typeof NotificationType)[keyof typeof NotificationType];
|
|
|
|
// Notification events
|
|
export const NotificationEvent = {
|
|
APP_ONLINE: 'app_online',
|
|
APP_OFFLINE: 'app_offline',
|
|
APP_DEGRADED: 'app_degraded'
|
|
} as const;
|
|
export type NotificationEvent = (typeof NotificationEvent)[keyof typeof NotificationEvent];
|
|
|
|
// API token scopes
|
|
export const ApiTokenScope = {
|
|
READ: 'read',
|
|
WRITE: 'write',
|
|
ADMIN: 'admin'
|
|
} as const;
|
|
export type ApiTokenScope = (typeof ApiTokenScope)[keyof typeof ApiTokenScope];
|
|
|
|
// Audit log actions
|
|
export const AuditAction = {
|
|
USER_CREATED: 'user_created',
|
|
USER_DELETED: 'user_deleted',
|
|
USER_UPDATED: 'user_updated',
|
|
BOARD_CREATED: 'board_created',
|
|
BOARD_DELETED: 'board_deleted',
|
|
APP_CREATED: 'app_created',
|
|
APP_DELETED: 'app_deleted',
|
|
SETTINGS_UPDATED: 'settings_updated',
|
|
IMPORT: 'import',
|
|
EXPORT: 'export'
|
|
} as const;
|
|
export type AuditAction = (typeof AuditAction)[keyof typeof AuditAction];
|
|
|
|
// Background types for board wallpapers
|
|
export const BackgroundType = {
|
|
NONE: 'none',
|
|
COLOR: 'color',
|
|
WALLPAPER: 'wallpaper'
|
|
} as const;
|
|
export type BackgroundType = (typeof BackgroundType)[keyof typeof BackgroundType];
|
|
|
|
// Defaults
|
|
export const DEFAULTS = {
|
|
HEALTHCHECK_INTERVAL: 300,
|
|
HEALTHCHECK_TIMEOUT: 5000,
|
|
HEALTHCHECK_EXPECTED_STATUS: 200,
|
|
HEALTHCHECK_METHOD: 'GET',
|
|
JWT_EXPIRY: '15m',
|
|
REFRESH_TOKEN_EXPIRY_DAYS: 7,
|
|
DEFAULT_THEME: 'dark',
|
|
DEFAULT_PRIMARY_COLOR: '#6366f1',
|
|
SYSTEM_SETTINGS_ID: 'singleton'
|
|
} as const;
|