Add connection tool
diff --git a/src/app/components/NavRoot.tsx b/src/app/components/NavRoot.tsx
index 5736c4a..0707b9c 100644
--- a/src/app/components/NavRoot.tsx
+++ b/src/app/components/NavRoot.tsx
@@ -43,7 +43,13 @@
return (
<div className="h-full">
- <Navbar title="WebDiag" logo="https://emoji.jottocraft.com/highres/1f9f0.svg" logoFullWidth widgets={{
+ <Navbar title="WebDiag" titleAction={{
+ href: "/",
+ onClick: (e) => {
+ e.preventDefault();
+ navigate("/");
+ }
+ }} logo="https://emoji.jottocraft.com/highres/1f9f0.svg" logoFullWidth widgets={{
right: (
<div>
<Clickable href="https://jottocraft.com/feedback/?key=burya">
diff --git a/src/app/components/ua/SecCH.tsx b/src/app/components/ua/SecCH.tsx
index 71cd041..5764ff2 100644
--- a/src/app/components/ua/SecCH.tsx
+++ b/src/app/components/ua/SecCH.tsx
@@ -51,7 +51,7 @@
<Widget name="Network connection" icon="cell_wifi">
<table>
<tbody>
- {data.net.rtt ? <tr><td className="pr-4">Layer 7 round trip time: </td><td>{data.net.rtt} ms</td></tr> : null}
+ {data.net.rtt ? <tr><td className="pr-4">Layer 7 round-trip time: </td><td>{data.net.rtt} ms</td></tr> : null}
{data.net.ect ? <tr><td className="pr-4">Effective cellular-like connection type: </td><td>{data.net.ect.toUpperCase()}</td></tr> : null}
{data.net.dl ? <tr><td className="pr-4">Approximate supported bandwidth: </td><td>{data.net.dl} Mbps</td></tr> : null}
</tbody>
diff --git a/src/app/routes/connection.tsx b/src/app/routes/connection.tsx
index e8f7f63..ead9387 100644
--- a/src/app/routes/connection.tsx
+++ b/src/app/routes/connection.tsx
@@ -20,10 +20,42 @@
<table>
<tbody>
<tr>
- <td className="p-4" colSpan={2}>
- <Widget name="Legacy User-Agent header" icon="code">
+ <td className="p-4" colSpan={1}>
+ <Widget name="Cloudflare colocation" icon="cloud">
<p>
- <code className="font-medium text-type-0">{data.colo}</code>
+ {data.colo}
+ </p>
+ </Widget>
+ </td>
+ <td className="p-4" colSpan={1}>
+ <Widget name="TCP round-trip time (RTT)" icon="network_ping">
+ <p>
+ <code className="font-medium text-type-0">{data.clientTcpRtt}</code> ms
+ </p>
+ </Widget>
+ </td>
+ </tr>
+ <tr>
+ <td className="p-4" colSpan={1}>
+ <Widget name="TLS cipher" icon="encrypted">
+ <p>
+ <code className="font-medium text-type-0">{data.tlsCipher}</code>
+ </p>
+ </Widget>
+ </td>
+ <td className="p-4" colSpan={1}>
+ <Widget name="TLS version" icon="policy">
+ <p>
+ <code className="font-medium text-type-0">{data.tlsVersion}</code>
+ </p>
+ </Widget>
+ </td>
+ </tr>
+ <tr>
+ <td className="p-4" colSpan={2}>
+ <Widget name="Browser request priority" icon="sort">
+ <p>
+ {data.requestPriority ? <code className="font-medium text-type-0">{data.requestPriority}</code> : "Unknown"}
</p>
</Widget>
</td>
diff --git a/src/app/tools.ts b/src/app/tools.ts
index c6b4fa6..229ada9 100644
--- a/src/app/tools.ts
+++ b/src/app/tools.ts
@@ -31,7 +31,7 @@
{ name: "IP address", desc: "Get information about your public network", icon: "travel_explore", id: "ip" },
{ name: "User agent", desc: "Get information about your device and browser", icon: "devices", id: "ua" },
{ name: "Browser HTTP request", desc: "Show all the data your browser sends to load websites", icon: "swap_vert", id: "http" },
- // { name: "Route and connection", desc: "Get information about your network connection", icon: "cable", id: "connection" },
+ { name: "Connection", desc: "Get information about your network connection", icon: "cable", id: "connection" },
// { name: "Query public DNS", desc: "Resolve DNS names with public resolvers", icon: "dns", id: "dns" },
// { name: "Analyze email message", desc: "Analyze an email message's route and data", icon: "email", id: "mha" },
...hqTools
diff --git a/src/app/util/connection/connectionStats.ts b/src/app/util/connection/connectionStats.ts
index f14fb9f..b5c0374 100644
--- a/src/app/util/connection/connectionStats.ts
+++ b/src/app/util/connection/connectionStats.ts
@@ -1,7 +1,4 @@
-export type ConnectionProps = {
- lat?: string;
- lon?: string;
-} & Pick<
+export type ConnectionProps = Pick<
IncomingRequestCfProperties,
"colo"
| "clientTcpRtt"
@@ -11,15 +8,7 @@
>;
export default async function getConnectionProps(request: Request, cf: IncomingRequestCfProperties): Promise<ConnectionProps> {
- let lat, lon;
- if ("latitude" in cf) {
- lat = cf.latitude;
- lon = cf.longitude;
- }
-
return {
- lat,
- lon,
colo: cf.colo,
clientTcpRtt: cf.clientTcpRtt,
tlsCipher: cf.tlsCipher,