Display basic device information
This commit is contained in:
@ -37,8 +37,8 @@ export interface Device {
|
||||
relays: DeviceRelay[];
|
||||
}
|
||||
|
||||
export function DeviceURL(d: Device, edit: boolean = false): string {
|
||||
return `/dev/${d.id}${edit ? "/edit" : ""}`;
|
||||
export function DeviceURL(d: Device): string {
|
||||
return `/dev/${encodeURIComponent(d.id)}`;
|
||||
}
|
||||
|
||||
export class DeviceApi {
|
||||
@ -76,6 +76,18 @@ export class DeviceApi {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the information about a single device
|
||||
*/
|
||||
static async GetSingle(id: string): Promise<Device> {
|
||||
return (
|
||||
await APIClient.exec({
|
||||
uri: `/device/${encodeURIComponent(id)}`,
|
||||
method: "GET",
|
||||
})
|
||||
).data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a device
|
||||
*/
|
||||
|
Reference in New Issue
Block a user