move platform status into services
This commit is contained in:
@@ -6,8 +6,6 @@ exports = module.exports = {
|
||||
updateDashboardDomain,
|
||||
prepareDashboardDomain,
|
||||
|
||||
getPlatformStatus,
|
||||
|
||||
listLanguages,
|
||||
getLanguage,
|
||||
setLanguage,
|
||||
@@ -22,7 +20,6 @@ const assert = require('assert'),
|
||||
cloudron = require('../cloudron.js'),
|
||||
HttpError = require('connect-lastmile').HttpError,
|
||||
HttpSuccess = require('connect-lastmile').HttpSuccess,
|
||||
platform = require('../platform.js'),
|
||||
safe = require('safetydance'),
|
||||
translation = require('../translation.js');
|
||||
|
||||
@@ -58,10 +55,6 @@ async function listLanguages(req, res, next) {
|
||||
next(new HttpSuccess(200, { languages }));
|
||||
}
|
||||
|
||||
async function getPlatformStatus(req, res, next) {
|
||||
next(new HttpSuccess(200, platform.getStatus()));
|
||||
}
|
||||
|
||||
async function getTimeZone(req, res, next) {
|
||||
const [error, timeZone] = await safe(cloudron.getTimeZone());
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
@@ -8,7 +8,8 @@ exports = module.exports = {
|
||||
getLogStream,
|
||||
restart,
|
||||
rebuild,
|
||||
getGraphs
|
||||
getGraphs,
|
||||
getPlatformStatus
|
||||
};
|
||||
|
||||
const assert = require('assert'),
|
||||
@@ -17,6 +18,7 @@ const assert = require('assert'),
|
||||
graphs = require('../graphs.js'),
|
||||
HttpError = require('connect-lastmile').HttpError,
|
||||
HttpSuccess = require('connect-lastmile').HttpSuccess,
|
||||
platform = require('../platform.js'),
|
||||
safe = require('safetydance'),
|
||||
services = require('../services.js');
|
||||
|
||||
@@ -146,3 +148,7 @@ async function getGraphs(req, res, next) {
|
||||
|
||||
next(new HttpSuccess(200, result));
|
||||
}
|
||||
|
||||
async function getPlatformStatus(req, res, next) {
|
||||
next(new HttpSuccess(200, platform.getStatus()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user