From f1df36e526aecf06f7cb880a56ddad8ad91fd994 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Fri, 15 May 2015 12:12:55 +0545 Subject: Code style WWW Status RRD --- usr/local/www/status_rrd_graph_settings.php | 341 ++++++++++++++++------------ 1 file changed, 198 insertions(+), 143 deletions(-) (limited to 'usr/local/www/status_rrd_graph_settings.php') diff --git a/usr/local/www/status_rrd_graph_settings.php b/usr/local/www/status_rrd_graph_settings.php index 2477a75..ef35951 100644 --- a/usr/local/www/status_rrd_graph_settings.php +++ b/usr/local/www/status_rrd_graph_settings.php @@ -28,7 +28,7 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* +/* pfSense_BUILDER_BINARIES: /usr/bin/find pfSense_MODULE: system */ @@ -52,21 +52,21 @@ $pconfig['period'] = $config['rrd']['period']; $curcat = "settings"; $categories = array('system' => gettext("System"), - 'traffic' => gettext("Traffic"), - 'packets' => gettext("Packets"), - 'quality' => gettext("Quality"), - 'queues' => gettext("Queues"), - 'captiveportal' => gettext("Captive Portal")); + 'traffic' => gettext("Traffic"), + 'packets' => gettext("Packets"), + 'quality' => gettext("Quality"), + 'queues' => gettext("Queues"), + 'captiveportal' => gettext("Captive Portal")); -if(isset($config['ntpd']['statsgraph'])) { +if (isset($config['ntpd']['statsgraph'])) { $categories['ntpd'] = gettext("NTP"); } $styles = array('inverse' => gettext("Inverse"), - 'absolute' => gettext("Absolute")); + 'absolute' => gettext("Absolute")); $periods = array("absolute" => gettext("Absolute Timespans"), - "current" => gettext("Current Period"), - "previous" => gettext("Previous Period")); + "current" => gettext("Current Period"), + "previous" => gettext("Previous Period")); if ($_POST['ResetRRD']) { mwexec('/bin/rm /var/db/rrd/*'); @@ -80,39 +80,37 @@ if ($_POST['ResetRRD']) { /* input validation */ /* none */ - if (!$input_errors) { - $config['rrd']['enable'] = $_POST['enable'] ? true : false; - $config['rrd']['category'] = $_POST['category']; - $config['rrd']['style'] = $_POST['style']; - $config['rrd']['period'] = $_POST['period']; - write_config(); + if (!$input_errors) { + $config['rrd']['enable'] = $_POST['enable'] ? true : false; + $config['rrd']['category'] = $_POST['category']; + $config['rrd']['style'] = $_POST['style']; + $config['rrd']['period'] = $_POST['period']; + write_config(); - $retval = 0; - $retval = enable_rrd_graphing(); - $savemsg = get_std_save_message($retval); + $retval = 0; + $retval = enable_rrd_graphing(); + $savemsg = get_std_save_message($retval); } } - - $rrddbpath = "/var/db/rrd/"; chdir($rrddbpath); $databases = glob("*.rrd"); -foreach($databases as $database) { - if(stristr($database, "wireless")) { +foreach ($databases as $database) { + if (stristr($database, "wireless")) { $wireless = true; } - if(stristr($database, "queues")) { + if (stristr($database, "queues")) { $queues = true; } - if(stristr($database, "-cellular") && !empty($config['ppps'])) { + if (stristr($database, "-cellular") && !empty($config['ppps'])) { $cellular = true; } - if(stristr($database, "-vpnusers")) { + if (stristr($database, "-vpnusers")) { $vpnusers = true; } - if(stristr($database, "captiveportal-") && is_array($config['captiveportal'])) { + if (stristr($database, "captiveportal-") && is_array($config['captiveportal'])) { $captiveportal = true; } } @@ -126,135 +124,192 @@ include("head.inc");
- - - + + + + +
+ + + - - - - -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- onclick="enable_change(false)" /> - -
- - -
- - -
- - -
  - " onclick="enable_change(true)" /> -
  - " onclick="return confirm('')" /> -
 
- -
-
-
+ $tab_array[] = array("NTP", $tabactive, "status_rrd_graph.php?cat=ntpd"); + } + if ($curcat == "custom") { + $tabactive = True; + } else { + $tabactive = False; + } + $tab_array[] = array(gettext("Custom"), $tabactive, "status_rrd_graph.php?cat=custom"); + if ($curcat == "settings") { + $tabactive = True; + } else { + $tabactive = False; + } + $tab_array[] = array(gettext("Settings"), $tabactive, "status_rrd_graph_settings.php"); + display_top_tabs($tab_array); + ?> +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ onclick="enable_change(false)" /> + +
+ + +
+ + +
+ + +
  + " onclick="enable_change(true)" /> +
  + " onclick="return confirm('')" /> +
 
+ +
+
+
-- cgit v1.1