feat(portforwarding): improve machine_display to show local port

pull/597/head
jon4hz 5 months ago
parent 89a68a13c4
commit 936af2ede0
No known key found for this signature in database
GPG Key ID: 4B0AFE9E7118898E

@ -817,6 +817,7 @@ sub machine_display {
my $proxyPort = $params{'proxyPort'};
my $proxyUser = $params{'proxyUser'};
my $remotePort = $params{'remotePort'};
my $localPort = $params{'localPort'};
my $machine = (index($ip, ':') >= 0 ? "[$ip]" : $ip);
$machine .= ":$port" if $port;
@ -829,8 +830,10 @@ sub machine_display {
$machine = "$machine via $proxy";
}
if ($remotePort) {
$machine .= " (remote port forwarding: $remotePort)";
if ($remotePort && !$localPort) {
$machine .= " (port forwarding: $remotePort)";
} elsif ($localPort) {
$machine .= " (port forwarding: $localPort->$remotePort)";
}
return R('OK', value => $machine);

Loading…
Cancel
Save