diff --git a/frontend/app/firewall/page.tsx b/frontend/app/firewall/page.tsx index edf3baf..da129bf 100644 --- a/frontend/app/firewall/page.tsx +++ b/frontend/app/firewall/page.tsx @@ -952,14 +952,22 @@ export default function FirewallPage() { {rule.state && (
State Tracking: - {Object.entries(rule.state).map(([key, value]) => ( -
- {key}: + {typeof rule.state === 'string' ? ( +
- {typeof value === 'object' ? JSON.stringify(value) : String(value)} + {rule.state}
- ))} + ) : ( + Object.entries(rule.state).map(([key, value]) => ( +
+ {key}: + + {typeof value === 'object' ? JSON.stringify(value) : String(value)} + +
+ )) + )}
)}
diff --git a/frontend/app/routing/page.tsx b/frontend/app/routing/page.tsx index 49ecef2..43ad463 100644 --- a/frontend/app/routing/page.tsx +++ b/frontend/app/routing/page.tsx @@ -1322,26 +1322,62 @@ export default function RoutingPage() {
- {Object.entries(rule.match).map(([key, value], j) => ( -
- {key}: - - {value as string} - -
- ))} + {Object.entries(rule.match || {}).map(([key, value], j) => { + // Format the value into a readable string + let displayValue = value; + if (typeof value === 'object' && value !== null) { + // Handle nested objects by getting all key-value pairs + const formatNestedObject = (obj: any, parentKey?: string): string => { + const entries = Object.entries(obj); + if (entries.length === 0) return ''; + + const [k, v] = entries[0]; + if (typeof v === 'object' && v !== null) { + return formatNestedObject(v, k); + } + return `${parentKey ? `${parentKey} ` : ''}${k} ${v}`; + }; + displayValue = formatNestedObject(value); + } + return ( +
+ {key}: + + {String(displayValue)} + +
+ ); + })}
- {Object.entries(rule.set).map(([key, value], j) => ( -
- {key}: - - {value as string} - -
- ))} + {Object.entries(rule.set || {}).map(([key, value], j) => { + // Format the value into a readable string + let displayValue = value; + if (typeof value === 'object' && value !== null) { + // Handle nested objects by getting all key-value pairs + const formatNestedObject = (obj: any, parentKey?: string): string => { + const entries = Object.entries(obj); + if (entries.length === 0) return ''; + + const [k, v] = entries[0]; + if (typeof v === 'object' && v !== null) { + return formatNestedObject(v, k); + } + return `${parentKey ? `${parentKey} ` : ''}${k} ${v}`; + }; + displayValue = formatNestedObject(value); + } + return ( +
+ {key}: + + {String(displayValue)} + +
+ ); + })}
@@ -1480,4 +1516,4 @@ export default function RoutingPage() { ) -} \ No newline at end of file +} diff --git a/start.sh b/start.sh old mode 100644 new mode 100755