Reworks REST API to return i18n success/error messages

Implements #4300
This commit is contained in:
Simone Mainardi 2020-08-17 19:18:13 +02:00
parent 398e25c022
commit 16db3cda67
34 changed files with 175 additions and 171 deletions

View file

@ -23,12 +23,12 @@ local rest_utils = require("rest_utils")
sendHTTPHeader('application/json')
if not isAllowedSystemInterface() then
rc = rest_utils.consts_not_granted
rc = rest_utils.consts.err.not_granted
print(rest_utils.rc(rc))
return
end
local rc = rest_utils.consts_ok
local rc = rest_utils.consts.success.ok
local res = system_utils.systemHostStats()
res.epoch = os.time()
res.storage = storage_utils.storageInfo()