feat(ui): Quick-Toggles überall vervollständigt

NTP-Pools, User-Accounts, Backend-Server im Detail-Panel und
Routing-Rules im Domain-Detail-Panel — alle aktiv-Felder sind
jetzt inline schaltbar, kein Modale nötig.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Debian
2026-05-24 11:09:48 +02:00
parent 784533eb99
commit e419eceab8
4 changed files with 64 additions and 9 deletions

View File

@@ -406,6 +406,12 @@ function RoutingRulesPanel({ domainID, domainName }: { domainID: number; domainN
onSuccess: invalidate,
onError: (e: Error) => message.error(e.message),
})
const quickToggle = useMutation({
mutationFn: async ({ id, row, checked }: { id: number; row: RoutingRule; checked: boolean }) =>
apiClient.put(`/routing-rules/${id}`, { ...row, active: checked }),
onSuccess: invalidate,
onError: (e: Error) => message.error(e.message),
})
const backendLabel = (id: number) => {
const b = backends?.find(x => x.id === id)
@@ -418,7 +424,14 @@ function RoutingRulesPanel({ domainID, domainName }: { domainID: number; domainN
{ title: t('routing.priority'), dataIndex: 'priority', key: 'priority', width: 90 },
{
title: t('routing.active'), dataIndex: 'active', key: 'active', width: 80,
render: (v: boolean) => <StatusDot active={v} />,
render: (v: boolean, r: RoutingRule) => (
<Switch
size="small"
checked={v}
loading={quickToggle.isPending && quickToggle.variables?.id === r.id}
onChange={(checked) => quickToggle.mutate({ id: r.id, row: r, checked })}
/>
),
},
{
title: t('common.actions'), key: 'a', width: 90,