Feature #2994 » traffic_graphs.widget.php.patch
| traffic_graphs.widget.php 2013-05-14 20:45:11.000000000 -0400 | ||
|---|---|---|
| 59 | 59 |
if (isset($_POST["refreshinterval"])) {
|
| 60 | 60 |
$a_config["refreshinterval"] = $_POST["refreshinterval"]; |
| 61 | 61 |
} |
| 62 |
if (isset($_POST["scale_type"])) {
|
|
| 63 |
$a_config["scale_type"] = $_POST["scale_type"]; |
|
| 64 |
} |
|
| 62 | 65 |
$a_config["shown"]["item"] = array(); |
| 63 | 66 |
foreach ($ifdescrs as $ifname => $ifdescr) {
|
| 64 | 67 |
$state = $_POST["shown"][$ifname]; |
| ... | ... | |
| 86 | 89 |
$refreshinterval = 10; |
| 87 | 90 |
} |
| 88 | 91 | |
| 92 |
if (isset($a_config["scale_type"])) {
|
|
| 93 |
$scale_type = $a_config["scale_type"]; |
|
| 94 |
} else {
|
|
| 95 |
$scale_type = up; |
|
| 96 |
} |
|
| 97 | ||
| 89 | 98 |
?> |
| 90 | 99 |
<input type="hidden" id="traffic_graphs-config" name="traffic_graphs-config" value=""> |
| 91 | 100 | |
| ... | ... | |
| 100 | 109 |
<?php foreach ($ifdescrs as $ifname => $ifdescr) { ?>
|
| 101 | 110 |
<input type="hidden" name="shown[<?= $ifname ?>]" value="<?= $shown[$ifname] ? "show" : "hide" ?>" /> |
| 102 | 111 |
<?php } ?> |
| 112 |
Default AutoScale: |
|
| 113 |
<?php |
|
| 114 |
$scale_type_up="checked"; |
|
| 115 |
$scale_type_follow="unchecked"; |
|
| 116 |
if (isset($config["widgets"]["trafficgraphs"]["scale_type"])) {
|
|
| 117 |
$selected_radio = $config["widgets"]["trafficgraphs"]["scale_type"]; |
|
| 118 |
if ($selected_radio == "up") {
|
|
| 119 |
$scale_type_up = "checked"; |
|
| 120 |
} |
|
| 121 |
else if ($selected_radio == "follow") {
|
|
| 122 |
$scale_type_follow = "checked"; |
|
| 123 |
} |
|
| 124 |
} |
|
| 125 |
?> |
|
| 126 |
<input name="scale_type" class="radio" type="radio" id="scale_type" value="up" <?php echo $scale_type_up; ?> onchange="updateGraphDisplays();" /> <span>up</span> |
|
| 127 |
<input name="scale_type" class="radio" type="radio" id="scale_type" value="follow" <?php echo $scale_type_follow; ?> onchange="updateGraphDisplays();" /> <span>follow</span><br><br> |
|
| 103 | 128 |
Refresh Interval: |
| 104 | 129 |
<select name="refreshinterval" class="formfld" id="refreshinterval" onchange="updateGraphDisplays();"> |
| 105 | 130 |
<?php for ($i = 1; $i <= 10; $i += 1) { ?>
|