]> git.proxmox.com Git - pmg-gui.git/commitdiff
dkim: list all available selectors
authorStoiko Ivanov <s.ivanov@proxmox.com>
Tue, 14 Jan 2020 18:31:37 +0000 (19:31 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 21 Jan 2020 08:08:41 +0000 (09:08 +0100)
by making the selector field a ComboBox, users can pick from any existing
selector without changing it, replace it or create a new one.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
js/DKIMSettings.js

index 590f7597b790fea9ee414c7666e8eb50fb9d6362..f0f378feed236af55f18efceb5be333eb294b90c 100644 (file)
@@ -88,6 +88,39 @@ Ext.define('PMG.SelectorViewer', {
     }
 });
 
+Ext.define('PMG.SelectorList', {
+    extend: 'Ext.form.ComboBox',
+    xtype: 'pmgDKIMSelectorList',
+
+    queryMode: 'local',
+    store: {
+       fields: [ 'selector' ],
+       filterOnLoad: true,
+       proxy: {
+           type: 'proxmox',
+           url: '/api2/json/config/dkim/selectors'
+       },
+       sorters: [
+           {
+               property : 'selector',
+               direction: 'ASC'
+           }
+       ]
+    },
+
+    valueField: 'selector',
+    displayField: 'selector',
+    allowBlank: false,
+
+    initComponent: function() {
+       var me = this;
+
+       me.callParent();
+       me.store.load();
+    }
+
+});
+
 Ext.define('PMG.DKIMSettings', {
     extend: 'Proxmox.grid.ObjectGrid',
     xtype: 'pmgDKIM',
@@ -120,6 +153,7 @@ Ext.define('PMG.DKIMSettings', {
                isCreate: true,
                method: 'POST',
                url: '/config/dkim/selector',
+               submitText: gettext('Update'),
                items: [
                    {
                        xtype: 'displayfield',
@@ -128,12 +162,9 @@ Ext.define('PMG.DKIMSettings', {
                        value: gettext('Warning: You need to update the _domainkey DNS records of all signed domains!'),
                    },
                    {
-                       xtype: 'proxmoxtextfield',
+                       xtype: 'pmgDKIMSelectorList',
                        fieldLabel: selector_text,
                        name: 'selector',
-                       allowBlank: false,
-                       required: true,
-                       defaultValue: 'pmg'
                    },
                    {
                        xtype: 'proxmoxKVComboBox',