]> git.proxmox.com Git - pve-manager.git/blobdiff - www/manager6/dc/ACMEPluginEdit.js
ui: realm: clarify that the sync jobs really are for the realm
[pve-manager.git] / www / manager6 / dc / ACMEPluginEdit.js
index d85bc4a87dccb6dfcade5506b78db8610dc573ac..570b4dd20038c49ddd2b68153e672b8deae0cf4d 100644 (file)
@@ -3,13 +3,16 @@ Ext.define('PVE.dc.ACMEPluginEditor', {
     xtype: 'pveACMEPluginEditor',
     mixins: ['Proxmox.Mixin.CBind'],
 
+    onlineHelp: 'sysadmin_certs_acme_plugins',
+
     isAdd: true,
     isCreate: false,
 
-    width: 450,
+    width: 550,
     url: '/cluster/acme/plugins/',
 
-    subject: gettext('Plugin'),
+    subject: 'ACME DNS Plugin',
+
     items: [
        {
            xtype: 'inputpanel',
@@ -27,6 +30,7 @@ Ext.define('PVE.dc.ACMEPluginEditor', {
                // we know where to add because we define it right below
                let container = me.down('container');
                let datafield = me.down('field[name=data]');
+               let hintfield = me.down('field[name=hint]');
                if (!me.createdInitially) {
                    [me.originalValues] = PVE.Parser.parseACMEPluginData(datafield.getValue());
                }
@@ -54,7 +58,8 @@ Ext.define('PVE.dc.ACMEPluginEditor', {
                }
                // create custom fields according to schema
                let gotSchemaField = false;
-               for (const [name, definition] of Object.entries(schema.fields).sort((a, b) => a[0].localeCompare(b[0]))) {
+               let cmp = (a, b) => a[0].localeCompare(b[0]);
+               for (const [name, definition] of Object.entries(schema.fields).sort(cmp)) {
                    let xtype;
                    switch (definition.type) {
                        case 'string':
@@ -72,12 +77,18 @@ Ext.define('PVE.dc.ACMEPluginEditor', {
                            break;
                    }
 
+                   let label = name;
+                   if (typeof definition.name === "string") {
+                       label = definition.name;
+                   }
+
                    let field = Ext.create({
                        xtype,
                        name: `custom_${name}`,
-                       fieldLabel: name,
+                       fieldLabel: label,
                        width: '100%',
-                       labelWidth: 120,
+                       labelWidth: 150,
+                       labelSeparator: '=',
                        emptyText: definition.default || '',
                        autoEl: definition.description ? {
                            tag: 'div',
@@ -91,6 +102,14 @@ Ext.define('PVE.dc.ACMEPluginEditor', {
                }
                datafield.setHidden(gotSchemaField); // prefer schema-fields
 
+               if (schema.description) {
+                   hintfield.setValue(schema.description);
+                   hintfield.setHidden(false);
+               } else {
+                   hintfield.setValue('');
+                   hintfield.setHidden(true);
+               }
+
                // parse data from field and set it to the custom ones
                let extradata = [];
                [data, extradata] = PVE.Parser.parseACMEPluginData(datafield.getValue());
@@ -143,13 +162,13 @@ Ext.define('PVE.dc.ACMEPluginEditor', {
                        allowBlank: false,
                    },
                    name: 'plugin',
-                   labelWidth: 120,
+                   labelWidth: 150,
                    fieldLabel: gettext('Plugin ID'),
                },
                {
                    xtype: 'proxmoxintegerfield',
                    name: 'validation-delay',
-                   labelWidth: 120,
+                   labelWidth: 150,
                    fieldLabel: gettext('Validation Delay'),
                    emptyText: 30,
                    cbind: {
@@ -161,7 +180,7 @@ Ext.define('PVE.dc.ACMEPluginEditor', {
                {
                    xtype: 'pveACMEApiSelector',
                    name: 'api',
-                   labelWidth: 120,
+                   labelWidth: 150,
                    listeners: {
                        change: function(selector) {
                            let schema = selector.getSchema();
@@ -172,9 +191,16 @@ Ext.define('PVE.dc.ACMEPluginEditor', {
                {
                    xtype: 'textarea',
                    fieldLabel: gettext('API Data'),
-                   labelWidth: 120,
+                   labelWidth: 150,
                    name: 'data',
                },
+               {
+                   xtype: 'displayfield',
+                   fieldLabel: gettext('Hint'),
+                   labelWidth: 150,
+                   name: 'hint',
+                   hidden: true,
+               },
            ],
        },
     ],