]> 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 02af917919277b37ece133514fe30558c378aeea..570b4dd20038c49ddd2b68153e672b8deae0cf4d 100644 (file)
@@ -11,7 +11,7 @@ Ext.define('PVE.dc.ACMEPluginEditor', {
     width: 550,
     url: '/cluster/acme/plugins/',
 
-    subject: gettext('ACME DNS Plugin'),
+    subject: 'ACME DNS Plugin',
 
     items: [
        {
@@ -30,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());
                }
@@ -57,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':
@@ -75,10 +77,15 @@ 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: 150,
                        labelSeparator: '=',
@@ -95,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());
@@ -179,6 +194,13 @@ Ext.define('PVE.dc.ACMEPluginEditor', {
                    labelWidth: 150,
                    name: 'data',
                },
+               {
+                   xtype: 'displayfield',
+                   fieldLabel: gettext('Hint'),
+                   labelWidth: 150,
+                   name: 'hint',
+                   hidden: true,
+               },
            ],
        },
     ],