From 5e3f12de35b4a2e132107e50422efb52a812b098 Mon Sep 17 00:00:00 2001 From: Andy Lee Date: Wed, 17 Jun 2026 13:55:01 +0800 Subject: [PATCH] feat: clear selected VM after doing bulk action (#929) * feat: clear selected VM rows after click bulk action Signed-off-by: Andy Lee * refactor: await altStopVM action Signed-off-by: Andy Lee * refactor: multiple VM start actions Signed-off-by: Andy Lee * refactor: modify altRestartVM() Signed-off-by: Andy Lee --------- Signed-off-by: Andy Lee --- .../dialog/ConfirmExecutionDialog.vue | 6 +-- .../dialog/HarvesterMigrationDialog.vue | 6 +-- .../list/kubevirt.io.virtualmachine.vue | 11 +++++ .../models/kubevirt.io.virtualmachine.js | 49 +++++++++++++------ .../kubevirt.io.virtualmachine.vue | 1 + 5 files changed, 52 insertions(+), 21 deletions(-) diff --git a/pkg/harvester/dialog/ConfirmExecutionDialog.vue b/pkg/harvester/dialog/ConfirmExecutionDialog.vue index 9099b7da..b4c00b5a 100644 --- a/pkg/harvester/dialog/ConfirmExecutionDialog.vue +++ b/pkg/harvester/dialog/ConfirmExecutionDialog.vue @@ -98,9 +98,9 @@ export default { methods: { escapeHtml, - close() { + close(data) { this.errors = []; - this.$emit('close'); + this.$emit('close', data); }, async apply(buttonDone) { @@ -109,7 +109,7 @@ export default { await resource.doActionGrowl(this.modalData.action, {}); } buttonDone(true); - this.close(); + this.close({ performCallback: true, clearTableSelection: true }); } catch (e) { this.errors = exceptionToErrorsArray(e); buttonDone(false); diff --git a/pkg/harvester/dialog/HarvesterMigrationDialog.vue b/pkg/harvester/dialog/HarvesterMigrationDialog.vue index 439cf1c8..a7505474 100644 --- a/pkg/harvester/dialog/HarvesterMigrationDialog.vue +++ b/pkg/harvester/dialog/HarvesterMigrationDialog.vue @@ -117,10 +117,10 @@ export default { }, methods: { - close() { + close(data) { this.nodeName = ''; this.errors = []; - this.$emit('close'); + this.$emit('close', data); }, async apply(buttonDone) { @@ -166,7 +166,7 @@ export default { } buttonDone(true); - this.close(); + this.close({ performCallback: true, clearTableSelection: true }); } catch (err) { const error = err?.data || err; const message = exceptionToErrorsArray(error); diff --git a/pkg/harvester/list/kubevirt.io.virtualmachine.vue b/pkg/harvester/list/kubevirt.io.virtualmachine.vue index e6c7c847..367de113 100644 --- a/pkg/harvester/list/kubevirt.io.virtualmachine.vue +++ b/pkg/harvester/list/kubevirt.io.virtualmachine.vue @@ -1,4 +1,5 @@