committed by
Julien Fontanet
parent
102e629e16
commit
e253657770
@@ -1166,6 +1166,9 @@ const messages = {
|
||||
restartVmModalMessage: 'Are you sure you want to restart {name}?',
|
||||
stopVmModalTitle: 'Stop VM',
|
||||
stopVmModalMessage: 'Are you sure you want to stop {name}?',
|
||||
suspendVmsModalTitle: 'Suspend VM{vms, plural, one {} other {s}}',
|
||||
suspendVmsModalMessage:
|
||||
'Are you sure you want to suspend {vms, number} VM{vms, plural, one {} other {s}}?',
|
||||
restartVmsModalTitle: 'Restart VM{vms, plural, one {} other {s}}',
|
||||
restartVmsModalMessage:
|
||||
'Are you sure you want to restart {vms, number} VM{vms, plural, one {} other {s}}?',
|
||||
|
||||
@@ -841,6 +841,16 @@ export const stopVms = (vms, force = false) =>
|
||||
|
||||
export const suspendVm = vm => _call('vm.suspend', { id: resolveId(vm) })
|
||||
|
||||
export const suspendVms = vms =>
|
||||
confirm({
|
||||
title: _('suspendVmsModalTitle', { nVms: vms.length }),
|
||||
body: _('suspendVmsModalMessage', { nVms: vms.length }),
|
||||
}).then(
|
||||
() =>
|
||||
Promise.all(map(vms, vm => _call('vm.suspend', { id: resolveId(vm) }))),
|
||||
noop
|
||||
)
|
||||
|
||||
export const resumeVm = vm => _call('vm.resume', { id: resolveId(vm) })
|
||||
|
||||
export const recoveryStartVm = vm =>
|
||||
|
||||
@@ -54,6 +54,7 @@ import {
|
||||
stopVms,
|
||||
subscribeResourceSets,
|
||||
subscribeServers,
|
||||
suspendVms,
|
||||
} from 'xo'
|
||||
import { Container, Row, Col } from 'grid'
|
||||
import {
|
||||
@@ -137,6 +138,11 @@ const OPTIONS = {
|
||||
{ handler: copyVms, icon: 'vm-copy', tooltip: _('copyVmLabel') },
|
||||
],
|
||||
otherActions: [
|
||||
{
|
||||
handler: suspendVms,
|
||||
icon: 'vm-suspend',
|
||||
labelId: 'suspendVmLabel',
|
||||
},
|
||||
{
|
||||
handler: restartVms,
|
||||
icon: 'vm-force-reboot',
|
||||
|
||||
Reference in New Issue
Block a user