feat: clear selected VM after doing bulk action (#929)

* feat: clear selected VM rows after click bulk action

Signed-off-by: Andy Lee <andy.lee@suse.com>

* refactor: await altStopVM action

Signed-off-by: Andy Lee <andy.lee@suse.com>

* refactor: multiple VM start actions

Signed-off-by: Andy Lee <andy.lee@suse.com>

* refactor: modify altRestartVM()

Signed-off-by: Andy Lee <andy.lee@suse.com>

---------

Signed-off-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
Andy Lee
2026-06-17 13:55:01 +08:00
committed by GitHub
parent f115261889
commit 5e3f12de35
5 changed files with 52 additions and 21 deletions
@@ -1,4 +1,5 @@
<script>
import { mapGetters } from 'vuex';
import ResourceTable from '@shell/components/ResourceTable';
import { STATE, AGE, NAME, NAMESPACE } from '@shell/config/table-headers';
import {
@@ -116,6 +117,8 @@ export default {
},
computed: {
...mapGetters({ actionCb: 'action-menu/performCallbackData' }),
headers() {
const restoreCol = {
name: 'restoreProgress',
@@ -182,6 +185,13 @@ export default {
},
watch: {
actionCb(neu) {
if (neu?.clearTableSelection) {
this.$refs.resourceTable.clearSelection();
this.$store.dispatch('action-menu/clearCallbackData');
}
},
vmRestartRequiredNames(vmNames) {
const count = vmNames.length;
@@ -220,6 +230,7 @@ export default {
<Loading v-if="$fetchState.pending" />
<div v-else>
<ResourceTable
ref="resourceTable"
v-bind="$attrs"
:headers="headers"
default-sort-by="age"