fix(backups): сохранять неизвестный результат восстановления

This commit is contained in:
Denozordec committed 2026-10-01 16:32:06 +07:00
1 parent 39570656c9
commit 6f152c8dfe
11 files changed
+159 -11

No files matched your search

@@ -57,12 +57,14 @@ export function BackupDeleteDialog({
export function BackupRestoreDialog({
backup,
busy,
blocked = false,
error,
onConfirm,
onCancel,
}: {
backup: Backup | null
busy: boolean
blocked?: boolean
error?: string | null
onConfirm: () => void
onCancel: () => void
@@ -91,8 +93,8 @@ export function BackupRestoreDialog({
</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}>
<AlertDialogCancel disabled={busy} onClick={onCancel}>{blocked && !busy ? "Закрыть" : "Отмена"}</AlertDialogCancel>
<AlertDialogAction disabled={busy || blocked} onClick={onConfirm}>
{busy ? <LoaderCircleIcon className="size-4 animate-spin" /> : null}
Восстановить
</AlertDialogAction>
+3
View File
@@ -29,6 +29,7 @@ export function BackupsHistory({
onDelete,
onCreate,
canCreate = true,
canRestore = true,
canWrite = true,
canDownload = true,
}: {
@@ -43,6 +44,7 @@ export function BackupsHistory({
onRestore: (backup: Backup) => void
onDelete: (backup: Backup) => void
canCreate?: boolean
canRestore?: boolean
canWrite?: boolean
canDownload?: boolean
onCreate: () => void
@@ -82,6 +84,7 @@ export function BackupsHistory({
onDownload={onDownload}
onRestore={onRestore}
onDelete={onDelete}
canRestore={canRestore}
canWrite={canWrite}
canDownload={canDownload}
emptyTitle={isEmptyAll ? "Нет бэкапов" : "Ничего не найдено"}
+4 -2
View File
@@ -32,6 +32,7 @@ interface BackupsDataGridProps {
onDownload: (id: string, filename: string) => void
onRestore: (backup: Backup) => void
onDelete: (backup: Backup) => void
canRestore?: boolean
canWrite?: boolean
canDownload?: boolean
emptyAction?: ReactNode
@@ -50,6 +51,7 @@ function BackupsDataGrid({
onDownload,
onRestore,
onDelete,
canRestore = true,
canWrite = true,
canDownload = true,
emptyAction,
@@ -207,7 +209,7 @@ function BackupsDataGrid({
className="size-7"
title="Восстановить"
aria-label={`Восстановить ${b.filename}`}
disabled={!canWrite || !b.serverId}
disabled={!canWrite || !canRestore || !b.serverId}
onClick={() => onRestore(b)}
>
<RefreshCwIcon className="size-3.5" />
@@ -235,7 +237,7 @@ function BackupsDataGrid({
},
},
],
[onDelete, onDownload, onRestore, canWrite, canDownload],
[onDelete, onDownload, onRestore, canWrite, canRestore, canDownload],
)
const table = useTable({