From 2f89e3658a063b5d3f7bc9e3e2cdc51a3f32a133 Mon Sep 17 00:00:00 2001 From: Pierre Date: Wed, 23 Mar 2016 10:11:01 +0100 Subject: [PATCH] Backup type in report e-mail (See vatesfr/xo-web#822) --- packages/xo-server-backup-reports/src/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/xo-server-backup-reports/src/index.js b/packages/xo-server-backup-reports/src/index.js index 56adb2d94..486fafc7d 100644 --- a/packages/xo-server-backup-reports/src/index.js +++ b/packages/xo-server-backup-reports/src/index.js @@ -120,6 +120,9 @@ class BackupReportsXoPlugin { const start = moment(status.start) const end = moment(status.end) const duration = moment.duration(end - start).humanize() + let method = status.calls[Object.keys(status.calls)[0]].method + method = method.slice(method.indexOf('.') + 1) + .replace(/([A-Z])/g, ' $1').replace(/^./, letter => letter.toUpperCase()) // humanize const tag = status.calls[Object.keys(status.calls)[0]].params.tag if (reportWhen === 'fail' && globalStatus === 'Success') { @@ -128,7 +131,7 @@ class BackupReportsXoPlugin { // Global status. text.unshift([ - `## Global status for "${tag}": ${globalStatus}`, + `## Global status for "${tag}" (${method}): ${globalStatus}`, ` - Start time: ${String(start)}`, ` - End time: ${String(end)}`, ` - Duration: ${duration}`,