From 5e2ab2765c1b0f1ac3d7e9eb5e01fc97afb79af3 Mon Sep 17 00:00:00 2001 From: Lukas Wagner Date: Tue, 23 Apr 2024 13:52:14 +0200 Subject: [PATCH] ui: tape backup job: add selector for notification-mode Signed-off-by: Lukas Wagner Tested-by: Gabriel Goller Reviewed-by: Gabriel Goller Tested-by: Maximiliano Sandoval Signed-off-by: Thomas Lamprecht --- www/tape/window/TapeBackupJob.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/www/tape/window/TapeBackupJob.js b/www/tape/window/TapeBackupJob.js index abbbaa0b..309dda0b 100644 --- a/www/tape/window/TapeBackupJob.js +++ b/www/tape/window/TapeBackupJob.js @@ -46,6 +46,15 @@ Ext.define('PBS.TapeManagement.BackupJobEdit', { }, }, + viewModel: { + data: { + notificationMode: 'notification-system', + }, + formulas: { + notificationSystemSelected: (get) => get('notificationMode') === 'notification-system', + }, + }, + items: { xtype: 'tabpanel', bodyPadding: 10, @@ -109,6 +118,18 @@ Ext.define('PBS.TapeManagement.BackupJobEdit', { fieldLabel: gettext('Drive'), name: 'drive', }, + { + xtype: 'proxmoxKVComboBox', + comboItems: [ + ['legacy-sendmail', gettext('Email (legacy)')], + ['notification-system', gettext('Notification system')], + ], + fieldLabel: gettext('Notification mode'), + name: 'notification-mode', + bind: { + value: '{notificationMode}', + }, + }, { xtype: 'pmxUserSelector', name: 'notify-user', @@ -117,6 +138,9 @@ Ext.define('PBS.TapeManagement.BackupJobEdit', { allowBlank: true, value: null, renderer: Ext.String.htmlEncode, + bind: { + disabled: "{notificationSystemSelected}", + }, }, ],