fix(backups): показать отсутствие файлов и защитить удаление записей

This commit is contained in:
Denozordec committed 2026-10-14 14:30:33 +07:00
1 parent e452e528e1
commit 6617b776bb
26 files changed
+420 -36

No files matched your search

@@ -13,6 +13,7 @@ import {
} from "@/components/ui/alert-dialog"
import { Alert, AlertDescription, AlertTitle } from "@/components/reui/alert"
import type { Backup } from "@/lib/data"
import { backupFileMissing } from "@/lib/backup-file-state"
import { AlertCircleIcon, LoaderCircleIcon, TriangleAlertIcon } from "lucide-react"
export function BackupDeleteDialog({
@@ -37,10 +38,10 @@ export function BackupDeleteDialog({
<AlertDialogMedia className="bg-destructive/10 text-destructive">
<AlertCircleIcon />
</AlertDialogMedia>
<AlertDialogTitle>Удалить бэкап?</AlertDialogTitle>
<AlertDialogTitle>{backup && backupFileMissing(backup) ? "Удалить запись о бэкапе?" : "Удалить бэкап?"}</AlertDialogTitle>
<AlertDialogDescription className="[overflow-wrap:anywhere]">
Файл <span className="font-mono text-foreground">{backup?.filename}</span> будет удалён
{backup?.storage === "s3" || backup?.storage === "both" ? " локально; объект S3 — через текущее подключение к хранилищу" : " с диска"}.
{backup && backupFileMissing(backup) ? <>Локальный файл <span className="font-mono text-foreground">{backup.filename}</span> отсутствует. Будет удалена только запись из истории.</> : <>Файл <span className="font-mono text-foreground">{backup?.filename}</span> будет удалён
{backup?.storage === "s3" || backup?.storage === "both" ? " локально; объект S3 — через текущее подключение к хранилищу" : " с диска"}.</>}
</AlertDialogDescription>
</AlertDialogHeader>
{error && <p role="alert" className="text-sm text-destructive break-words">{error}</p>}