feat: merge conflict resolution, site management, UI fixes

This commit is contained in:
ShukeBta
2026-05-16 17:57:34 +08:00
parent 0be8c7952e
commit cbb4b806be
84 changed files with 13826 additions and 202 deletions
+182
View File
@@ -4,14 +4,92 @@ export interface User {
id: string
username: string
role: 'admin' | 'user'
tier: 'free' | 'plus'
nickname?: string
email?: string
avatar_url?: string
force_password_reset: boolean
is_active: boolean
last_login_at?: string
created_at: string
updated_at: string
}
// Token pair
export interface TokenPair {
access_token: string
refresh_token: string
expires_in: number
token_type: string
}
// User permission (19 granular permissions)
export interface UserPermission {
id: string
user_id: string
// Default enabled (6)
can_view_dashboard: boolean
can_play_media: boolean
can_cast: boolean
can_external_player: boolean
can_favorite: boolean
can_view_history: boolean
// Default disabled (13)
can_edit_media: boolean
can_rescrape: boolean
can_use_ai: boolean
can_capture_frames: boolean
can_manage_downloads: boolean
can_view_discover: boolean
can_manage_subscriptions: boolean
can_manage_sites: boolean
can_use_ai_assistant: boolean
can_manage_users: boolean
can_manage_files: boolean
can_manage_strm: boolean
can_access_settings: boolean
created_at: string
updated_at: string
}
// API config
export interface ApiConfig {
id: string
provider: string
api_key?: string
base_url?: string
extra?: string
enabled: boolean
description?: string
last_tested_at?: string
test_result?: string
updated_at: string
}
// API provider
export interface ApiProvider {
id: string
name: string
description: string
has_api_key: boolean
has_base_url: boolean
}
// Refresh token response
export interface RefreshTokenResponse {
token: string
refresh_token: string
expires_in: number
token_type: string
}
// Login response
export interface LoginResponse {
user: User
tokens: TokenPair
}
// Library
export interface Library {
id: string
name: string
@@ -140,3 +218,107 @@ export interface StatsSnapshot {
hardware: Hardware
generated_at: string
}
// SSE Event types
export interface SSEEvent {
type: string
payload: unknown
}
// Permission check result
export interface PermissionCheckResult {
permissions: Record<string, boolean>
role: string
tier: string
is_super: boolean
}
// Download Client
export interface DownloadClient {
id: string
name: string
type: 'qbittorrent' | 'transmission' | 'aria2'
host: string
username: string
is_default: boolean
enabled: boolean
created_at: string
updated_at: string
}
// Download Client type info
export interface DownloadClientTypeInfo {
type: string
name: string
description: string
}
// Notify Channel
export interface NotifyChannel {
id: string
name: string
type: 'telegram' | 'wechat' | 'bark' | 'webhook' | 'email'
enabled: boolean
events: string
created_at: string
updated_at: string
}
// Notify Provider type info
export interface NotifyProviderInfo {
type: string
name: string
description: string
}
// Scheduler task config
export interface SchedulerTaskConfig {
id: string
name: string
description: string
enabled: boolean
interval: number
last_run_at?: string
next_run_at?: string
}
// Scheduler status
export interface SchedulerStatus {
running: boolean
started_at?: string
task_count: number
tasks: SchedulerTaskConfig[]
}
// Site configuration
export interface Site {
id: string
name: string
type: string // nexusphp / gazelle / unit3d / mteam / discuz / custom_rss
url: string
auth_type: string // cookie / api_key / auth_header
cookie?: string // decrypted only in detail view
api_key?: string // decrypted only in detail view
auth_header?: string // decrypted only in detail view
enabled: boolean
is_default: boolean
extra?: string
last_error?: string
last_check_at?: string
created_at: string
updated_at: string
}
// Site type info
export interface SiteTypeInfo {
value: string
name: string
description: string
}
// Auth type info
export interface AuthTypeInfo {
value: string
name: string
description: string
}