feat(xo-web/forgetSR): improve the modal window message

This commit is contained in:
Pizzosaure
2023-11-03 15:02:07 +01:00
parent 86b86c5c99
commit 637eb1d2d7
2 changed files with 22 additions and 6 deletions

View File

@@ -2372,9 +2372,9 @@ const messages = {
'This will disconnect each selected SR from its host (local SR) or from every hosts of its pool (shared SR).',
srForgetModalTitle: 'Forget SR',
srsForgetModalTitle: 'Forget selected SRs',
srForgetModalMessage: "Are you sure you want to forget this SR? VDIs on this storage won't be removed.",
srForgetModalMessage: "Are you sure you want to forget this SR? You will lose all the metadata for it, meaning all the links between the VDIs (disks) and their respective VMs. This operation cannot be undone.",
srsForgetModalMessage:
"Are you sure you want to forget all the selected SRs? VDIs on these storages won't be removed.",
"Are you sure you want to forget {nPbds, number} SR{nPbds, plural, one {} other {s}}? You will lose all the metadata for it, meaning all the links between the VDIs (disks) and their respective VMs. This operation cannot be undone.",
srAllDisconnected: 'Disconnected',
srSomeConnected: 'Partially connected',
srAllConnected: 'Connected',

View File

@@ -2268,15 +2268,31 @@ export const deleteSr = sr =>
export const fetchSrStats = (sr, granularity) => _call('sr.stats', { id: resolveId(sr), granularity })
export const forgetSr = sr =>
export const forgetSr = sr => {
confirm({
title: _('srForgetModalTitle'),
body: _('srForgetModalMessage'),
}).then(() => _call('sr.forget', { id: resolveId(sr) }), noop)
body: (
<div className='text-warning'>
<p className='font-weight-bold'>{_('srForgetModalMessage')}</p>
</div>
),
strongConfirm: {
messageId: 'srForget',
},
}).then(() => _call('sr.forget', { id: resolveId(sr) }), noop);
};
export const forgetSrs = srs =>
confirm({
title: _('srsForgetModalTitle'),
body: _('srsForgetModalMessage'),
body: (
<div className='text-warning'>
<p className='font-weight-bold'>{_('srsForgetModalMessage')}</p>
</div>
),
strongConfirm: {
messageId: 'srsForget',
},
}).then(() => Promise.all(map(resolveIds(srs), id => _call('sr.forget', { id }))), noop)
export const reconnectAllHostsSr = sr =>