Skip to content

Commit 275b1ca

Browse files
Pearl1594dhslove
authored andcommitted
UI: Proper explanation for the global setting to avoid ambiguity (apache#10042)
1 parent 6ce0462 commit 275b1ca

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
@@ -1484,7 +1484,7 @@ private void processHostHealthCheckResult(Boolean hostHealthCheckResult, long ho
14841484
}
14851485
if (!BooleanUtils.toBoolean(EnableKVMAutoEnableDisable.valueIn(host.getClusterId()))) {
14861486
logger.debug("{} is disabled for the cluster {}, cannot process the health check result " +
1487-
"received for the host {}", EnableKVMAutoEnableDisable.key(), host.getClusterId(), host);
1487+
"received for {}", EnableKVMAutoEnableDisable.key(), host.getClusterId(), host);
14881488
return;
14891489
}
14901490

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1854,9 +1854,9 @@ private void handleAutoEnableDisableKVMHost(boolean autoEnableDisableKVMSetting,
18541854
_hostDetailsDao.update(hostDetail.getId(), hostDetail);
18551855
} else if (!isUpdateFromHostHealthCheck && hostDetail != null &&
18561856
Boolean.parseBoolean(hostDetail.getValue()) && resourceEvent == ResourceState.Event.Disable) {
1857-
logger.info(String.format("The setting %s is enabled but the host %s is manually set into %s state," +
1857+
logger.info("The setting {} is enabled but {} is manually set into {} state," +
18581858
"ignoring future auto enabling of the host based on health check results",
1859-
AgentManager.EnableKVMAutoEnableDisable.key(), host.getName(), resourceEvent));
1859+
AgentManager.EnableKVMAutoEnableDisable.key(), host, resourceEvent);
18601860
hostDetail.setValue(Boolean.FALSE.toString());
18611861
_hostDetailsDao.update(hostDetail.getId(), hostDetail);
18621862
} 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)