[pbs-devel] [PATCH proxmox-backup 1/2] ui: RemoteView: improve host columns

Dominik Csapak d.csapak at proxmox.com
Thu Oct 1 09:57:56 CEST 2020


do not show the default (8007) port
and only add brackets [] to ipv6 addresses if there is a port

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/config/RemoteView.js | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/www/config/RemoteView.js b/www/config/RemoteView.js
index 96788fc7..98f72bb5 100644
--- a/www/config/RemoteView.js
+++ b/www/config/RemoteView.js
@@ -4,12 +4,15 @@ Ext.define('pmx-remotes', {
 	{
 	    name: 'server',
 	    calculate: function(data) {
-		let host = data.host || "localhost";
+		let txt = data.host || "localhost";
 		let port = data.port || "8007";
-		if (Proxmox.Utils.IP64_match.test(host)) {
-		    host = `[${host}]`;
+		if (port.toString() !== "8007") {
+		    if (Proxmox.Utils.IP6_match.test(txt)) {
+			txt = `[${txt}]`;
+		    }
+		    txt += `:${port}`;
 		}
-		return `${host}:${port}`;
+		return txt;
 	    }
 	}
     ],
-- 
2.20.1






More information about the pbs-devel mailing list