$setting) { if (!isset($setting['disable'])) { $ifdescrs['ovpn' . substr($mode, 0, 1) . $setting['vpnid']] = gettext("OpenVPN") . " ".$mode.": ".htmlspecialchars($setting['description']); } } } } if ($_POST['if']) { $curif = $_POST['if']; $found = false; foreach ($ifdescrs as $descr => $ifdescr) { if ($descr == $curif) { $found = true; break; } } if ($found === false) { header("Location: status_graph.php"); exit; } } else { if (empty($ifdescrs["wan"])) { /* Handle the case when WAN has been disabled. Use the first key in ifdescrs. */ reset($ifdescrs); $curif = key($ifdescrs); } else { $curif = "wan"; } } if ($_POST['sort']) { $cursort = $_POST['sort']; } else { $cursort = ""; } if ($_POST['filter']) { $curfilter = $_POST['filter']; } else { $curfilter = ""; } if ($_POST['hostipformat']) { $curhostipformat = $_POST['hostipformat']; } else { $curhostipformat = ""; } function iflist() { global $ifdescrs; $iflist = array(); foreach ($ifdescrs as $ifn => $ifd) { $iflist[$ifn] = $ifd; } return($iflist); } $pgtitle = array(gettext("Status"),gettext("Traffic Graph")); include("head.inc"); $form = new Form(false); $form->addClass('auto-submit'); $section = new Form_Section('Graph settings'); $group = new Form_Group(''); $group->add(new Form_Select( 'if', null, $curif, iflist() ))->setHelp('Interface'); $group->add(new Form_Select( 'sort', null, $cursort, array ( 'in' => 'Bandwidth In', 'out' => 'Bandwidth Out' ) ))->setHelp('Sort by'); $group->add(new Form_Select( 'filter', null, $curfilter, array ( 'local' => 'Local', 'remote'=> 'Remote', 'all' => 'All' ) ))->setHelp('Filter'); $group->add(new Form_Select( 'hostipformat', null, $curhostipformat, array ( '' => 'IP Address', 'hostname' => 'Host Name', 'fqdn' => 'FQDN' ) ))->setHelp('Display'); $section->add($group); $form->add($section); print $form; ?>
=(($curhostipformat=="") ? gettext("Host IP") : gettext("Host Name or IP")); ?> | =gettext("Bandwidth In"); ?> | =gettext("Bandwidth Out"); ?> |
---|