feat(xo-web): confirm modal before host emergency shutdown (#2714)
Fixes #2230
This commit is contained in:
parent
0c3b98d451
commit
efaabb02e8
@ -1163,6 +1163,9 @@ const messages = {
|
||||
restoreFilesUnselectAll: 'Unselect all files',
|
||||
|
||||
// ----- Modals -----
|
||||
emergencyShutdownHostModalTitle: 'Emergency shutdown Host',
|
||||
emergencyShutdownHostModalMessage:
|
||||
'Are you sure you want to shutdown {host}?',
|
||||
emergencyShutdownHostsModalTitle:
|
||||
'Emergency shutdown Host{nHosts, plural, one {} other {s}}',
|
||||
emergencyShutdownHostsModalMessage:
|
||||
|
@ -656,7 +656,12 @@ export const getHostMissingPatches = host =>
|
||||
)
|
||||
|
||||
export const emergencyShutdownHost = host =>
|
||||
_call('host.emergencyShutdownHost', { host: resolveId(host) })
|
||||
confirm({
|
||||
title: _('emergencyShutdownHostModalTitle'),
|
||||
body: _('emergencyShutdownHostModalMessage', {
|
||||
host: <strong>{host.name_label}</strong>,
|
||||
}),
|
||||
}).then(() => _call('host.emergencyShutdownHost', { host: resolveId(host) }))
|
||||
|
||||
export const emergencyShutdownHosts = hosts => {
|
||||
const nHosts = size(hosts)
|
||||
|
Loading…
Reference in New Issue
Block a user