Add dashboard Bluetooth controls
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user