Add live hotspot network diagnostics

This commit is contained in:
2026-07-31 21:01:02 +02:00
parent d1239d66af
commit 37e2cb154e
19 changed files with 490 additions and 11 deletions
+15
View File
@@ -89,6 +89,17 @@ export type NetworkAdapterStatus = {
address: string | null;
};
export type NetworkActivity = {
supported: boolean;
collectedAt: string;
clients: Array<{ ipAddress: string; macAddress: string; hostname: string | null; leaseExpiresAt: string | null; state: string; connected: boolean }>;
dnsQueries: Array<{ timestamp: string; clientAddress: string; type: string; name: string }>;
flows: Array<{ protocol: "tcp" | "udp"; state: string; sourceAddress: string; sourcePort: number; destinationAddress: string; destinationPort: number; packets: number | null; bytes: number | null }>;
dnsAvailable: boolean;
flowsAvailable: boolean;
messages: string[];
};
type ErrorResponse = { error?: { code?: string; message?: string } };
export class ApiError extends Error {
@@ -135,3 +146,7 @@ export async function getUpdateStatus(): Promise<UpdateStatus> {
export async function getNetworkStatus(): Promise<NetworkStatus> {
return parseResponse<NetworkStatus>(await fetch("/api/network", { credentials: "same-origin" }));
}
export async function getNetworkActivity(): Promise<NetworkActivity> {
return parseResponse<NetworkActivity>(await fetch("/api/network/activity", { credentials: "same-origin" }));
}