feat: add confirmation modal for vm soft reboot and restart (#327)

* feat: add confirmation for vm softreboot and restart

Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com>

* refactor: update wordings

Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com>

* feat: handle bulk action

Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com>

---------

Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com>
This commit is contained in:
Yiya Chen
2025-06-06 12:27:15 +08:00
committed by GitHub
parent 29b1ab2fb9
commit feddcd247a
2 changed files with 27 additions and 13 deletions
@@ -131,11 +131,12 @@ export default class VirtVm extends HarvesterResource {
label: this.t('harvester.action.unpause')
},
{
action: 'restartVM',
enabled: !!this.actions?.restart,
icon: 'icon icon-refresh',
label: this.t('harvester.action.restart'),
bulkable: true
action: 'restartVM',
enabled: !!this.actions?.restart,
icon: 'icon icon-refresh',
label: this.t('harvester.action.restart'),
bulkable: true,
bulkAction: 'restartVM'
},
{
action: 'softrebootVM',
@@ -312,12 +313,22 @@ export default class VirtVm extends HarvesterResource {
this.metadata.annotations[HCI_ANNOTATIONS.VOLUME_CLAIM_TEMPLATE] = JSON.stringify(deleteDataSource);
}
restartVM() {
this.doActionGrowl('restart', {});
restartVM(resources = this) {
this.$dispatch('promptModal', {
resources,
action: 'restart',
warningMessageKey: 'dialog.confirmExecution.restart.message',
component: 'ConfirmExecutionDialog'
});
}
softrebootVM() {
this.doActionGrowl('softreboot', {});
softrebootVM(resources = this) {
this.$dispatch('promptModal', {
resources,
action: 'softreboot',
warningMessageKey: 'dialog.confirmExecution.softreboot.message',
component: 'ConfirmExecutionDialog'
});
}
openLogs() {