fix(backups): подтверждать операции в текущем контексте

This commit is contained in:
Denozordec committed 2026-10-01 16:11:26 +07:00
1 parent 714af7e872
commit 4c5604bf87
9 files changed
+174 -49

No files matched your search

+14 -8
View File
@@ -18,11 +18,13 @@ import { AlertCircleIcon, LoaderCircleIcon, TriangleAlertIcon } from "lucide-rea
export function BackupDeleteDialog({
backup,
busy,
error,
onConfirm,
onCancel,
}: {
backup: Backup | null
busy: boolean
error?: string | null
onConfirm: () => void
onCancel: () => void
}) {
@@ -39,6 +41,7 @@ export function BackupDeleteDialog({
{backup?.storage === "s3" || backup?.storage === "both" ? " локально и из S3" : " с диска"}.
</AlertDialogDescription>
</AlertDialogHeader>
{error && <p role="alert" className="text-sm text-destructive break-words">{error}</p>}
<AlertDialogFooter>
<AlertDialogCancel disabled={busy} onClick={onCancel}>Отмена</AlertDialogCancel>
<AlertDialogAction variant="destructive" disabled={busy} onClick={onConfirm}>
@@ -54,11 +57,13 @@ export function BackupDeleteDialog({
export function BackupRestoreDialog({
backup,
busy,
error,
onConfirm,
onCancel,
}: {
backup: Backup | null
busy: boolean
error?: string | null
onConfirm: () => void
onCancel: () => void
}) {
@@ -70,20 +75,21 @@ export function BackupRestoreDialog({
<TriangleAlertIcon />
</AlertDialogMedia>
<AlertDialogTitle>Восстановить конфигурацию?</AlertDialogTitle>
<AlertDialogDescription className="flex flex-col gap-3">
<AlertDialogDescription>
<span>
Файл <span className="font-mono text-foreground">{backup?.filename}</span> будет загружен
на <span className="text-foreground">{backup?.server}</span> и импортирован.
</span>
<Alert variant="warning">
<TriangleAlertIcon />
<AlertTitle>Это изменит рабочую конфигурацию роутера</AlertTitle>
<AlertDescription>
Сессия может оборваться. Убедитесь, что выбран именно этот сервер и этот снимок.
</AlertDescription>
</Alert>
</AlertDialogDescription>
<Alert variant="warning">
<TriangleAlertIcon />
<AlertTitle>Это изменит рабочую конфигурацию роутера</AlertTitle>
<AlertDescription>
Сессия может оборваться. Убедитесь, что выбран именно этот сервер и этот снимок.
</AlertDescription>
</Alert>
</AlertDialogHeader>
{error && <p role="alert" className="text-sm text-destructive break-words">{error}</p>}
<AlertDialogFooter>
<AlertDialogCancel disabled={busy} onClick={onCancel}>Отмена</AlertDialogCancel>
<AlertDialogAction disabled={busy} onClick={onConfirm}>