File tree Expand file tree Collapse file tree 3 files changed +10
-18
lines changed
Expand file tree Collapse file tree 3 files changed +10
-18
lines changed Original file line number Diff line number Diff line change 6262 < td >
6363 < select class ="vst-list " name ="v_ip ">
6464 < ?php
65- foreach ($ips as $key => $value) {
66- $display_ip = $key;
67- if (!empty($value['NAT'])) $display_ip = $value['NAT'];
68- echo "\t\t\t\t< option value =\ "".htmlentities($display_ip)."\"";
69- if ((!empty($v_ip)) && ( $display_ip == $_POST['v_ip'])){
70- echo ' selected';
71- }
72- echo "> ".htmlentities($display_ip)."</ option > \n";
65+ foreach ($ips as $ip => $value) {
66+ $display_ip = htmlentities(empty($value['NAT']) ? $ip : "{$ip} → {$value['NAT']}");
67+ $ip_selected = (!empty($v_ip) && $ip == $_POST['v_ip']) ? 'selected' : '';
68+ echo "\t\t\t\t< option value =\ "{$ip}\" {$ip_selected}> {$display_ip}</ option > \n";
7369 }
7470 ?>
7571 </ select >
Original file line number Diff line number Diff line change 6565 < td >
6666 < select class ="vst-list " name ="v_ip ">
6767 < ?php
68- foreach ($ips as $key => $value) {
69- $display_ip = $key;
70- if (!empty($value['NAT'])) $display_ip = $value['NAT'];
71- $skey = "'".$display_ip."'";
72- echo "\n\t\t\t\t\t\t\t\t\t\t\t\t< option value =\ "".htmlentities($display_ip)."\"";
73- if ((!empty($v_ip)) && ( $display_ip == $v_ip ) || ( $skey == $v_ip )){
74- echo ' selected';
75- }
76- echo "> ".htmlentities($display_ip)."</ option > \n";
68+ foreach ($ips as $ip => $value) {
69+ $display_ip = htmlentities(empty($value['NAT']) ? $ip : "{$ip} → {$value['NAT']}");
70+ $ip_selected = ((!empty($v_ip) && $ip == $v_ip) || $v_ip == "'{$ip}'") ? 'selected' : '';
71+ echo "\n\t\t\t\t\t\t\t\t\t\t\t\t< option value =\ "{$ip}\" {$ip_selected}> {$display_ip}</ option > \n";
7772 }
7873 ?>
7974 </ select >
Original file line number Diff line number Diff line change 5757
5858 < div class ="l-center units narrow ">
5959 < ?php
60+ $ips = json_decode(shell_exec(VESTA_CMD.'v-list-sys-ips json'), true);
6061 foreach ($data as $key => $value) {
6162 ++$i;
6263 if ($data[$key]['SUSPENDED'] == 'yes') {
178179 </ div >
179180 <!-- /.l-unit__name -->
180181 < div class ="l-unit__ip ">
181- < ?=str_replace('.', ' < span > . </ span > ', $data[$key]['IP']) ?>
182+ < ?=empty($ips[$data[$key]['IP']]['NAT']) ? $data[$key]['IP'] : "{ $data[$key]['IP']} → {$ips[$data[$key]['IP']]['NAT']}"; ?>
182183 </ div >
183184 <!-- /.l-unit__ip -->
184185 < div class ="l-unit__stats ">
You can’t perform that action at this time.
0 commit comments