Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/src/routes/cluster/cluster.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@

export function transformHostToIp(host: string) {
if (!host.includes(':')) return host;
const sliceIndex = host.indexOf(':');
const sliceIndex = host.lastIndexOf(':');
return host.slice(0, sliceIndex);
}
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,9 @@ private String getServerAddr() {
if (host == null || host.isEmpty()) {
try {
host = InetAddress.getLocalHost().getHostAddress();
if (host.split(":").length > 2) {
host = '[' + host + ']';
}
} catch (UnknownHostException e) {
throw new ServerException("get server ip fail");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ public SCP(String user, int sshPort, String sshKeyFile, String host, String loca
this.user = user;
this.sshPort = sshPort;
this.sshKeyFile = sshKeyFile;
this.host = host;
if (host != null && host.split(":").length > 2) {
this.host = '[' + host + ']';
} else {
this.host = host;
}
this.localPath = localPath;
this.remotePath = remotePath;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ public class ClusterInfoEntity {

private String address;

public String getAddress() {
if (address != null && address.split(":").length > 2) {
return '[' + address + ']';
}
return address;
}

public void setAddress(String address) {
this.address = address;
}

private int httpPort;

private int queryPort;
Expand Down