From c89c7dab6042eb98bb491883c191f4674895249f Mon Sep 17 00:00:00 2001 From: badrAZ Date: Fri, 26 Jan 2018 16:00:04 +0100 Subject: [PATCH] feat(job/log): improve Unhealthy VDI Chain message (#2588) Fixes #2586 --- src/common/intl/messages.js | 2 ++ src/xo-app/logs/index.js | 36 ++++++++++++++++++++++++++---------- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src/common/intl/messages.js b/src/common/intl/messages.js index fe15db25c..ed5dc80ce 100644 --- a/src/common/intl/messages.js +++ b/src/common/intl/messages.js @@ -1483,6 +1483,8 @@ const messages = { logIndicationToEnable: 'Click to enable', logIndicationToDisable: 'Click to disable', reportBug: 'Report a bug', + unhealthyVdiChainError: 'Job canceled to protect the VDI chain', + clickForMoreInformation: 'Click for more information', // ----- IPs ------ ipPoolName: 'Name', diff --git a/src/xo-app/logs/index.js b/src/xo-app/logs/index.js index 71187e79f..a7ed5b935 100644 --- a/src/xo-app/logs/index.js +++ b/src/xo-app/logs/index.js @@ -115,6 +115,10 @@ const PREDICATES = { 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 { state = { filter: 'all', @@ -208,16 +212,28 @@ class Log extends BaseComponent { )} - {call.error && ( - - {' '} - {call.error.message ? ( - {call.error.message} - ) : ( - JSON.stringify(call.error) - )} - - )} + {error != null && + (error.message === UNHEALTHY_VDI_CHAIN_ERROR ? ( + + + {_('unhealthyVdiChainError')} + + + ) : ( + + {' '} + {error.message !== undefined ? ( + {error.message} + ) : ( + JSON.stringify(error) + )} + + ))} ) )