Skip to content

Commit

Permalink
fix web lint
Browse files Browse the repository at this point in the history
  • Loading branch information
sgalsaleh committed Nov 26, 2024
1 parent abcf8e8 commit 93ae256
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 13 deletions.
2 changes: 1 addition & 1 deletion web/src/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
64 changes: 52 additions & 12 deletions web/src/components/DebugInfo.jsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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 <div className="loading">Loading debug information...</div>;
Expand All @@ -50,37 +52,75 @@ const DebugInfo = () => {

return (
<div className="u-padding--20">
<h2 className="u-fontSize--large u-fontWeight--bold card-title u-marginBottom--10">Websocket Clients</h2>
<h2 className="u-fontSize--large u-fontWeight--bold card-title u-marginBottom--10">
Websocket Clients
</h2>
<div className="flex flexWrap--wrap">
{Object.entries(debugData.wsClients).map(([nodeName, clientInfo]) => (
<div key={nodeName} className="card-bg u-marginBottom--20 u-marginRight--20" style={{ maxWidth: "50%" }}>
<div
key={nodeName}
className="card-bg u-marginBottom--20 u-marginRight--20"
style={{ maxWidth: "50%" }}
>
<p className="u-fontSize--normal u-fontWeight--medium u-marginBottom--10 card-title">
<span className={classNames("node-status u-marginRight--5", { disconnected: isStale(clientInfo)})}/>
<span
className={classNames("node-status u-marginRight--5", {
disconnected: isStale(clientInfo),
})}
/>
{nodeName}
</p>
<div className="card-item u-marginTop--5 u-marginBottom--5">
<p className="u-fontSize--normal u-fontWeight--medium u-textColor--bodyCopy u-padding--5">
<strong>Connected At:</strong> {Utilities.dateFormat(clientInfo.connectedAt, "MM/DD/YY @ hh:mm a z")}
<strong>Connected At:</strong>{" "}
{Utilities.dateFormat(
clientInfo.connectedAt,
"MM/DD/YY @ hh:mm a z"
)}
</p>
</div>
<div className="card-item u-marginTop--5 u-marginBottom--5">
<p className="u-fontSize--normal u-fontWeight--medium u-textColor--bodyCopy u-padding--5">
<strong>Last Ping Sent:</strong> {Utilities.dateFormat(clientInfo.lastPingSent.time, "MM/DD/YY @ hh:mm:ss a z")} - (Message: <strong>{clientInfo.lastPingSent.message || "N/A"})</strong>
<strong>Last Ping Sent:</strong>{" "}
{Utilities.dateFormat(
clientInfo.lastPingSent.time,
"MM/DD/YY @ hh:mm:ss a z"
)}{" "}
(Message:{" "}
<strong>{clientInfo.lastPingSent.message || "N/A"})</strong>
</p>
</div>
<div className="card-item u-marginTop--5 u-marginBottom--5">
<p className="u-fontSize--normal u-fontWeight--medium u-textColor--bodyCopy u-padding--5">
<strong>Last Pong Received:</strong> {Utilities.dateFormat(clientInfo.lastPongRecv.time, "MM/DD/YY @ hh:mm:ss a z")} - (Message: <strong>{clientInfo.lastPongRecv.message || "N/A"})</strong>
<strong>Last Pong Received:</strong>{" "}
{Utilities.dateFormat(
clientInfo.lastPongRecv.time,
"MM/DD/YY @ hh:mm:ss a z"
)}{" "}
(Message:{" "}
<strong>{clientInfo.lastPongRecv.message || "N/A"})</strong>
</p>
</div>
<div className="card-item u-marginTop--5 u-marginBottom--5">
<p className="u-fontSize--normal u-fontWeight--medium u-textColor--bodyCopy u-padding--5">
<strong>Last Ping Received:</strong> {Utilities.dateFormat(clientInfo.lastPingRecv.time, "MM/DD/YY @ hh:mm:ss a z")} (Message: <strong>{clientInfo.lastPingRecv.message || "N/A"})</strong>
<strong>Last Ping Received:</strong>{" "}
{Utilities.dateFormat(
clientInfo.lastPingRecv.time,
"MM/DD/YY @ hh:mm:ss a z"
)}{" "}
(Message:{" "}
<strong>{clientInfo.lastPingRecv.message || "N/A"})</strong>
</p>
</div>
<div className="card-item u-marginTop--5 u-marginBottom--5">
<p className="u-fontSize--normal u-fontWeight--medium u-textColor--bodyCopy u-padding--5">
<strong>Last Pong Sent:</strong> {Utilities.dateFormat(clientInfo.lastPongSent.time, "MM/DD/YY @ hh:mm:ss a z")} - (Message: <strong>{clientInfo.lastPongSent.message || "N/A"})</strong>
<strong>Last Pong Sent:</strong>{" "}
{Utilities.dateFormat(
clientInfo.lastPongSent.time,
"MM/DD/YY @ hh:mm:ss a z"
)}{" "}
(Message:{" "}
<strong>{clientInfo.lastPongSent.message || "N/A"})</strong>
</p>
</div>
</div>
Expand Down

0 comments on commit 93ae256

Please sign in to comment.