feat: add dashboard health actions

This commit is contained in:
Lan
2026-06-03 06:15:15 +08:00
parent a573f1f5cc
commit 47edefbdd7
8 changed files with 394 additions and 39 deletions
+80 -27
View File
@@ -1,3 +1,16 @@
import type { AdminFileHealthFilter } from './file'
export interface DashboardHealthSummary {
healthAttentionCount: number
healthDangerCount: number
healthWarningCount: number
expiringSoonCount: number
storageIssueCount: number
neverRetrievedCount: number
healthyCount: number
permanentCount: number
}
export interface DashboardData {
totalFiles: number
storageUsed: number | string
@@ -17,6 +30,15 @@ export interface DashboardData {
openUpload?: number
enableChunk?: number
maxSaveSeconds?: number
healthAttentionCount?: number
healthDangerCount?: number
healthWarningCount?: number
expiringSoonCount?: number
storageIssueCount?: number
neverRetrievedCount?: number
healthyCount?: number
permanentCount?: number
healthSummary?: Partial<DashboardHealthSummary>
topSuffixes?: DashboardSuffixStat[]
recentFiles?: DashboardRecentFile[]
}
@@ -40,31 +62,62 @@ export interface DashboardRecentFile {
isExpired: boolean
}
export interface DashboardViewData extends DashboardData {
hasExtendedStats: boolean
activeCount: number
expiredCount: number
textCount: number
fileCount: number
chunkedCount: number
usedCount: number
storageBackend: string
uploadSizeLimit: number
openUpload: number
enableChunk: number
maxSaveSeconds: number
topSuffixes: DashboardSuffixStat[]
recentFiles: DashboardRecentFile[]
storageUsed: number
yesterdaySize: number
todaySize: number
storageUsedText: string
yesterdaySizeText: string
todaySizeText: string
uploadSizeLimitText: string
sysUptimeText: string
activeRatio: number
textRatio: number
fileRatio: number
todaySizeRatio: number
export type DashboardViewData = Omit<
DashboardData,
| keyof DashboardHealthSummary
| 'activeCount'
| 'expiredCount'
| 'textCount'
| 'fileCount'
| 'chunkedCount'
| 'usedCount'
| 'storageBackend'
| 'uploadSizeLimit'
| 'openUpload'
| 'enableChunk'
| 'maxSaveSeconds'
| 'topSuffixes'
| 'recentFiles'
| 'storageUsed'
| 'yesterdaySize'
| 'todaySize'
> &
DashboardHealthSummary & {
hasExtendedStats: boolean
activeCount: number
expiredCount: number
textCount: number
fileCount: number
chunkedCount: number
usedCount: number
storageBackend: string
uploadSizeLimit: number
openUpload: number
enableChunk: number
maxSaveSeconds: number
topSuffixes: DashboardSuffixStat[]
recentFiles: DashboardRecentFile[]
storageUsed: number
yesterdaySize: number
todaySize: number
storageUsedText: string
yesterdaySizeText: string
todaySizeText: string
uploadSizeLimitText: string
sysUptimeText: string
activeRatio: number
textRatio: number
fileRatio: number
healthyRatio: number
healthAttentionRatio: number
todaySizeRatio: number
}
export interface DashboardHealthAction {
key: string
label: string
description: string
count: number
health: AdminFileHealthFilter
tone: 'danger' | 'warning' | 'success' | 'neutral'
}
+2
View File
@@ -69,6 +69,8 @@ export interface AdminFileSummary {
expiringSoonCount: number
storageIssueCount: number
neverRetrievedCount: number
healthyCount: number
permanentCount: number
storageUsed: number
usedCount: number
}