Removing WROLPi admin functionality that is now in Controller.
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Controller Tests / controller-tests (push) Has been cancelled
Jest Tests / jest-tests (push) Has been cancelled

This commit is contained in:
Roland 2025-12-19 17:40:43 -07:00
parent 7183cf5e85
commit 78251b067e
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
15 changed files with 159 additions and 1332 deletions

View file

@ -1640,21 +1640,31 @@ export async function deleteOutdatedZims() {
}
export async function postShutdown() {
const response = await apiPost(`${API_URI}/shutdown`);
if (response.status !== 204) {
// Return the error.
return await response.json();
// Call Controller directly for system shutdown
const {shutdownSystem} = await import('./api/controller');
try {
const result = await shutdownSystem();
if (result.success) {
return null; // Success
}
return {code: 'SHUTDOWN_FAILED', error: result.error};
} catch (e) {
return {code: 'SHUTDOWN_FAILED', error: e.message};
}
return null
}
export async function postRestart() {
const response = await apiPost(`${API_URI}/restart`);
if (response.status !== 204) {
// Return the error.
return await response.json();
// Call Controller directly for system reboot
const {rebootSystem} = await import('./api/controller');
try {
const result = await rebootSystem();
if (result.success) {
return null; // Success
}
return {code: 'SHUTDOWN_FAILED', error: result.error};
} catch (e) {
return {code: 'SHUTDOWN_FAILED', error: e.message};
}
return null
}
export async function postVideoFileFormat(video_file_format) {