From e7486d5fb23866c6c24fb489e196fedbbdaab77e Mon Sep 17 00:00:00 2001 From: crcro Date: Sun, 24 Dec 2017 22:19:22 +0200 Subject: [PATCH] webui: Wireless pages refresh (#7836) * initial release * updated to a more compact style, pagetitle fix --- html/pages/wireless.inc.php | 42 +++++++++----------- html/pages/wireless/sensors.inc.php | 59 +++++++++++++++++++++-------- 2 files changed, 61 insertions(+), 40 deletions(-) diff --git a/html/pages/wireless.inc.php b/html/pages/wireless.inc.php index 23e995a27a..e81ecd7e40 100644 --- a/html/pages/wireless.inc.php +++ b/html/pages/wireless.inc.php @@ -23,6 +23,8 @@ * @author Tony Murray */ +$pagetitle[] = "Wireless"; + use LibreNMS\Device\WirelessSensor; $sensors = dbFetchColumn('SELECT `sensor_class` FROM `wireless_sensors` GROUP BY `sensor_class`'); @@ -36,62 +38,52 @@ if (!$vars['view']) { $vars['view'] = "nographs"; } + $link_array = array('page' => 'wireless'); -$pagetitle[] = "Wireless"; - -print_optionbar_start('', ''); - -echo('Wireless » '); - +$linkoptions = 'Wireless » '; $sep = ''; foreach ($valid_wireless_types as $type => $details) { - echo($sep); + $linkoptions .= $sep; if ($class == $type) { - echo(""); + $linkoptions .= ''; } - echo(generate_link($details['short'], $link_array, array('metric'=> $type, 'view' => $vars['view']))); + $linkoptions .= generate_link($details['short'], $link_array, array('metric'=> $type, 'view' => $vars['view'])); if ($class == $type) { - echo(""); + $linkoptions .= ''; } $sep = ' | '; } - unset($sep); -echo('
'); - +$displayoptions = ''; if ($vars['view'] == "graphs") { - echo(''); + $displayoptions .= ''; } -echo(generate_link("Graphs", $link_array, array('metric'=> $class, 'view' => "graphs"))); +$displayoptions .= generate_link("Graphs", $link_array, array("metric"=> $class, "view" => "graphs")); if ($vars['view'] == "graphs") { - echo(''); + $displayoptions .= ''; } -echo(' | '); +$displayoptions .= ' | '; if ($vars['view'] != "graphs") { - echo(''); + $displayoptions .= ''; } -echo(generate_link("No Graphs", $link_array, array('metric'=> $class, 'view' => "nographs"))); +$displayoptions .= generate_link("No Graphs", $link_array, array("metric"=> $class, "view" => "nographs")); if ($vars['view'] != "graphs") { - echo(''); + $displayoptions .= ''; } -echo('
'); - -print_optionbar_end(); - if (isset($valid_wireless_types[$class])) { $graph_type = 'wireless_' . $class; $unit = $valid_wireless_types[$class]['unit']; - + $pagetitle[] = "Wireless :: ".$class; include $config['install_dir'] . '/html/pages/wireless/sensors.inc.php'; } else { echo("No sensors of type " . $class . " found."); diff --git a/html/pages/wireless/sensors.inc.php b/html/pages/wireless/sensors.inc.php index 76dd3c4fad..ae7226a3ed 100644 --- a/html/pages/wireless/sensors.inc.php +++ b/html/pages/wireless/sensors.inc.php @@ -1,19 +1,48 @@ -
- - - - - - - - - - - - -
DeviceSensorCurrentLow LimitHigh Limit
-
+ +
+
+
+
+ +
+
+ +
+
+
+
+ + + + + + + + + + + + +
DeviceSensorCurrentLow LimitHigh Limit
+
+