]> git.proxmox.com Git - proxmox-backup.git/commitdiff
ui: add node options under 'Configuration -> Options'
authorDominik Csapak <d.csapak@proxmox.com>
Wed, 12 May 2021 14:42:32 +0000 (16:42 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 21 May 2021 16:23:35 +0000 (18:23 +0200)
for now only http-proxy lives there, but we will add more options later,
such as
* email from
* default gui language

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
www/Makefile
www/SystemConfiguration.js
www/config/NodeOptionView.js [new file with mode: 0644]

index f0b795ca2a3ff63c1e46d6be407dd2b410b1fcf4..517cbd236b4757ec0f2ad66f9783c1340c7f88e4 100644 (file)
@@ -54,6 +54,7 @@ JSSRC=                                                        \
        config/VerifyView.js                            \
        config/WebauthnView.js                          \
        config/CertificateView.js                       \
+       config/NodeOptionView.js                        \
        window/ACLEdit.js                               \
        window/AddTfaRecovery.js                        \
        window/AddTotp.js                               \
index 025e0273dc3ff87570337273f0a65715c87300df..211c9c0815e6e297d67ca995e28986a63e3bcff1 100644 (file)
@@ -65,6 +65,11 @@ Ext.define('PBS.SystemConfiguration', {
                },
            ],
        },
+       {
+           title: gettext('Options'),
+           itemId: 'options',
+           xtype: 'pbsNodeOptionView',
+       },
     ],
 
     initComponent: function() {
diff --git a/www/config/NodeOptionView.js b/www/config/NodeOptionView.js
new file mode 100644 (file)
index 0000000..beeea35
--- /dev/null
@@ -0,0 +1,42 @@
+Ext.define('PBS.NodeOptionView', {
+    extend: 'Proxmox.grid.ObjectGrid',
+    alias: 'widget.pbsNodeOptionView',
+
+    monStoreErrors: true,
+
+    url: `/api2/json/nodes/${Proxmox.NodeName}/config`,
+    editorConfig: {
+       url: `/api2/extjs/nodes/${Proxmox.NodeName}/config`,
+    },
+    interval: 5000,
+    cwidth1: 200,
+
+    listeners: {
+       itemdblclick: function() { this.run_editor() },
+    },
+
+    tbar: [
+       {
+           text: gettext('Edit'),
+           xtype: 'proxmoxButton',
+           disabled: true,
+           handler: function() { this.up('grid').run_editor(); },
+       }
+    ],
+
+    initComponent: function() {
+       let me = this;
+
+       me.add_text_row('http-proxy', gettext('HTTP proxy'), {
+           defaultValue: Proxmox.Utils.noneText,
+           vtype: 'HttpProxy',
+           deleteEmpty: true,
+       });
+
+       me.callParent();
+
+       me.on('activate', me.rstore.startUpdate);
+       me.on('destroy', me.rstore.stopUpdate);
+       me.on('deactivate', me.rstore.stopUpdate);
+    },
+});