fix(ui): учитывать права и состояние устройства при откате истории

This commit is contained in:
Denozordec committed 2026-10-13 19:45:39 +07:00
1 parent 5ce20e8892
commit c8f9c83f45
17 files changed
+388 -16

No files matched your search

+4 -3
View File
@@ -69,7 +69,7 @@ export function ConfigHistorySheet({
onRetry,
restoring,
onRestore,
restoreDisabled = false,
restoreDisabled = true,
}: {
open: boolean
onOpenChange: (open: boolean) => void
@@ -80,7 +80,7 @@ export function ConfigHistorySheet({
loadError?: string | null
onRetry?: () => void
restoring: boolean
restoreDisabled?: boolean
restoreDisabled: boolean
onRestore: (id: string) => Promise<void> | void
}) {
const [pending, setPending] = useState<ConfigRevisionDto | null>(null)
@@ -123,7 +123,8 @@ export function ConfigHistorySheet({
</SheetDescription>
</SheetHeader>
<div className="flex-1 min-h-0 overflow-y-auto px-6 py-5">
{loading ? (
{restoreDisabled && !busy && <p role="status" className="px-4 text-sm text-muted-foreground">Откат недоступен. Проверьте права на изменение и состояние выбранного устройства.</p>}
{loading ? (
<div role="status" className="flex items-center justify-center gap-2 py-16 text-sm text-muted-foreground">
<LoaderCircleIcon className="size-4 animate-spin" />
Загрузка истории…