mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
(cherry picked from commit fae6bcc92ff5c3f4fceefaa32a3f40f7a9d34eb9)
This commit is contained in:
parent
1f21b0040b
commit
ad03f736af
@ -51,6 +51,6 @@ export const systemService = {
|
||||
|
||||
if (!res?.id || res?.id !== httpCodes.ok.id) throw res?.data
|
||||
|
||||
return res?.data?.OPENNEBULA_CONFIGURATION
|
||||
return res?.data
|
||||
},
|
||||
}
|
||||
|
@ -27,6 +27,15 @@ const { defaultEmptyFunction, httpMethod } = defaults
|
||||
const { ok, internalServerError, badRequest } = httpCodes
|
||||
const { GET } = httpMethod
|
||||
|
||||
const ALLOWED_KEYS_ONED_CONF = [
|
||||
'DEFAULT_COST',
|
||||
'DS_MAD_CONF',
|
||||
'MARKET_MAD_CONF',
|
||||
'VM_MAD',
|
||||
'IM_MAD',
|
||||
'AUTH_MAD',
|
||||
]
|
||||
|
||||
/**
|
||||
* Get system config.
|
||||
*
|
||||
@ -79,7 +88,16 @@ const getConfig = (
|
||||
|
||||
return
|
||||
}
|
||||
res.locals.httpCode = httpResponse(ok, value)
|
||||
|
||||
const filterData = {}
|
||||
Object.entries(value.OPENNEBULA_CONFIGURATION).forEach(
|
||||
([keyOned, valueOned]) => {
|
||||
if (ALLOWED_KEYS_ONED_CONF.includes(keyOned)) {
|
||||
filterData[keyOned] = valueOned
|
||||
}
|
||||
}
|
||||
)
|
||||
res.locals.httpCode = httpResponse(ok, filterData)
|
||||
next()
|
||||
}
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user