--- guiconfig.inc.orig 2021-08-02 18:45:37.458860000 +0000 +++ guiconfig.inc 2021-08-02 19:14:01.115537000 +0000 @@ -994,79 +994,35 @@ return $content; } -function gateway_info_popup($showgw) { - global $config, $user_settings; +function gateway_info_popup($gw, $status) { + global $config; - init_config_arr(array('gateways', 'gateway_group')); - $a_gateways = return_gateways_array(); - $gateways_status = return_gateways_status(true); - - $content = ""; - $gws = array(); + /* Cache gateway status for this page load. + * See https://redmine.pfsense.org/issues/12174 */ $bgdanger = array('force_down', 'down', 'highloss', 'highdelay'); $bgwarning = array('loss', 'delay'); - $bgsuccess = array('none'); + $bgsuccess = array('online', 'none'); $bgcolor = "bg-info"; - - if (is_array($a_gateways)) { - foreach ($a_gateways as $i => $gateway) { - if ($gateway['name'] == $showgw) { - $gws[] = $gateway['name']; - } - } - } - if (is_array($config['gateways']['gateway_group'])) { - foreach($config['gateways']['gateway_group'] as $gwgroup) { - if ($gwgroup['name'] == $showgw) { - foreach ($gwgroup['item'] as $member) { - $membersplit = explode("|", $member); - $gws[] = $membersplit[0]; - } - } - } - } - - if (!empty($gws)) { - $content .= "
" . gettext("Name") . " | " . gettext("Interface") . " | "; - $content .= "" . gettext("Gateway") . " |
---|---|---|
\n"; - $content .= $gw; - $content .= " | \n"; - $content .= "\n"; - $content .= $config['interfaces'][lookup_gateway_interface_by_name($gw)]['descr']; - $content .= " | \n"; - $content .= "\n"; - $content .= lookup_gateway_ip_by_name($gw); - $content .= " | \n"; - $content .= "