fix(xo-web/backup-ng/new): xoa plan verification (#2813)

This commit is contained in:
badrAZ 2018-03-30 17:22:21 +02:00 committed by Julien Fontanet
parent ab1413b741
commit 73c746fdd3
2 changed files with 31 additions and 9 deletions

View File

@ -331,6 +331,8 @@ const messages = {
backupName: 'Name',
useDelta: 'Use delta',
useCompression: 'Use compression',
dbAndDrRequireEntreprisePlan: 'Delta Backup and DR require Entreprise plan',
crRequiresPremiumPlan: 'CR requires Premium plan',
smartBackupModeTitle: 'Smart mode',
backupTargetRemotes: 'Target remotes (for Export)',
backupTargetSrs: 'Target SRs (for Replication)',

View File

@ -1,5 +1,6 @@
import _ from 'intl'
import ActionButton from 'action-button'
import Icon from 'icon'
import React from 'react'
import renderXoItem, { renderXoItemFromId } from 'render-xo-item'
import Tooltip from 'tooltip'
@ -559,14 +560,14 @@ export default [
</Card>
<Card>
<CardBlock>
<div className='btn-toolbar text-xs-center'>
<div className='text-xs-center'>
<ActionButton
active={state.snapshotMode}
handler={effects.setSnapshotMode}
icon='rolling-snapshot'
>
{_('rollingSnapshot')}
</ActionButton>
</ActionButton>{' '}
<ActionButton
active={state.backupMode}
disabled={state.isDelta}
@ -574,31 +575,50 @@ export default [
icon='backup'
>
{_('backup')}
</ActionButton>
</ActionButton>{' '}
<ActionButton
active={state.deltaMode}
disabled={state.isFull}
disabled={
state.isFull ||
(!state.deltaMode && process.env.XOA_PLAN < 3)
}
handler={effects.setDeltaMode}
icon='delta-backup'
>
{_('deltaBackup')}
</ActionButton>
</ActionButton>{' '}
<ActionButton
active={state.drMode}
disabled={state.isDelta}
disabled={
state.isDelta ||
(!state.drMode && process.env.XOA_PLAN < 3)
}
handler={effects.setDrMode}
icon='disaster-recovery'
>
{_('disasterRecovery')}
</ActionButton>
</ActionButton>{' '}
{process.env.XOA_PLAN < 3 && (
<Tooltip content={_('dbAndDrRequireEntreprisePlan')}>
<Icon icon='info' />
</Tooltip>
)}{' '}
<ActionButton
active={state.crMode}
disabled={state.isFull}
disabled={
state.isFull ||
(!state.crMode && process.env.XOA_PLAN < 4)
}
handler={effects.setCrMode}
icon='continuous-replication'
>
{_('continuousReplication')}
</ActionButton>
</ActionButton>{' '}
{process.env.XOA_PLAN < 4 && (
<Tooltip content={_('crRequiresPremiumPlan')}>
<Icon icon='info' />
</Tooltip>
)}
</div>
</CardBlock>
</Card>