fix(firewall): fehlende onError-Handler + i18n in Rules + NATRules
- 6 Mutations (create/update/del je Rules + NATRules) bekommen onError-Handler - Deutsche Placeholder-Texte → t() überführt - Action-Labels (accept/drop/reject) und Kind-Labels (any/object/group/cidr) in t() überführt statt hardkodiert anzeigen - CIDR-Label-Hardkodierung in Rules-Formular behoben - en/de: fw.rule.actions.*, fw.rule.kinds.*, fw.rule.namePlaceholder, fw.nat.namePlaceholder ergänzt Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -69,6 +69,7 @@ export default function NATRulesTab() {
|
||||
message.success(t('common.save')); setCreating(false); form.resetFields()
|
||||
void qc.invalidateQueries({ queryKey: ['fw', 'nat'] })
|
||||
},
|
||||
onError: (e: Error) => message.error(e.message),
|
||||
})
|
||||
const update = useMutation({
|
||||
mutationFn: async ({ id, v }: { id: number; v: FormValues }) => { await apiClient.put(`/firewall/nat-rules/${id}`, v) },
|
||||
@@ -76,10 +77,12 @@ export default function NATRulesTab() {
|
||||
message.success(t('common.save')); setEditing(null); form.resetFields()
|
||||
void qc.invalidateQueries({ queryKey: ['fw', 'nat'] })
|
||||
},
|
||||
onError: (e: Error) => message.error(e.message),
|
||||
})
|
||||
const del = useMutation({
|
||||
mutationFn: async (id: number) => { await apiClient.delete(`/firewall/nat-rules/${id}`) },
|
||||
onSuccess: () => { void qc.invalidateQueries({ queryKey: ['fw', 'nat'] }) },
|
||||
onError: (e: Error) => message.error(e.message),
|
||||
})
|
||||
const quickToggle = useMutation({
|
||||
mutationFn: async ({ id, row, checked }: { id: number; row: NATRule; checked: boolean }) => {
|
||||
@@ -190,7 +193,7 @@ export default function NATRulesTab() {
|
||||
onFinish={(v) => { if (editing) update.mutate({ id: editing.id, v }); else create.mutate(v) }}
|
||||
>
|
||||
<Form.Item label={t('fw.nat.name')} name="name">
|
||||
<Input placeholder="Forward HTTP zu Web-Backend" />
|
||||
<Input placeholder={t('fw.nat.namePlaceholder')} />
|
||||
</Form.Item>
|
||||
<Space size="middle">
|
||||
<Form.Item label={t('fw.nat.priority')} name="priority" rules={[{ required: true }]}>
|
||||
|
||||
Reference in New Issue
Block a user