fix(desktop): remove redundant checkpoint source

This commit is contained in:
t4we fan
2026-08-25 11:01:38 +08:00
parent 8b8bcb1c90
commit 637017fbb3
2 changed files with 1 additions and 7 deletions
@@ -95,7 +95,7 @@ function RollbackPanel({ copy, state }: { readonly copy: DesktopRecoveryCopy; re
const numberLocale = state.locale === 'zh' ? 'zh-CN' : 'en-US'
return <PanelScroll><div className="grid grid-cols-1 gap-4">{state.snapshot.checkpoints.map(checkpoint => {
const slotNumber = checkpoint.slotId.slice(-1)
return <Card key={checkpoint.slotId} className="w-full overflow-hidden"><CardHeader className="gap-3 space-y-0 sm:flex-row sm:items-start sm:justify-between"><div className="min-w-0 space-y-1.5"><CardTitle>{state.locale === 'zh' ? `槽位 ${slotNumber}` : `Slot ${slotNumber}`}</CardTitle><CardDescription>{checkpoint.status === 'empty' ? copy.noHealthyStartup : checkpoint.capturedAt === undefined ? copy.rollbackBody : new Date(checkpoint.capturedAt).toLocaleString(numberLocale)}</CardDescription></div><span className="shrink-0 rounded-full bg-muted px-2.5 py-1 text-xs font-medium text-muted-foreground">{checkpoint.status === 'empty' ? copy.emptySlot : copy.availableSlot}</span></CardHeader>{checkpoint.status === 'empty' ? null : <><CardContent><dl className="grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-5"><CheckpointFact label={copy.desktopVersion} value={checkpoint.appVersion ?? copy.unknown} /><CheckpointFact label={copy.checkpointSource} value={checkpoint.provider === 'desktop-profile' ? copy.automaticCheckpoint : copy.unknown} />{checkpoint.pluginCount === undefined ? null : <CheckpointFact label={copy.pluginCount} value={state.locale === 'zh' ? `${checkpoint.pluginCount} 个` : checkpoint.pluginCount.toLocaleString(numberLocale)} />}<CheckpointFact label={copy.configurationFileCount} value={state.locale === 'zh' ? `${checkpoint.fileCount ?? 0} 个` : (checkpoint.fileCount ?? 0).toLocaleString(numberLocale)} />{checkpoint.totalBytes === undefined ? null : <CheckpointFact label={copy.checkpointSize} value={formatCheckpointSize(checkpoint.totalBytes, state.locale)} />}</dl></CardContent><CardFooter className="flex-wrap justify-end gap-2 border-t bg-muted/20 px-6 py-4"><Action action="open-checkpoint" icon={<FolderOpen />} id={checkpoint.slotId}>{copy.openCheckpoint}</Action><Action action="preview-checkpoint" icon={<RotateCcw />} id={checkpoint.slotId} variant="default">{copy.rollbackCheckpoint}</Action></CardFooter></>}</Card>
return <Card key={checkpoint.slotId} className="w-full overflow-hidden"><CardHeader className="gap-3 space-y-0 sm:flex-row sm:items-start sm:justify-between"><div className="min-w-0 space-y-1.5"><CardTitle>{state.locale === 'zh' ? `槽位 ${slotNumber}` : `Slot ${slotNumber}`}</CardTitle><CardDescription>{checkpoint.status === 'empty' ? copy.noHealthyStartup : checkpoint.capturedAt === undefined ? copy.rollbackBody : new Date(checkpoint.capturedAt).toLocaleString(numberLocale)}</CardDescription></div><span className="shrink-0 rounded-full bg-muted px-2.5 py-1 text-xs font-medium text-muted-foreground">{checkpoint.status === 'empty' ? copy.emptySlot : copy.availableSlot}</span></CardHeader>{checkpoint.status === 'empty' ? null : <><CardContent><dl className="grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4"><CheckpointFact label={copy.desktopVersion} value={checkpoint.appVersion ?? copy.unknown} />{checkpoint.pluginCount === undefined ? null : <CheckpointFact label={copy.pluginCount} value={state.locale === 'zh' ? `${checkpoint.pluginCount} 个` : checkpoint.pluginCount.toLocaleString(numberLocale)} />}<CheckpointFact label={copy.configurationFileCount} value={state.locale === 'zh' ? `${checkpoint.fileCount ?? 0} 个` : (checkpoint.fileCount ?? 0).toLocaleString(numberLocale)} />{checkpoint.totalBytes === undefined ? null : <CheckpointFact label={copy.checkpointSize} value={formatCheckpointSize(checkpoint.totalBytes, state.locale)} />}</dl></CardContent><CardFooter className="flex-wrap justify-end gap-2 border-t bg-muted/20 px-6 py-4"><Action action="open-checkpoint" icon={<FolderOpen />} id={checkpoint.slotId}>{copy.openCheckpoint}</Action><Action action="preview-checkpoint" icon={<RotateCcw />} id={checkpoint.slotId} variant="default">{copy.rollbackCheckpoint}</Action></CardFooter></>}</Card>
})}</div></PanelScroll>
}
function ProfilesPanel({ copy, state }: { readonly copy: DesktopRecoveryCopy; readonly state: RecoveryState }): JSX.Element {
-6
View File
@@ -62,8 +62,6 @@ export interface DesktopRecoveryCopy {
readonly openCheckpoint: string
readonly rollbackCheckpoint: string
readonly desktopVersion: string
readonly checkpointSource: string
readonly automaticCheckpoint: string
readonly pluginCount: string
readonly configurationFileCount: string
readonly checkpointSize: string
@@ -141,8 +139,6 @@ const COPY: Record<DesktopLocale, DesktopRecoveryCopy> = {
openCheckpoint: 'Browse files',
rollbackCheckpoint: 'Roll back to this slot',
desktopVersion: 'DSH Desktop version',
checkpointSource: 'Created by',
automaticCheckpoint: 'DSH Desktop healthy-start check',
pluginCount: 'Plugins',
configurationFileCount: 'Configuration files',
checkpointSize: 'Checkpoint size',
@@ -218,8 +214,6 @@ const COPY: Record<DesktopLocale, DesktopRecoveryCopy> = {
openCheckpoint: '浏览文件',
rollbackCheckpoint: '回滚到此槽位',
desktopVersion: 'DSH Desktop 版本',
checkpointSource: '创建方式',
automaticCheckpoint: 'DSH Desktop 健康启动检查',
pluginCount: '插件',
configurationFileCount: '配置文件',
checkpointSize: 'Checkpoint 大小',