This is an automated email from the ASF dual-hosted git repository.
dahn pushed a commit to branch 4.20
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/4.20 by this push:
new 3aabedd4473 UI: Proper explanation for the global setting to avoid
ambiguity (#10042)
3aabedd4473 is described below
commit 3aabedd4473271b9bec3e5fa1f0c007b48274bb1
Author: Pearl Dsilva <[email protected]>
AuthorDate: Tue Mar 4 09:07:43 2025 -0500
UI: Proper explanation for the global setting to avoid ambiguity (#10042)
---
.../main/java/com/cloud/agent/manager/AgentManagerImpl.java | 2 +-
.../main/java/com/cloud/resource/ResourceManagerImpl.java | 4 ++--
ui/src/views/infra/HostEnableDisable.vue | 12 ++++++------
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git
a/engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java
b/engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java
index 1ab3b7ff892..592d4567805 100644
---
a/engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java
+++
b/engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java
@@ -1399,7 +1399,7 @@ public class AgentManagerImpl extends ManagerBase
implements AgentManager, Handl
}
if
(!BooleanUtils.toBoolean(EnableKVMAutoEnableDisable.valueIn(host.getClusterId())))
{
logger.debug("{} is disabled for the cluster {}, cannot
process the health check result " +
- "received for the host {}",
EnableKVMAutoEnableDisable.key(), host.getClusterId(), host);
+ "received for {}", EnableKVMAutoEnableDisable.key(),
host.getClusterId(), host);
return;
}
diff --git a/server/src/main/java/com/cloud/resource/ResourceManagerImpl.java
b/server/src/main/java/com/cloud/resource/ResourceManagerImpl.java
index c9ba51ce5a6..7428475231d 100755
--- a/server/src/main/java/com/cloud/resource/ResourceManagerImpl.java
+++ b/server/src/main/java/com/cloud/resource/ResourceManagerImpl.java
@@ -1840,9 +1840,9 @@ public class ResourceManagerImpl extends ManagerBase
implements ResourceManager,
_hostDetailsDao.update(hostDetail.getId(), hostDetail);
} else if (!isUpdateFromHostHealthCheck && hostDetail != null &&
Boolean.parseBoolean(hostDetail.getValue()) &&
resourceEvent == ResourceState.Event.Disable) {
- logger.info(String.format("The setting %s is enabled but the
host %s is manually set into %s state," +
+ logger.info("The setting {} is enabled but {} is manually set
into {} state," +
"ignoring future auto enabling of the host
based on health check results",
- AgentManager.EnableKVMAutoEnableDisable.key(),
host.getName(), resourceEvent));
+ AgentManager.EnableKVMAutoEnableDisable.key(), host,
resourceEvent);
hostDetail.setValue(Boolean.FALSE.toString());
_hostDetailsDao.update(hostDetail.getId(), hostDetail);
} else if (hostDetail == null) {
diff --git a/ui/src/views/infra/HostEnableDisable.vue
b/ui/src/views/infra/HostEnableDisable.vue
index bc71aa27080..84310a0051f 100644
--- a/ui/src/views/infra/HostEnableDisable.vue
+++ b/ui/src/views/infra/HostEnableDisable.vue
@@ -28,15 +28,15 @@
>
<a-alert type="warning">
<template #message>
- <span v-html="$t('message.confirm.enable.host')" />
+ <span v-html="resourcestate === 'Disabled' ?
$t('message.confirm.enable.host') : $t('message.confirm.disable.host') " />
</template>
</a-alert>
- <div v-show="enableKVMAutoEnableDisableSetting" class="reason">
+ <div v-show="kvmAutoEnableDisableSetting" class="reason">
<a-form-item
class="form__item"
name="reason"
ref="reason"
- :label="'The setting \'enable.kvm.host.auto.enable.disable\' is
enabled, ' +
+ :label="'The Auto Enable/Disable KVM Hosts functionality is enabled,
' +
' can specify a reason for ' + (resourcestate === 'Enabled' ?
'disabling' : 'enabling') + ' this host'">
<a-textarea
v-model:value="form.reason"
@@ -69,7 +69,7 @@ export default {
return {
resourcestate: '',
allocationstate: '',
- enableKVMAutoEnableDisableSetting: false
+ kvmAutoEnableDisableSetting: false
}
},
created () {
@@ -91,8 +91,8 @@ export default {
return
}
api('listConfigurations', { name: 'enable.kvm.host.auto.enable.disable',
clusterid: this.resource.clusterid }).then(json => {
- if (json.listconfigurationsresponse.configuration[0]) {
- this.enableKVMAutoEnableDisableSetting =
json.listconfigurationsresponse.configuration[0].value
+ if (json.listconfigurationsresponse.configuration?.[0]) {
+ this.kvmAutoEnableDisableSetting =
json?.listconfigurationsresponse?.configuration?.[0]?.value || false
}
})
},