mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-02 12:56:24 -05:00
Creating shutdown and restart buttons.
This commit is contained in:
parent
9dbd43cfdd
commit
2537017039
11 changed files with 198 additions and 14 deletions
|
|
@ -1024,7 +1024,20 @@ export async function deleteOutdatedZims() {
|
|||
return response.status === 204;
|
||||
}
|
||||
|
||||
export async function ignoreOutdatedZims() {
|
||||
const response = await apiPost(`${API_URI}/zim/outdated`);
|
||||
return response.status === 204;
|
||||
}
|
||||
export async function postShutdown() {
|
||||
const response = await apiPost(`${API_URI}/shutdown`);
|
||||
if (response.status !== 204) {
|
||||
// Return the error.
|
||||
return await response.json();
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
export async function postRestart() {
|
||||
const response = await apiPost(`${API_URI}/restart`);
|
||||
if (response.status !== 204) {
|
||||
// Return the error.
|
||||
return await response.json();
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue