Can configure network autostart

This commit is contained in:
2023-12-06 19:10:25 +01:00
parent 23f2029deb
commit 8b53875349
7 changed files with 143 additions and 22 deletions

View File

@ -95,6 +95,29 @@ export class NetworkApi {
});
}
/**
* Check if autostart is enabled on a network
*/
static async IsAutostart(net: NetworkInfo): Promise<boolean> {
return (
await APIClient.exec({
uri: `/network/${net.uuid}/autostart`,
method: "GET",
})
).data.autostart;
}
/**
* Set autostart status of a network
*/
static async SetAutostart(net: NetworkInfo, enabled: boolean): Promise<void> {
await APIClient.exec({
uri: `/network/${net.uuid}/autostart`,
method: "PUT",
jsonData: { autostart: enabled },
});
}
/**
* Update an existing network
*/