diff --git a/matrixgw_frontend/package-lock.json b/matrixgw_frontend/package-lock.json index cf89c4a..e91bab4 100644 --- a/matrixgw_frontend/package-lock.json +++ b/matrixgw_frontend/package-lock.json @@ -23,6 +23,7 @@ "qrcode.react": "^4.2.0", "react": "^19.1.1", "react-dom": "^19.1.1", + "react-json-view-lite": "^2.5.0", "react-router": "^7.9.5" }, "devDependencies": { @@ -3674,6 +3675,18 @@ "integrity": "sha512-x3Ax3kNSMIIkyVYhWPyO09bu0uttcAIoecO/um/rKGQ4EltYWVYtyiGkS/3xMynrbVQdS69Jhlv8FXUEZehlzA==", "license": "MIT" }, + "node_modules/react-json-view-lite": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/react-json-view-lite/-/react-json-view-lite-2.5.0.tgz", + "integrity": "sha512-tk7o7QG9oYyELWHL8xiMQ8x4WzjCzbWNyig3uexmkLb54r8jO0yH3WCWx8UZS0c49eSA4QUmG5caiRJ8fAn58g==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "react": "^18.0.0 || ^19.0.0" + } + }, "node_modules/react-refresh": { "version": "0.18.0", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.18.0.tgz", diff --git a/matrixgw_frontend/package.json b/matrixgw_frontend/package.json index f9b7daf..4d8f1b0 100644 --- a/matrixgw_frontend/package.json +++ b/matrixgw_frontend/package.json @@ -25,6 +25,7 @@ "qrcode.react": "^4.2.0", "react": "^19.1.1", "react-dom": "^19.1.1", + "react-json-view-lite": "^2.5.0", "react-router": "^7.9.5" }, "devDependencies": { diff --git a/matrixgw_frontend/src/routes/WSDebugRoute.tsx b/matrixgw_frontend/src/routes/WSDebugRoute.tsx index e7179cb..f7073bf 100644 --- a/matrixgw_frontend/src/routes/WSDebugRoute.tsx +++ b/matrixgw_frontend/src/routes/WSDebugRoute.tsx @@ -1,4 +1,6 @@ import React from "react"; +import { JsonView, darkStyles } from "react-json-view-lite"; +import "react-json-view-lite/dist/index.css"; import { WsApi, type WsMessage } from "../api/WsApi"; import { useSnackbar } from "../hooks/contexts_provider/SnackbarProvider"; import { time } from "../utils/DateUtils"; @@ -48,7 +50,19 @@ export function WSDebugRoute(): React.ReactElement { return ( State: {state} - {JSON.stringify(messages)} + {messages.map((msg, id) => ( +
+ level < 2} + style={{ + ...darkStyles, + container: "", + }} + /> +
+ ))}
); }