Add dashboard Bluetooth controls

This commit is contained in:
2026-07-31 23:47:20 +02:00
parent af9de7dbdf
commit 3801a91acf
14 changed files with 301 additions and 6 deletions
+12
View File
@@ -122,6 +122,14 @@ export type MobileDevice = {
revokedAt: string | null;
};
export type BluetoothStatus = {
supported: boolean;
powered: boolean;
discoverable: boolean;
pairable: boolean;
message: string;
};
export type CarTelemetry = {
available: true;
collectedAt: string;
@@ -262,6 +270,10 @@ export async function getMobileDevices(): Promise<MobileDevice[]> {
return response.devices;
}
export async function getBluetoothStatus(): Promise<BluetoothStatus> {
return parseResponse<BluetoothStatus>(await fetch("/api/mobile/bluetooth", { credentials: "same-origin" }));
}
export async function revokeMobileDevice(id: string, csrfToken: string): Promise<void> {
await parseResponse(await fetch(`/api/mobile/devices/${encodeURIComponent(id)}`, {
method: "DELETE",