diff --git a/frontend/src/components/RequestDetails.tsx b/frontend/src/components/RequestDetails.tsx index 8ef601e..50ed4f8 100644 --- a/frontend/src/components/RequestDetails.tsx +++ b/frontend/src/components/RequestDetails.tsx @@ -24,7 +24,7 @@ const TreeView: Component = (props) => { return {String(value)}; case "object": if (value === null) return null; - // This case is handled by recursive TreeView + return {String(value)}; default: return {String(value)}; } @@ -36,7 +36,9 @@ const TreeView: Component = (props) => { class="flex items-center cursor-pointer hover:bg-gray-100 rounded px-1" onClick={() => setIsOpen(!isOpen())} > - {isObject ? (isOpen() ? "▼" : "►") : ""} + + {isObject ? (isOpen() ? "▼" : "►") : ""} + {props.name}: {renderValue(props.data)} @@ -53,6 +55,70 @@ const TreeView: Component = (props) => { ); }; +interface DataSectionProps { + title: string; + data: any; + badge?: string; +} + +const DataSection: Component = (props) => { + const [viewMode, setViewMode] = createSignal<"tree" | "raw">("tree"); + + return ( +
+
+

+ {props.title} + + + {props.badge} + + +

+ + {/* View Toggle Buttons */} +
+ + +
+
+ +
+ + {JSON.stringify(props.data, null, 2)} + + } + > + + +
+
+ ); +}; + interface RequestDetailsProps { log: RequestLog; onClose: () => void; @@ -70,50 +136,35 @@ const RequestDetails: Component = (props) => { -
-
-

Request

-
- -
-
-
-

Response

-
- -
-
+
+ {/* Original Request */} + + {/* Original Response */} + + {/* Intercepted Request */} -
-

- Intercepted Request - - - {props.log.request_interception_action} - - -

-
- -
-
+
+ + {/* Intercepted Response */} -
-

- Intercepted Response - - - {props.log.response_interception_action} - - -

-
- -
-
+