return swap listing in the disk route

This commit is contained in:
Girish Ramakrishnan
2022-11-04 15:09:37 +01:00
parent c4c90cfaf9
commit 549cb92ce7
8 changed files with 50 additions and 20 deletions

View File

@@ -167,10 +167,13 @@ async function getConfig(req, res, next) {
}
async function getDisks(req, res, next) {
const [error, result] = await safe(system.getDisks());
if (error) return next(BoxError.toHttpError(error));
const [getDisksError, disks] = await safe(system.getDisks());
if (getDisksError) return next(BoxError.toHttpError(getDisksError));
next(new HttpSuccess(200, { disks: result }));
let [getSwapsError, swaps] = await safe(system.getSwaps());
if (getSwapsError) return next(BoxError.toHttpError(getSwapsError));
next(new HttpSuccess(200, { disks, swaps }));
}
async function getDiskUsage(req, res, next) {