Tidy "gateway name - IP" in dropdown list

While I notice this also, for a plain gateway, the current IP address is also listed in the dropdown list text, like "WAN_DHCP - 10.42.11.1". If there is no IP address currently, it might say "WAN_DHCP - dynamic". But for some DHCP gateways that have not had any non-default manual settings done, it can say "OPT1_DHCP -". This gets rid of the silly-looking "-"
This commit is contained in:
Phil Davis 2014-02-28 03:28:28 -08:00
parent d47e25c777
commit fa94f1e17e

View File

@ -1468,7 +1468,8 @@ $i--): ?>
} else {
$selected = "";
}
echo "<option value=\"{$gwname}\" {$selected}>{$gw['name']} - {$gw['gateway']}</option>\n";
$gateway_addr_str = empty($gw['gateway']) ? "" : " - " . $gw[gateway];
echo "<option value=\"{$gwname}\" {$selected}>{$gw['name']}{$gateway_addr_str}</option>\n";
}
/* add gateway groups to the list */
if (is_array($a_gatewaygroups)) {