feat(xo-web/backup-ng): ability to set the full backup interval (#4099)

Fixes #1783
This commit is contained in:
badrAZ 2019-03-29 11:43:37 +01:00 committed by Pierre Donias
parent 2886ec116f
commit bc14a1d167
5 changed files with 31 additions and 2 deletions

View File

@ -10,6 +10,7 @@
- [VM/Snapshots] Always delete broken quiesced snapshots [#4074](https://github.com/vatesfr/xen-orchestra/issues/4074) (PR [#4075](https://github.com/vatesfr/xen-orchestra/pull/4075))
- [Settings/Servers] Display link to pool [#4041](https://github.com/vatesfr/xen-orchestra/issues/4041) (PR [#4045](https://github.com/vatesfr/xen-orchestra/pull/4045))
- [Import] Change wording of drop zone (PR [#4020](https://github.com/vatesfr/xen-orchestra/pull/4020))
- [Backup NG] Ability to set the interval of the full backups [#1783](https://github.com/vatesfr/xen-orchestra/issues/1783) (PR [#4083](https://github.com/vatesfr/xen-orchestra/pull/4083))
### Bug fixes

View File

@ -443,6 +443,7 @@ const messages = {
offlineSnapshotInfo: 'Shutdown VMs before snapshotting them',
timeout: 'Timeout',
timeoutInfo: 'Number of hours after which a job is considered failed',
fullBackupInterval: 'Full backup interval',
timeoutUnit: 'in hours',
dbAndDrRequireEnterprisePlan: 'Delta Backup and DR require Enterprise plan',
crRequiresPremiumPlan: 'CR requires Premium plan',

View File

@ -5,6 +5,7 @@ const DEFAULTS = {
compression: '',
concurrency: 0,
fullInterval: 0,
offlineSnapshot: false,
timeout: 0,
}

View File

@ -249,6 +249,7 @@ class JobsTable extends React.Component {
const {
compression,
concurrency,
fullInterval,
offlineSnapshot,
reportWhen,
timeout,
@ -268,6 +269,9 @@ class JobsTable extends React.Component {
{timeout !== undefined && (
<Li>{_.keyValue(_('timeout'), timeout / 3600e3)} hours</Li>
)}
{fullInterval !== undefined && (
<Li>{_.keyValue(_('fullBackupInterval'), fullInterval)}</Li>
)}
{offlineSnapshot !== undefined && (
<Li>
{_.keyValue(

View File

@ -520,6 +520,12 @@ export default decorate([
value: value && value * 3600e3,
})
},
setFullInterval({ setGlobalSettings }, value) {
setGlobalSettings({
name: 'fullInterval',
value,
})
},
setOfflineSnapshot: (
{ setGlobalSettings },
{ target: { checked: value } }
@ -534,6 +540,7 @@ export default decorate([
compressionId: generateId,
formId: generateId,
inputConcurrencyId: generateId,
inputFullIntervalId: generateId,
inputReportWhenId: generateId,
inputTimeoutId: generateId,
@ -631,9 +638,14 @@ export default decorate([
({ state, effects, remotes, srsById, job = {}, intl }) => {
const { formatMessage } = intl
const { propSettings, settings = propSettings } = state
const { concurrency, reportWhen = 'failure', offlineSnapshot, timeout } =
settings.get('') || {}
const compression = defined(state.compression, job.compression, '')
const {
concurrency,
fullInterval,
offlineSnapshot,
reportWhen = 'failure',
timeout,
} = settings.get('') || {}
if (state.needUpdateParams) {
effects.updateParams()
@ -923,6 +935,16 @@ export default decorate([
placeholder={formatMessage(messages.timeoutUnit)}
/>
</FormGroup>
<FormGroup>
<label htmlFor={state.inputFullIntervalId}>
<strong>{_('fullBackupInterval')}</strong>
</label>{' '}
<Number
id={state.inputFullIntervalId}
onChange={effects.setFullInterval}
value={fullInterval}
/>
</FormGroup>
{state.isFull && (
<FormGroup>
<label htmlFor={state.compressionId}>