mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-08 21:17:43 +03:00
M #-: Add default zone in federation (#2433)
This commit is contained in:
parent
18f9137de2
commit
4f71e1f266
@ -42,3 +42,9 @@ debug_level: 2
|
||||
guacd:
|
||||
port: 4822
|
||||
host: 'localhost'
|
||||
|
||||
# Local zone in a Federation setup
|
||||
# This attribute must point to the Zone ID of the local OpenNebula to which this FireEdge belongs to.
|
||||
default_zone:
|
||||
id: 0
|
||||
name: OpenNebula
|
@ -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,13 @@ 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
|
||||
|
Loading…
Reference in New Issue
Block a user