[pve-devel] [PATCH manager v2 1/5] ui: add ACME selector formfields for account and plugins

Dominik Csapak d.csapak at proxmox.com
Wed May 6 16:31:08 CEST 2020


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.csapak at proxmox.com>
---
changes from v1:
* drop fieldLabel in ACMEAccountSelector
 www/manager6/Makefile                    |  2 ++
 www/manager6/form/ACMEAccountSelector.js | 21 +++++++++++++++++++++
 www/manager6/form/ACMEPluginSelector.js  | 19 +++++++++++++++++++
 3 files changed, 42 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..12d5848c
--- /dev/null
+++ b/www/manager6/form/ACMEAccountSelector.js
@@ -0,0 +1,21 @@
+Ext.define('PVE.form.ACMEAccountSelector', {
+    extend: 'Ext.form.field.ComboBox',
+    alias: 'widget.pveACMEAccountSelector',
+
+    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





More information about the pve-devel mailing list