Skip to content

Commit 652ba9c

Browse files
author
skid
committed
Merge branch 'master' of github.com:serghey-rodin/vesta
2 parents 9fb1152 + 9cae698 commit 652ba9c

File tree

3 files changed

+10
-18
lines changed

3 files changed

+10
-18
lines changed

web/templates/admin/add_web.html

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,10 @@
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>

web/templates/admin/edit_web.html

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,10 @@
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>

web/templates/admin/list_web.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
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') {
@@ -178,7 +179,7 @@
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">

0 commit comments

Comments
 (0)