feat(job/log): improve Unhealthy VDI Chain message (#2588)

Fixes #2586
This commit is contained in:
badrAZ 2018-01-26 16:00:04 +01:00 committed by Julien Fontanet
parent d2fdf0586c
commit c89c7dab60
2 changed files with 28 additions and 10 deletions

View File

@ -1483,6 +1483,8 @@ const messages = {
logIndicationToEnable: 'Click to enable', logIndicationToEnable: 'Click to enable',
logIndicationToDisable: 'Click to disable', logIndicationToDisable: 'Click to disable',
reportBug: 'Report a bug', reportBug: 'Report a bug',
unhealthyVdiChainError: 'Job canceled to protect the VDI chain',
clickForMoreInformation: 'Click for more information',
// ----- IPs ------ // ----- IPs ------
ipPoolName: 'Name', ipPoolName: 'Name',

View File

@ -115,6 +115,10 @@ const PREDICATES = {
success: call => call.end !== undefined && call.error === undefined, success: call => call.end !== undefined && call.error === undefined,
} }
const UNHEALTHY_VDI_CHAIN_ERROR = 'unhealthy VDI chain'
const UNHEALTHY_VDI_CHAIN_LINK =
'https://xen-orchestra.com/docs/backup_troubleshooting.html#vdi-chain-protection'
class Log extends BaseComponent { class Log extends BaseComponent {
state = { state = {
filter: 'all', filter: 'all',
@ -208,16 +212,28 @@ class Log extends BaseComponent {
<JobReturn id={id} /> <JobReturn id={id} />
</span> </span>
)} )}
{call.error && ( {error != null &&
(error.message === UNHEALTHY_VDI_CHAIN_ERROR ? (
<Tooltip content={_('clickForMoreInformation')}>
<a
className='text-info'
href={UNHEALTHY_VDI_CHAIN_LINK}
rel='noopener noreferrer'
target='_blank'
>
<Icon icon='info' /> {_('unhealthyVdiChainError')}
</a>
</Tooltip>
) : (
<span className='text-danger'> <span className='text-danger'>
<Icon icon='error' />{' '} <Icon icon='error' />{' '}
{call.error.message ? ( {error.message !== undefined ? (
<strong>{call.error.message}</strong> <strong>{error.message}</strong>
) : ( ) : (
JSON.stringify(call.error) JSON.stringify(error)
)} )}
</span> </span>
)} ))}
</li> </li>
) )
) )