From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <d.csapak@proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id A706B7B6ED
 for <pbs-devel@lists.proxmox.com>; Wed, 12 May 2021 16:42:34 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id 968FCF134
 for <pbs-devel@lists.proxmox.com>; Wed, 12 May 2021 16:42:34 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com
 [94.136.29.106])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by firstgate.proxmox.com (Proxmox) with ESMTPS id 6EF40F129
 for <pbs-devel@lists.proxmox.com>; Wed, 12 May 2021 16:42:33 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1])
 by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 3B62545B33
 for <pbs-devel@lists.proxmox.com>; Wed, 12 May 2021 16:42:33 +0200 (CEST)
From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Date: Wed, 12 May 2021 16:42:32 +0200
Message-Id: <20210512144232.5643-1-d.csapak@proxmox.com>
X-Mailer: git-send-email 2.20.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.017 Adjusted score from AWL reputation of From: address
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
Subject: [pbs-devel] [PATCH proxmox-backup] ui: add node options under
 'Configuration -> Options'
X-BeenThere: pbs-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox Backup Server development discussion
 <pbs-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pbs-devel>, 
 <mailto:pbs-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pbs-devel/>
List-Post: <mailto:pbs-devel@lists.proxmox.com>
List-Help: <mailto:pbs-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel>, 
 <mailto:pbs-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Wed, 12 May 2021 14:42:34 -0000

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                 |  1 +
 www/SystemConfiguration.js   |  5 +++++
 www/config/NodeOptionView.js | 42 ++++++++++++++++++++++++++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 www/config/NodeOptionView.js

diff --git a/www/Makefile b/www/Makefile
index f0b795ca..517cbd23 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -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				\
diff --git a/www/SystemConfiguration.js b/www/SystemConfiguration.js
index 025e0273..211c9c08 100644
--- a/www/SystemConfiguration.js
+++ b/www/SystemConfiguration.js
@@ -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
index 00000000..beeea35f
--- /dev/null
+++ b/www/config/NodeOptionView.js
@@ -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);
+    },
+});
-- 
2.20.1