mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 18:19:12 +01:00
Better ipv6 display in forwarded ports view
This commit is contained in:
@@ -190,10 +190,19 @@ export class ExtHostTunnelService extends Disposable implements IExtHostTunnelSe
|
||||
|
||||
private parseIpAddress(hex: string): string {
|
||||
let result = '';
|
||||
for (let i = hex.length - 2; (i >= 0); i -= 2) {
|
||||
result += parseInt(hex.substr(i, 2), 16);
|
||||
if (i !== 0) {
|
||||
result += '.';
|
||||
if (hex.length === 8) {
|
||||
for (let i = hex.length - 2; i >= 0; i -= 2) {
|
||||
result += parseInt(hex.substr(i, 2), 16);
|
||||
if (i !== 0) {
|
||||
result += '.';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (let i = hex.length - 4; i >= 0; i -= 4) {
|
||||
result += parseInt(hex.substr(i, 4), 16).toString(16);
|
||||
if (i !== 0) {
|
||||
result += ':';
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user