From 93ae25648bf9851cad6db561d4d626cdc2a82b2c Mon Sep 17 00:00:00 2001 From: Salah Aldeen Al Saleh Date: Tue, 26 Nov 2024 12:13:30 -0800 Subject: [PATCH] fix web lint --- web/src/Root.tsx | 2 +- web/src/components/DebugInfo.jsx | 64 ++++++++++++++++++++++++++------ 2 files changed, 53 insertions(+), 13 deletions(-) diff --git a/web/src/Root.tsx b/web/src/Root.tsx index 2bb027d8fb..d2d23d6484 100644 --- a/web/src/Root.tsx +++ b/web/src/Root.tsx @@ -31,7 +31,7 @@ import AppLicense from "@components/apps/AppLicense"; import AppRegistrySettings from "@components/apps/AppRegistrySettings"; import AppIdentityServiceSettings from "@components/apps/AppIdentityServiceSettings"; import TroubleshootContainer from "@components/troubleshoot/TroubleshootContainer"; -import DebugInfo from '@components/DebugInfo'; +import DebugInfo from "@components/DebugInfo"; import Footer from "./components/shared/Footer"; import NavBar from "./components/shared/NavBar"; diff --git a/web/src/components/DebugInfo.jsx b/web/src/components/DebugInfo.jsx index f4b525aaf7..aa92501641 100644 --- a/web/src/components/DebugInfo.jsx +++ b/web/src/components/DebugInfo.jsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect } from 'react'; +import React, { useState, useEffect } from "react"; import classNames from "classnames"; import { Utilities } from "@src/utilities/utilities"; import "@src/scss/components/DebugInfo.scss"; @@ -35,10 +35,12 @@ const DebugInfo = () => { clientInfo.lastPingSent.time, clientInfo.lastPongRecv.time, clientInfo.lastPongRecv.time, - clientInfo.lastPingRecv.time + clientInfo.lastPingRecv.time, ]; - return timestamps.some(timestamp => new Date() - new Date(timestamp) > 60 * 1000); - }; + return timestamps.some( + (timestamp) => new Date() - new Date(timestamp) > 60 * 1000 + ); + } if (loading) { return
Loading debug information...
; @@ -50,37 +52,75 @@ const DebugInfo = () => { return (
-

Websocket Clients

+

+ Websocket Clients +

{Object.entries(debugData.wsClients).map(([nodeName, clientInfo]) => ( -
+

- + {nodeName}

- Connected At: {Utilities.dateFormat(clientInfo.connectedAt, "MM/DD/YY @ hh:mm a z")} + Connected At:{" "} + {Utilities.dateFormat( + clientInfo.connectedAt, + "MM/DD/YY @ hh:mm a z" + )}

- Last Ping Sent: {Utilities.dateFormat(clientInfo.lastPingSent.time, "MM/DD/YY @ hh:mm:ss a z")} - (Message: {clientInfo.lastPingSent.message || "N/A"}) + Last Ping Sent:{" "} + {Utilities.dateFormat( + clientInfo.lastPingSent.time, + "MM/DD/YY @ hh:mm:ss a z" + )}{" "} + (Message:{" "} + {clientInfo.lastPingSent.message || "N/A"})

- Last Pong Received: {Utilities.dateFormat(clientInfo.lastPongRecv.time, "MM/DD/YY @ hh:mm:ss a z")} - (Message: {clientInfo.lastPongRecv.message || "N/A"}) + Last Pong Received:{" "} + {Utilities.dateFormat( + clientInfo.lastPongRecv.time, + "MM/DD/YY @ hh:mm:ss a z" + )}{" "} + (Message:{" "} + {clientInfo.lastPongRecv.message || "N/A"})

- Last Ping Received: {Utilities.dateFormat(clientInfo.lastPingRecv.time, "MM/DD/YY @ hh:mm:ss a z")} (Message: {clientInfo.lastPingRecv.message || "N/A"}) + Last Ping Received:{" "} + {Utilities.dateFormat( + clientInfo.lastPingRecv.time, + "MM/DD/YY @ hh:mm:ss a z" + )}{" "} + (Message:{" "} + {clientInfo.lastPingRecv.message || "N/A"})

- Last Pong Sent: {Utilities.dateFormat(clientInfo.lastPongSent.time, "MM/DD/YY @ hh:mm:ss a z")} - (Message: {clientInfo.lastPongSent.message || "N/A"}) + Last Pong Sent:{" "} + {Utilities.dateFormat( + clientInfo.lastPongSent.time, + "MM/DD/YY @ hh:mm:ss a z" + )}{" "} + (Message:{" "} + {clientInfo.lastPongSent.message || "N/A"})