Add live hotspot network diagnostics
This commit is contained in:
@@ -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" }));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user