feat(xo-web): add warning on restoring metadata backup (#5769)

See xoa-support#3691
This commit is contained in:
badrAZ 2021-05-07 13:47:47 +02:00 committed by GitHub
parent 6d0f479f81
commit 2076141f47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 0 deletions

View File

@ -7,6 +7,8 @@
> Users must be able to say: “Nice enhancement, I'm eager to test it”
- [Metadata Backup] Add a warning on restoring a metadata backup (PR [#5769](https://github.com/vatesfr/xen-orchestra/pull/5769))
### Bug fixes
> Users must be able to say: “I had this issue, happy to know it's fixed”
@ -29,3 +31,4 @@
> In case of conflict, the highest (lowest in previous list) `$version` wins.
- xo-server-backup-reports patch
- xo-web minor

View File

@ -1581,6 +1581,8 @@ const messages = {
restoreVmBackupsBulkTitle: 'Restore {nVms, number} VM{nVms, plural, one {} other {s}}',
restoreVmBackupsBulkMessage:
'Restore {nVms, number} VM{nVms, plural, one {} other {s}} from {nVms, plural, one {its} other {their}} {oldestOrLatest} backup.',
restoreMetadataBackupWarning:
'This operation will overwrite the host metadata. Only perform a metadata restore if it is a new server with nothing running on it.',
oldest: 'oldest',
latest: 'latest',
restoreVmBackupsStart: 'Start VM{nVms, plural, one {} other {s}} after restore',

View File

@ -1,5 +1,6 @@
import _ from 'intl'
import Component from 'base-component'
import Icon from 'icon'
import PropTypes from 'prop-types'
import React from 'react'
import SingleLineRow from 'single-line-row'
@ -8,6 +9,12 @@ import { Container, Col } from 'grid'
import { FormattedDate } from 'react-intl'
import { Select } from 'form'
const restorationWarning = (
<p className='text-warning mt-1'>
<Icon icon='alarm' /> {_('restoreMetadataBackupWarning')}
</p>
)
export default class RestoreMetadataBackupModalBody extends Component {
static propTypes = {
backups: PropTypes.array,
@ -46,6 +53,7 @@ export default class RestoreMetadataBackupModalBody extends Component {
/>
</Col>
</SingleLineRow>
<SingleLineRow>{restorationWarning}</SingleLineRow>
</Container>
)
}
@ -76,6 +84,7 @@ export class RestoreMetadataBackupsBulkModalBody extends Component {
/>
),
})}
{restorationWarning}
</div>
)
}