Creating shutdown and restart buttons.

This commit is contained in:
Roland 2023-08-17 20:07:02 -06:00
parent 9dbd43cfdd
commit 2537017039
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
11 changed files with 198 additions and 14 deletions

View file

@ -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
}