showTaskViewer: true,
isCreate: true,
+ viewModel: {
+ data: {
+ notificationMode: 'notification-system',
+ },
+ formulas: {
+ notificationSystemSelected: (get) => get('notificationMode') === 'notification-system',
+ },
+ },
+
items: [
{
xtype: 'inputpanel',
name: 'eject-media',
fieldLabel: gettext('Eject Media'),
},
+ {
+ xtype: 'proxmoxKVComboBox',
+ labelWidth: 150,
+ comboItems: [
+ ['legacy-sendmail', gettext('Email (legacy)')],
+ ['notification-system', gettext('Notification system')],
+ ],
+ fieldLabel: gettext('Notification mode'),
+ name: 'notification-mode',
+ bind: {
+ value: '{notificationMode}',
+ },
+ },
{
xtype: 'pmxUserSelector',
labelWidth: 150,
value: null,
allowBlank: true,
skipEmptyText: true,
+ bind: {
+ disabled: "{notificationSystemSelected}",
+ },
renderer: Ext.String.htmlEncode,
},
],
viewModel: {
data: {
- notificationMode: 'notification-system',
+ notificationMode: '__default__',
},
formulas: {
notificationSystemSelected: (get) => get('notificationMode') === 'notification-system',
},
},
+ initComponent: function() {
+ let me = this;
+ // Automatically select the new system for new jobs
+ let mode = me.isCreate ? "notification-system" : "__default__";
+ me.getViewModel().set('notificationMode', mode);
+ me.callParent();
+ },
+
items: {
xtype: 'tabpanel',
bodyPadding: 10,
{
xtype: 'proxmoxKVComboBox',
comboItems: [
+ ['__default__', `${Proxmox.Utils.defaultText} (Email)`],
['legacy-sendmail', gettext('Email (legacy)')],
['notification-system', gettext('Notification system')],
],