[pbs-devel] [RFC PATCH proxmox-backup 2/2] ui: add port support for remotes

Dominik Csapak d.csapak at proxmox.com
Tue Sep 29 16:18:59 CEST 2020


by adding a field to RemoteEdit and showing it in the grid

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/config/RemoteView.js | 13 +++++++++++--
 www/window/RemoteEdit.js | 10 ++++++++++
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/www/config/RemoteView.js b/www/config/RemoteView.js
index a820da04..a804e5d6 100644
--- a/www/config/RemoteView.js
+++ b/www/config/RemoteView.js
@@ -1,6 +1,15 @@
 Ext.define('pmx-remotes', {
     extend: 'Ext.data.Model',
-    fields: ['name', 'host', 'userid', 'fingerprint', 'comment'],
+    fields: ['name', 'host', 'port', 'userid', 'fingerprint', 'comment',
+	{
+	    name: 'server',
+	    calculate: function(data) {
+		let host = data.host || "localhost";
+		let port = data.port || "8007";
+		return `${host}:${port}`;
+	    }
+	}
+    ],
     idProperty: 'name',
     proxy: {
 	type: 'proxmox',
@@ -109,7 +118,7 @@ Ext.define('PBS.config.RemoteView', {
 	    header: gettext('Host'),
 	    width: 200,
 	    sortable: true,
-	    dataIndex: 'host',
+	    dataIndex: 'server',
 	},
 	{
 	    header: gettext('User name'),
diff --git a/www/window/RemoteEdit.js b/www/window/RemoteEdit.js
index cbfbe1d9..7d0ea546 100644
--- a/www/window/RemoteEdit.js
+++ b/www/window/RemoteEdit.js
@@ -48,6 +48,16 @@ Ext.define('PBS.window.RemoteEdit', {
 		name: 'host',
 		fieldLabel: gettext('Host'),
 	    },
+	    {
+		xtype: 'proxmoxintegerfield',
+		allowBlank: true,
+		minValue: 1,
+		maxValue: 2**16,
+		name: 'port',
+		emptyText: 8007,
+		deleteEmpty: true,
+		fieldLabel: gettext('Port'),
+	    },
 	],
 
 	column2: [
-- 
2.20.1






More information about the pbs-devel mailing list