Skip to content

Commit 3aabedd

Browse files
authored
UI: Proper explanation for the global setting to avoid ambiguity (#10042)
1 parent b92fd17 commit 3aabedd

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,7 @@ private void processHostHealthCheckResult(Boolean hostHealthCheckResult, long ho
13991399
}
14001400
if (!BooleanUtils.toBoolean(EnableKVMAutoEnableDisable.valueIn(host.getClusterId()))) {
14011401
logger.debug("{} is disabled for the cluster {}, cannot process the health check result " +
1402-
"received for the host {}", EnableKVMAutoEnableDisable.key(), host.getClusterId(), host);
1402+
"received for {}", EnableKVMAutoEnableDisable.key(), host.getClusterId(), host);
14031403
return;
14041404
}
14051405

server/src/main/java/com/cloud/resource/ResourceManagerImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1840,9 +1840,9 @@ private void handleAutoEnableDisableKVMHost(boolean autoEnableDisableKVMSetting,
18401840
_hostDetailsDao.update(hostDetail.getId(), hostDetail);
18411841
} else if (!isUpdateFromHostHealthCheck && hostDetail != null &&
18421842
Boolean.parseBoolean(hostDetail.getValue()) && resourceEvent == ResourceState.Event.Disable) {
1843-
logger.info(String.format("The setting %s is enabled but the host %s is manually set into %s state," +
1843+
logger.info("The setting {} is enabled but {} is manually set into {} state," +
18441844
"ignoring future auto enabling of the host based on health check results",
1845-
AgentManager.EnableKVMAutoEnableDisable.key(), host.getName(), resourceEvent));
1845+
AgentManager.EnableKVMAutoEnableDisable.key(), host, resourceEvent);
18461846
hostDetail.setValue(Boolean.FALSE.toString());
18471847
_hostDetailsDao.update(hostDetail.getId(), hostDetail);
18481848
} else if (hostDetail == null) {

ui/src/views/infra/HostEnableDisable.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@
2828
>
2929
<a-alert type="warning">
3030
<template #message>
31-
<span v-html="$t('message.confirm.enable.host')" />
31+
<span v-html="resourcestate === 'Disabled' ? $t('message.confirm.enable.host') : $t('message.confirm.disable.host') " />
3232
</template>
3333
</a-alert>
34-
<div v-show="enableKVMAutoEnableDisableSetting" class="reason">
34+
<div v-show="kvmAutoEnableDisableSetting" class="reason">
3535
<a-form-item
3636
class="form__item"
3737
name="reason"
3838
ref="reason"
39-
:label="'The setting \'enable.kvm.host.auto.enable.disable\' is enabled, ' +
39+
:label="'The Auto Enable/Disable KVM Hosts functionality is enabled, ' +
4040
' can specify a reason for ' + (resourcestate === 'Enabled' ? 'disabling' : 'enabling') + ' this host'">
4141
<a-textarea
4242
v-model:value="form.reason"
@@ -69,7 +69,7 @@ export default {
6969
return {
7070
resourcestate: '',
7171
allocationstate: '',
72-
enableKVMAutoEnableDisableSetting: false
72+
kvmAutoEnableDisableSetting: false
7373
}
7474
},
7575
created () {
@@ -91,8 +91,8 @@ export default {
9191
return
9292
}
9393
api('listConfigurations', { name: 'enable.kvm.host.auto.enable.disable', clusterid: this.resource.clusterid }).then(json => {
94-
if (json.listconfigurationsresponse.configuration[0]) {
95-
this.enableKVMAutoEnableDisableSetting = json.listconfigurationsresponse.configuration[0].value
94+
if (json.listconfigurationsresponse.configuration?.[0]) {
95+
this.kvmAutoEnableDisableSetting = json?.listconfigurationsresponse?.configuration?.[0]?.value || false
9696
}
9797
})
9898
},

0 commit comments

Comments
 (0)