diff --git a/pkg/harvester/dialog/HarvesterMaintenanceDialog.vue b/pkg/harvester/dialog/HarvesterMaintenanceDialog.vue
index e32e5dc877e..93c59dfe97e 100644
--- a/pkg/harvester/dialog/HarvesterMaintenanceDialog.vue
+++ b/pkg/harvester/dialog/HarvesterMaintenanceDialog.vue
@@ -6,6 +6,7 @@ import { Banner } from '@components/Banner';
import { Checkbox } from '@components/Form/Checkbox';
import { exceptionToErrorsArray } from '@shell/utils/error';
import { BadgeState } from '@components/BadgeState';
+import { ucFirst } from '@shell/utils/string';
export default {
components: {
@@ -25,9 +26,9 @@ export default {
data() {
return {
- errors: [],
- unhealthyVM: '',
- force: false
+ errors: [],
+ unhealthyVMs: [],
+ force: false
};
},
@@ -40,13 +41,15 @@ export default {
},
methods: {
+ ucFirst,
+
close() {
this.$emit('close');
},
async apply(buttonCb) {
this.errors = [];
- this.unhealthyVM = '';
+ this.unhealthyVMs = [];
try {
const res = await this.actionResource.doAction('maintenancePossible');
@@ -62,8 +65,8 @@ export default {
} else if (res._status === 200 || res._status === 204) {
const res = await this.actionResource.doAction('listUnhealthyVM');
- if (res.message) {
- this.unhealthyVM = res;
+ if (res?.length) {
+ this.unhealthyVMs = res;
buttonCb(false);
} else {
await this.actionResource.doAction('enableMaintenanceMode', { force: 'false' });
@@ -97,13 +100,17 @@ export default {
label-key="harvester.host.enableMaintenance.force"
/>
-
- {{ unhealthyVM.message }} + {{ ucFirst(unhealthyVM.message) }}