filter the plugins by type === 'dns'
and add a convenience method for ACMEAccountSelector to check if there
are any accounts

Signed-off-by: Dominik Csapak <d.csa...@proxmox.com>
---
 www/manager6/Makefile                    |  2 ++
 www/manager6/form/ACMEAccountSelector.js | 22 ++++++++++++++++++++++
 www/manager6/form/ACMEPluginSelector.js  | 19 +++++++++++++++++++
 3 files changed, 43 insertions(+)
 create mode 100644 www/manager6/form/ACMEAccountSelector.js
 create mode 100644 www/manager6/form/ACMEPluginSelector.js

diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index e2214588..563e7dc5 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -73,6 +73,8 @@ JSSRC=                                                        
\
        form/SDNControllerSelector.js                   \
        form/TFASelector.js                             \
        form/ACMEAPiSelector.js                         \
+       form/ACMEAccountSelector.js                     \
+       form/ACMEPluginSelector.js                      \
        dc/Tasks.js                                     \
        dc/Log.js                                       \
        panel/StatusPanel.js                            \
diff --git a/www/manager6/form/ACMEAccountSelector.js 
b/www/manager6/form/ACMEAccountSelector.js
new file mode 100644
index 00000000..5b533c1b
--- /dev/null
+++ b/www/manager6/form/ACMEAccountSelector.js
@@ -0,0 +1,22 @@
+Ext.define('PVE.form.ACMEAccountSelector', {
+    extend: 'Ext.form.field.ComboBox',
+    alias: 'widget.pveACMEAccountSelector',
+
+    fieldLabel: gettext('Account'),
+    displayField: 'name',
+    valueField: 'name',
+
+    store: {
+       model: 'pve-acme-accounts',
+       autoLoad: true,
+    },
+
+    triggerAction: 'all',
+    queryMode: 'local',
+    allowBlank: false,
+    editable: false,
+
+    isEmpty: function() {
+       return this.getStore().getData().length === 0;
+    }
+});
diff --git a/www/manager6/form/ACMEPluginSelector.js 
b/www/manager6/form/ACMEPluginSelector.js
new file mode 100644
index 00000000..ccce97b8
--- /dev/null
+++ b/www/manager6/form/ACMEPluginSelector.js
@@ -0,0 +1,19 @@
+Ext.define('PVE.form.ACMEPluginSelector', {
+    extend: 'Ext.form.field.ComboBox',
+    alias: 'widget.pveACMEPluginSelector',
+
+    fieldLabel: gettext('Plugin'),
+    displayField: 'plugin',
+    valueField: 'plugin',
+
+    store: {
+       model: 'pve-acme-plugins',
+       autoLoad: true,
+       filters: item => item.data.type === 'dns',
+    },
+
+    triggerAction: 'all',
+    queryMode: 'local',
+    allowBlank: false,
+    editable: false,
+});
-- 
2.20.1


_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to