feat(plugins/backup-report): add custom subject in plugin settings (#8973)

This commit is contained in:
Pierre Brunet
2025-12-17 15:41:11 +01:00
committed by GitHub
parent c6f47f9ef3
commit 1316a811f5
12 changed files with 22 additions and 9 deletions

View File

@@ -12,6 +12,8 @@
> Users must be able to say: “Nice enhancement, I'm eager to test it”
- [XO5] Remove XOSAN (PR [#9248](https://github.com/vatesfr/xen-orchestra/pull/9248))
- [Plugins/Backup-reports] Add optional context in email subject and Pool ID in summary [#8544](https://github.com/vatesfr/xen-orchestra/issues/8544) (PR [#8973](https://github.com/vatesfr/xen-orchestra/pull/8973))
- **XO 6:**
- [Site/Tasks] Implement tasks view and side panel information (PR [#9063](https://github.com/vatesfr/xen-orchestra/pull/9063))
@@ -49,6 +51,7 @@
- @xen-orchestra/xapi patch
- xo-server patch
- xo-server-audit minor
- xo-server-backup-reports minor
- xo-server-perf-alert minor
<!--packages-end-->

View File

@@ -32,6 +32,11 @@ export const configurationSchema = {
},
minItems: 1,
},
customSubject: {
type: 'string',
title: 'Custom subject',
description: 'String added at the end of any backup report email subject',
},
},
}
@@ -98,9 +103,10 @@ class BackupReportsXoPlugin {
this._eventListener = (...args) => this._report(...args).catch(noop)
}
configure({ toMails, toXmpp }) {
configure({ toMails, toXmpp, customSubject }) {
this._mailsReceivers = toMails
this._xmppReceivers = toXmpp
this._customSubject = customSubject
}
load() {
@@ -189,6 +195,7 @@ class BackupReportsXoPlugin {
const context = {
jobName,
log,
customSubject: this._customSubject,
pkg,
tasksByStatus,
formatDate,
@@ -361,6 +368,7 @@ class BackupReportsXoPlugin {
const context = {
jobName,
log,
customSubject: this._customSubject,
pkg,
tasksByStatus: {
failure: { tasks: failedTasks, count: nFailures },

View File

@@ -1 +1 @@
[Xen Orchestra] {{{log.status}}} − Metadata backup report for {{{log.jobName}}} {{{getIcon log.status}}}
[Xen Orchestra{{#if customSubject}} - {{{customSubject}}}{{/if}}] {{{log.status}}} − Metadata backup report for {{{log.jobName}}} {{{getIcon log.status}}}

View File

@@ -1 +1 @@
[Xen Orchestra] {{{log.status}}} − Backup report for {{{jobName}}} {{{getIcon log.status}}}
[Xen Orchestra{{#if customSubject}} - {{{customSubject}}}{{/if}}] {{{log.status}}} − Backup report for {{{jobName}}} {{{getIcon log.status}}}

View File

@@ -1 +1 @@
[Xen Orchestra] {{{log.status}}} − Metadata backup report for {{{log.jobName}}} {{{getIcon log.status}}}
[Xen Orchestra{{#if customSubject}} - {{{customSubject}}}{{/if}}] {{{log.status}}} − Metadata backup report for {{{log.jobName}}} {{{getIcon log.status}}}

View File

@@ -1 +1 @@
[Xen Orchestra] {{{log.status}}} − Backup report for {{{jobName}}} {{{getIcon log.status}}}
[Xen Orchestra{{#if customSubject}} - {{{customSubject}}}{{/if}}] {{{log.status}}} − Backup report for {{{jobName}}} {{{getIcon log.status}}}

View File

@@ -1 +1 @@
[Xen Orchestra] {{{log.status}}} − Metadata backup report for {{{log.jobName}}} {{{getIcon log.status}}}
[Xen Orchestra{{#if customSubject}} - {{{customSubject}}}{{/if}}] {{{log.status}}} − Metadata backup report for {{{log.jobName}}} {{{getIcon log.status}}}

View File

@@ -4,6 +4,7 @@
{{#if vm.name_description}}
{{{vm.name_description}}}
{{/if}}
- **Pool id**: {{{vm.$pool}}}
- **UUID**: {{{vm.uuid}}}
{{else}}
### VM not found

View File

@@ -1 +1 @@
[Xen Orchestra] {{{log.status}}} − Backup report for {{{jobName}}} {{{getIcon log.status}}}
[Xen Orchestra{{#if customSubject}} - {{{customSubject}}}{{/if}}] {{{log.status}}} − Backup report for {{{jobName}}} {{{getIcon log.status}}}

View File

@@ -1 +1 @@
[Xen Orchestra] {{{log.status}}} − Metadata backup report for {{{log.jobName}}} {{{getIcon log.status}}}
[Xen Orchestra{{#if customSubject}} - {{{customSubject}}}{{/if}}] {{{log.status}}} − Metadata backup report for {{{log.jobName}}} {{{getIcon log.status}}}

View File

@@ -4,6 +4,7 @@
{{vm.name_description}}
{{/if}}
<ul>
<li><span style="font-weight: bold">Pool id</span>: {{vm.$pool}}</li>
<li><span style="font-weight: bold">UUID</span>: {{vm.uuid}}</li>
{{else}}
<h3>VM not found</h3>

View File

@@ -1 +1 @@
[Xen Orchestra] {{{log.status}}} − Backup report for {{{jobName}}} {{{getIcon log.status}}}
[Xen Orchestra{{#if customSubject}} - {{{customSubject}}}{{/if}}] {{{log.status}}} − Backup report for {{{jobName}}} {{{getIcon log.status}}}