mirror of
https://codeberg.org/PLG-Development/PLG-MuDiCS
synced 2026-07-06 00:47:09 +00:00
chore(control): return request result in power apis
This commit is contained in:
@@ -293,12 +293,12 @@ async function run_shell_command(ip: string, command: string): Promise<RequestRe
|
|||||||
return await request_display(ip, '/shellCommand', options);
|
return await request_display(ip, '/shellCommand', options);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function shutdown(ip: string): Promise<void> {
|
export async function shutdown(ip: string): Promise<RequestResponse> {
|
||||||
await run_shell_command(ip, 'shutdown -h now');
|
return await run_shell_command(ip, 'shutdown -h now');
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function startup(mac: string): Promise<void> {
|
export async function startup(mac: string): Promise<RequestResponse> {
|
||||||
await request_control(`/wakeOnLan`, {
|
return await request_control(`/wakeOnLan`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'content-type': 'application/json' },
|
headers: { 'content-type': 'application/json' },
|
||||||
body: JSON.stringify({ mac_address: mac })
|
body: JSON.stringify({ mac_address: mac })
|
||||||
|
|||||||
Reference in New Issue
Block a user