diff --git a/src/data/model/NotificationConfig.js b/src/data/model/NotificationConfig.js index 9171515..e8ebf28 100644 --- a/src/data/model/NotificationConfig.js +++ b/src/data/model/NotificationConfig.js @@ -1,6 +1,6 @@ Ext.define('proxmox-notification-endpoints', { extend: 'Ext.data.Model', - fields: ['name', 'type', 'comment', 'disable'], + fields: ['name', 'type', 'comment', 'disable', 'origin'], proxy: { type: 'proxmox', }, @@ -9,7 +9,7 @@ Ext.define('proxmox-notification-endpoints', { Ext.define('proxmox-notification-matchers', { extend: 'Ext.data.Model', - fields: ['name', 'comment', 'disable'], + fields: ['name', 'comment', 'disable', 'origin'], proxy: { type: 'proxmox', }, diff --git a/src/panel/NotificationConfigView.js b/src/panel/NotificationConfigView.js index ba69298..4695da5 100644 --- a/src/panel/NotificationConfigView.js +++ b/src/panel/NotificationConfigView.js @@ -129,7 +129,7 @@ Ext.define('Proxmox.panel.NotificationEndpointView', { dataIndex: 'name', text: gettext('Target Name'), renderer: Ext.String.htmlEncode, - flex: 1, + flex: 2, }, { dataIndex: 'type', @@ -141,7 +141,21 @@ Ext.define('Proxmox.panel.NotificationEndpointView', { dataIndex: 'comment', text: gettext('Comment'), renderer: Ext.String.htmlEncode, - flex: 1, + flex: 3, + }, + { + dataIndex: 'origin', + text: gettext('Origin'), + renderer: (origin) => { + switch (origin) { + case 'user-created': return gettext('Custom'); + case 'modified-builtin': return gettext('Built-In (modified)'); + case 'builtin': return gettext('Built-In'); + } + + // Should not happen... + return 'unknown'; + }, }, ], @@ -274,6 +288,20 @@ Ext.define('Proxmox.panel.NotificationMatcherView', { renderer: Ext.String.htmlEncode, flex: 2, }, + { + dataIndex: 'origin', + text: gettext('Origin'), + renderer: (origin) => { + switch (origin) { + case 'user-created': return gettext('Custom'); + case 'modified-builtin': return gettext('Built-In (modified)'); + case 'builtin': return gettext('Built-In'); + } + + // Should not happen... + return 'unknown'; + }, + }, ], store: {