system: return uptime and reboot required
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
exports = module.exports = {
|
||||
reboot,
|
||||
isRebootRequired,
|
||||
getInfo,
|
||||
getDisks,
|
||||
getDiskUsage,
|
||||
updateDiskUsage,
|
||||
@@ -30,11 +30,11 @@ async function reboot(req, res, next) {
|
||||
await safe(system.reboot());
|
||||
}
|
||||
|
||||
async function isRebootRequired(req, res, next) {
|
||||
const [error, rebootRequired] = await safe(system.isRebootRequired());
|
||||
async function getInfo(req, res, next) {
|
||||
const [error, info] = await safe(system.getInfo());
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(200, { rebootRequired }));
|
||||
next(new HttpSuccess(200, { info }));
|
||||
}
|
||||
|
||||
async function getDisks(req, res, next) {
|
||||
|
||||
Reference in New Issue
Block a user