Commit c23950b0 authored by Jos Schellevis's avatar Jos Schellevis

Fix traffic graph widget

parent 727453c0
......@@ -530,7 +530,7 @@ echo $jscriptstr;
?>
<section class="col-xs-12 col-md-6 widgetdiv" id="<?php echo $widgetname;?>" style="display:<?php echo $divdisplay; ?>;">
<div class="content-box">
<form action="<?=$_SERVER['REQUEST_URI'];?>" method="post" id="iform">
<form action="<?=$_SERVER['REQUEST_URI'];?>" method="post" id="iform">
<input type="hidden" value="" name="sequence" id="sequence" />
<header class="content-box-head container-fluid">
......
function trafficshowDiv(e,t){selectedDiv=e+"graphdiv",jQuery("#"+selectedDiv).show(),d=document,t&&(selectIntLink=selectedDiv+"-min",textlink=d.getElementById(selectIntLink),textlink.style.display="inline",selectIntLink=selectedDiv+"-open",textlink=d.getElementById(selectIntLink),textlink.style.display="none")}function trafficminimizeDiv(e,t){selectedDiv=e+"graphdiv",jQuery("#"+selectedDiv).hide(),d=document,t&&(selectIntLink=selectedDiv+"-open",textlink=d.getElementById(selectIntLink),textlink.style.display="inline",selectIntLink=selectedDiv+"-min",textlink=d.getElementById(selectIntLink),textlink.style.display="none")}
\ No newline at end of file
function trafficshowDiv(incDiv,swapButtons){
//appear element
selectedDiv = incDiv + "graphdiv";
jQuery('#' + selectedDiv).show();
jQuery('#' + selectedDiv).show();
d = document;
if (swapButtons){
selectIntLink = selectedDiv + "-min";
......@@ -12,6 +12,7 @@ function trafficshowDiv(incDiv,swapButtons){
textlink = d.getElementById(selectIntLink);
textlink.style.display = "none";
}
document.iform["shown[" + incDiv + "]"].value = "show";
}
function trafficminimizeDiv(incDiv,swapButtons){
......@@ -28,5 +29,6 @@ function trafficminimizeDiv(incDiv,swapButtons){
textlink = d.getElementById(selectIntLink);
textlink.style.display = "none";
}
document.iform["shown[" + incDiv + "]"].value = "hide";
}
......@@ -38,6 +38,12 @@ require_once("pfsense-utils.inc");
require_once("functions.inc");
$first_time = false;
//var_dump($config["widgets"]["trafficgraphs"]);
//$config["widgets"]["trafficgraphs"]["shown"]["item"][1]="lan";
//write_config(gettext("Widget configuration has been changed."));
if (!is_array($config["widgets"]["trafficgraphs"])) {
$first_time = true;
$config["widgets"]["trafficgraphs"] = array();
......@@ -56,6 +62,7 @@ if (isset($config['ipsec']['enable']))
$ifdescrs['enc0'] = "IPsec";
if ($_POST) {
if (isset($_POST["refreshinterval"])) {
$a_config["refreshinterval"] = $_POST["refreshinterval"];
}
......@@ -100,12 +107,13 @@ if (isset($a_config["scale_type"])) {
<div id="traffic_graphs-settings" class="widgetconfigdiv" style="display:none;">
<form action="/widgets/widgets/traffic_graphs.widget.php" method="post" name="iform" id="iform">
<?php foreach ($ifdescrs as $ifname => $ifdescr) { ?>
<input type="hidden" name="shown[<?= $ifname ?>]" value="<?= $shown[$ifname] ? "show" : "hide" ?>" />
<?php } ?>
<table class="table table-striped">
<tbody>
<?php foreach ($ifdescrs as $ifname => $ifdescr) { ?>
<input type="hidden" name="shown[<?= $ifname ?>]" value="<?= $shown[$ifname] ? "show" : "hide" ?>" />
<?php } ?>
<tr>
<td>
Default AutoScale:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment