From e0faced051e5a7ef42608969aed61e0768c5b309 Mon Sep 17 00:00:00 2001 From: l0crian1 Date: Thu, 17 Apr 2025 14:08:19 -0400 Subject: [PATCH 1/3] firewall: Bug #24: Fix state output for firewall rules Firewall rules state output was not being displayed correctly when there was more than one state object. --- frontend/app/firewall/page.tsx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) 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)} + +
+ )) + )}
)}
From ce758f09587b45b777601fd575065fa3e43babb7 Mon Sep 17 00:00:00 2001 From: l0crian1 Date: Thu, 17 Apr 2025 14:23:26 -0400 Subject: [PATCH 2/3] start.sh: set executable bit This prevents the user from having to manually set the executable bit on the start.sh script. --- start.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 start.sh diff --git a/start.sh b/start.sh old mode 100644 new mode 100755 From c9f616eb087266ba96f2b55fa9febc2369024c37 Mon Sep 17 00:00:00 2001 From: l0crian1 Date: Thu, 17 Apr 2025 15:31:32 -0400 Subject: [PATCH 3/3] routing: Bug#22: Fix route maps - Fixed Objects are not valid as a react child error - Fix formatting of match statements --- frontend/app/routing/page.tsx | 70 ++++++++++++++++++++++++++--------- 1 file changed, 53 insertions(+), 17 deletions(-) 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 +}