mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 09:04:39 +00:00
Routing, gateways, widget api call ditch return_gateways_array() usage and don't try to resolve addresses twice. for https://github.com/opnsense/core/issues/2279
This commit is contained in:
parent
6f82a2c0da
commit
b121d075f4
@ -33,10 +33,10 @@ function gateway_api()
|
||||
{
|
||||
$result = array();
|
||||
$gateways_status = return_gateways_status();
|
||||
foreach (return_gateways_array() as $gname => $gw) {
|
||||
foreach ((new \OPNsense\Routing\Gateways(legacy_interfaces_details()))->gatewaysIndexedByName() as $gname => $gw) {
|
||||
$gatewayItem = array('name' => $gname);
|
||||
$gatewayItem['address'] = !empty($gw['gateway']) ? $gw['gateway'] : "~";
|
||||
if (!empty($gateways_status[$gname])) {
|
||||
$gatewayItem['address'] = lookup_gateway_ip_by_name($gname);
|
||||
$gatewayItem['status'] = strtolower($gateways_status[$gname]['status']);
|
||||
$gatewayItem['loss'] = $gateways_status[$gname]['loss'];
|
||||
$gatewayItem['delay'] = $gateways_status[$gname]['delay'];
|
||||
@ -62,7 +62,6 @@ function gateway_api()
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
$gatewayItem['address'] = '~';
|
||||
$gatewayItem['status'] = '~';
|
||||
$gatewayItem['status_translated'] = gettext('Unknown');
|
||||
$gatewayItem['loss'] = '~';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user