feat: allow 'all' for policy source and destination zones
This commit is contained in:
@@ -104,20 +104,20 @@ export default function ConfigDetail() {
|
||||
{
|
||||
key: 'src_zone_id' as const,
|
||||
label: 'Source',
|
||||
render: (r: AnyEntity) => zones.find((z) => z.id === r['src_zone_id'])?.name ?? String(r['src_zone_id']),
|
||||
render: (r: AnyEntity) => r['src_zone_id'] == null ? 'all' : (zones.find((z) => z.id === r['src_zone_id'])?.name ?? String(r['src_zone_id'])),
|
||||
},
|
||||
{
|
||||
key: 'dst_zone_id' as const,
|
||||
label: 'Destination',
|
||||
render: (r: AnyEntity) => zones.find((z) => z.id === r['dst_zone_id'])?.name ?? String(r['dst_zone_id']),
|
||||
render: (r: AnyEntity) => r['dst_zone_id'] == null ? 'all' : (zones.find((z) => z.id === r['dst_zone_id'])?.name ?? String(r['dst_zone_id'])),
|
||||
},
|
||||
{ key: 'policy' as const, label: 'Policy' },
|
||||
{ key: 'log_level' as const, label: 'Log Level' },
|
||||
{ key: 'position' as const, label: 'Position' },
|
||||
] as Column<AnyEntity>[],
|
||||
fields: [
|
||||
{ name: 'src_zone_id', label: 'Source Zone', required: true, type: 'select' as const, options: zoneOptions },
|
||||
{ name: 'dst_zone_id', label: 'Destination Zone', required: true, type: 'select' as const, options: zoneOptions },
|
||||
{ name: 'src_zone_id', label: 'Source Zone', type: 'select' as const, options: [{ value: '', label: 'all' }, ...zoneOptions] },
|
||||
{ name: 'dst_zone_id', label: 'Destination Zone', type: 'select' as const, options: [{ value: '', label: 'all' }, ...zoneOptions] },
|
||||
{ name: 'policy', label: 'Policy', required: true, type: 'select' as const, options: [{ value: 'ACCEPT', label: 'ACCEPT' }, { value: 'DROP', label: 'DROP' }, { value: 'REJECT', label: 'REJECT' }, { value: 'CONTINUE', label: 'CONTINUE' }] },
|
||||
{ name: 'log_level', label: 'Log Level' },
|
||||
{ name: 'comment', label: 'Comment' },
|
||||
|
||||
Reference in New Issue
Block a user