mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-10-01 03:36:04 +08:00
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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user