Commit 2d1f2af5 authored by Franco Fichtner's avatar Franco Fichtner

system/settings/rrd: prune unneeded settings

Makes the file very light, best to be merged into misc settings.
parent df81ae81
...@@ -32,26 +32,6 @@ require_once("rrd.inc"); ...@@ -32,26 +32,6 @@ require_once("rrd.inc");
require_once("interfaces.inc"); require_once("interfaces.inc");
$pconfig['enable'] = isset($config['rrd']['enable']); $pconfig['enable'] = isset($config['rrd']['enable']);
$pconfig['category'] = $config['rrd']['category'];
$pconfig['style'] = $config['rrd']['style'];
$pconfig['period'] = $config['rrd']['period'];
$curcat = "settings";
$categories = array('system' => gettext("System"),
'traffic' => gettext("Traffic"),
'packets' => gettext("Packets"),
'quality' => gettext("Quality"),
'captiveportal' => gettext("Captive Portal"));
if(isset($config['ntpd']['statsgraph'])) {
$categories['ntpd'] = gettext("NTP");
}
$styles = array('inverse' => gettext("Inverse"),
'absolute' => gettext("Absolute"));
$periods = array("absolute" => gettext("Absolute Timespans"),
"current" => gettext("Current Period"),
"previous" => gettext("Previous Period"));
if ($_POST['ResetRRD']) { if ($_POST['ResetRRD']) {
mwexec('/bin/rm /var/db/rrd/*'); mwexec('/bin/rm /var/db/rrd/*');
...@@ -67,9 +47,6 @@ if ($_POST['ResetRRD']) { ...@@ -67,9 +47,6 @@ if ($_POST['ResetRRD']) {
if (!$input_errors) { if (!$input_errors) {
$config['rrd']['enable'] = $_POST['enable'] ? true : false; $config['rrd']['enable'] = $_POST['enable'] ? true : false;
$config['rrd']['category'] = $_POST['category'];
$config['rrd']['style'] = $_POST['style'];
$config['rrd']['period'] = $_POST['period'];
write_config(); write_config();
$retval = 0; $retval = 0;
...@@ -78,27 +55,6 @@ if ($_POST['ResetRRD']) { ...@@ -78,27 +55,6 @@ if ($_POST['ResetRRD']) {
} }
} }
$rrddbpath = "/var/db/rrd/";
chdir($rrddbpath);
$databases = glob("*.rrd");
foreach($databases as $database) {
if(stristr($database, "wireless")) {
$wireless = true;
}
if(stristr($database, "-cellular") && !empty($config['ppps'])) {
$cellular = true;
}
if(stristr($database, "-vpnusers")) {
$vpnusers = true;
}
if(stristr($database, "captiveportal-") && is_array($config['captiveportal'])) {
$captiveportal = true;
}
}
$pgtitle = array(gettext('System'), gettext('Settings'), gettext('RRD Graphs')); $pgtitle = array(gettext('System'), gettext('Settings'), gettext('RRD Graphs'));
include("head.inc"); include("head.inc");
...@@ -136,51 +92,6 @@ include("head.inc"); ...@@ -136,51 +92,6 @@ include("head.inc");
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vtable"><?=gettext("Default category");?></td>
<td width="78%" class="vtable">
<select name="category" id="category" class="form-control" style="z-index: -10;" >
<?php
foreach ($categories as $category => $categoryd) {
echo "<option value=\"$category\"";
if ($category == $pconfig['category']) echo " selected=\"selected\"";
echo ">" . htmlspecialchars($categoryd) . "</option>\n";
}
?>
</select>
<p class="text-muted"><em><small><?=gettext("This selects default category.");?></small></em></p>
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vtable"><?=gettext("Default style");?></td>
<td width="78%" class="vtable">
<select name="style" class="form-control" style="z-index: -10;" >
<?php
foreach ($styles as $style => $styled) {
echo "<option value=\"$style\"";
if ($style == $pconfig['style']) echo " selected=\"selected\"";
echo ">" . htmlspecialchars($styled) . "</option>\n";
}
?>
</select>
<p class="text-muted"><em><small><?=gettext("This selects the default style.");?></small></em></p>
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vtable"><?=gettext("Default period");?></td>
<td width="78%" class="vtable">
<select name="period" class="form-control" style="z-index: -10;" >
<?php
foreach ($periods as $period => $periodd) {
echo "<option value=\"$period\"";
if ($period == $pconfig['period']) echo " selected=\"selected\"";
echo ">" . htmlspecialchars($periodd) . "</option>\n";
}
?>
</select>
<p class="text-muted"><em><small><?=gettext("This selects the default period.");?></small></em></p>
</td>
</tr>
<tr>
<td width="22%" valign="top">&nbsp;</td> <td width="22%" valign="top">&nbsp;</td>
<td width="78%"> <td width="78%">
<input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save");?>" onclick="enable_change(true)" /> <input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save");?>" onclick="enable_change(true)" />
......
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