1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-25 06:03:36 +03:00

M #-: Add default zone in 6.6 (#2434)

This commit is contained in:
Jorge Miguel Lobo Escalona 2023-01-05 13:51:15 +01:00 committed by GitHub
parent b13d06d7da
commit c55d969d5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -136,12 +136,13 @@ const validateSession = ({
/**
* Get Zone.
*
* @param {string} zone - zone id
* @param {string} selectedZone - zone id
* @returns {object} data zone
*/
const getZone = (zone = '0') => {
const getZone = (selectedZone) => {
// get fireedge config
const appConfig = getFireedgeConfig()
const zone = selectedZone || appConfig?.default_zone?.id || '0'
// set first zone
if (
appConfig.one_xmlrpc &&
@ -149,6 +150,9 @@ const getZone = (zone = '0') => {
defaultOpennebulaZones[0] &&
defaultOpennebulaZones[0].rpc
) {
if(appConfig.default_zone?.id && appConfig.default_zone?.name && appConfig.default_zone?.endpoint) {
defaultOpennebulaZones[0] = appConfig.default_zone
}
defaultOpennebulaZones[0].rpc = appConfig.one_xmlrpc
if (appConfig.subscriber_endpoint) {
defaultOpennebulaZones[0].zeromq = appConfig.subscriber_endpoint