feat: allow interfaces to have no zone (shorewall '-' zone)

This commit is contained in:
2026-03-01 11:11:52 +01:00
parent 21d404229a
commit 58ef0dec63
5 changed files with 29 additions and 7 deletions

View File

@@ -83,13 +83,13 @@ export default function ConfigDetail() {
{
key: 'zone_id' as const,
label: 'Zone',
render: (r: AnyEntity) => zones.find((z) => z.id === r['zone_id'])?.name ?? String(r['zone_id']),
render: (r: AnyEntity) => r['zone_id'] == null ? '-' : (zones.find((z) => z.id === r['zone_id'])?.name ?? String(r['zone_id'])),
},
{ key: 'options' as const, label: 'Options' },
] as Column<AnyEntity>[],
fields: [
{ name: 'name', label: 'Interface Name', required: true },
{ name: 'zone_id', label: 'Zone', required: true, type: 'select' as const, options: zoneOptions },
{ name: 'zone_id', label: 'Zone', type: 'select' as const, options: [{ value: '', label: '- (no zone)' }, ...zoneOptions] },
{ name: 'options', label: 'Options' },
] as FieldDef[],
},