fix(ui): ограничить редактор сценария без потери правил

This commit is contained in:
Denozordec committed 2026-10-04 16:38:19 +07:00
1 parent 2e648dcf1c
commit 9231597d88
8 files changed
+117 -17

No files matched your search

+5 -3
View File
@@ -1160,7 +1160,7 @@ function ScenarioSheet({ open, onClose, initial, onSave }: {
return (
<Sheet open={open} onOpenChange={v => { if (!v) onClose() }}>
<SheetContent className="flex flex-col overflow-hidden p-0 gap-0 sm:max-w-2xl">
<SheetContent className="flex flex-col overflow-hidden p-0 gap-0 data-[side=right]:w-full data-[side=right]:sm:max-w-2xl">
<SheetHeader className="shrink-0 px-6 pt-5 pb-4 border-b">
<SheetTitle>{isNew ? "Новый сценарий" : `Редактировать: ${initial?.name}`}</SheetTitle>
<SheetDescription>Набор правил firewall/mangle/nat + тестовый пакет</SheetDescription>
@@ -1552,11 +1552,13 @@ function SimulatorTab({ rules: allRules }: { rules: FirewallRule[] }) {
</button>
<button type="button"
onClick={() => { setEditingScenario(sc); setScenarioSheetOpen(true) }}
className="p-1 text-muted-foreground/50 hover:text-foreground transition-colors">
aria-label={`Редактировать сценарий ${sc.name}`}
className="size-11 inline-flex items-center justify-center text-muted-foreground/50 hover:text-foreground transition-colors">
<PencilIcon className="size-3.5" />
</button>
<button type="button" onClick={() => deleteScenario(sc.id)}
className="p-1 text-muted-foreground/50 hover:text-red-500 transition-colors">
aria-label={`Удалить сценарий ${sc.name}`}
className="size-11 inline-flex items-center justify-center text-muted-foreground/50 hover:text-red-500 transition-colors">
<Trash2Icon className="size-3.5" />
</button>
</div>