[pve-devel] [PATCH proxmox-widget-toolkit 27/27] noficiation: matcher edit: make 'field' an editable combobox

Lukas Wagner l.wagner at proxmox.com
Tue Nov 7 11:18:27 CET 2023


For now with fixed options that are shared between most notification
events - later, once we have a notification registry, this should be
filled dynamically.

Signed-off-by: Lukas Wagner <l.wagner at proxmox.com>
---
 src/window/NotificationMatcherEdit.js | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/window/NotificationMatcherEdit.js b/src/window/NotificationMatcherEdit.js
index c6f0726..fb55e17 100644
--- a/src/window/NotificationMatcherEdit.js
+++ b/src/window/NotificationMatcherEdit.js
@@ -963,14 +963,23 @@ Ext.define('Proxmox.panel.NotificationMatchRuleSettings', {
 	},
 	{
 	    fieldLabel: gettext('Field'),
-	    xtype: 'textfield',
+	    xtype: 'proxmoxKVComboBox',
 	    isFormField: false,
 	    submitValue: false,
+	    allowBlank: false,
+	    editable: true,
+	    displayField: 'key',
 	    bind: {
 		hidden: '{!typeIsMatchField}',
 		disabled: '{!typeIsMatchField}',
 		value: '{matchFieldField}',
 	    },
+	    // TODO: Once we have a 'notification registry', we should
+	    // retrive those via an API call.
+	    comboItems: [
+		['type', ''],
+		['hostname', ''],
+	    ],
 	},
 	{
 	    fieldLabel: gettext('Value'),
-- 
2.39.2






More information about the pve-devel mailing list