$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' => gettext('Bandwidth In'), 'out' => gettext('Bandwidth Out') ) ))->setHelp('Sort by'); $group->add(new Form_Select( 'filter', null, $curfilter, array ( 'local' => gettext('Local'), 'remote'=> gettext('Remote'), 'all' => gettext('All') ) ))->setHelp('Filter'); $group->add(new Form_Select( 'hostipformat', null, $curhostipformat, array ( '' => gettext('IP Address'), 'hostname' => gettext('Host Name'), 'descr' => gettext('Description'), 'fqdn' => gettext('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"); ?> |
---|