From e6965765f58e9544d80dced002ef19ceb4db3766 Mon Sep 17 00:00:00 2001 From: Arjit Chaudhary Date: Mon, 21 Sep 2015 01:30:23 +0530 Subject: [PATCH] Various UI changes --- html/pages/device/alert-stats.inc.php | 2 +- html/pages/device/alerts.inc.php | 1 - html/pages/device/edit/alerts.inc.php | 2 +- html/pages/device/edit/apps.inc.php | 4 +- html/pages/device/health/diskio.inc.php | 34 +++++++-------- html/pages/device/health/mempool.inc.php | 26 ++++-------- html/pages/device/health/processor.inc.php | 27 ++++-------- html/pages/device/health/sensors.inc.php | 24 +++++------ html/pages/device/health/storage.inc.php | 27 ++++-------- html/pages/device/hrdevice.inc.php | 5 ++- html/pages/device/performance.inc.php | 26 ++++++------ html/pages/device/port/events.inc.php | 3 +- html/pages/device/port/graphs.inc.php | 48 ++++++++++++++++------ html/pages/device/ports.inc.php | 2 +- html/pages/device/ports/arp.inc.php | 2 +- 15 files changed, 108 insertions(+), 125 deletions(-) diff --git a/html/pages/device/alert-stats.inc.php b/html/pages/device/alert-stats.inc.php index 8c5eaaf79..ab9a0c57f 100644 --- a/html/pages/device/alert-stats.inc.php +++ b/html/pages/device/alert-stats.inc.php @@ -9,5 +9,5 @@ * option) any later version. Please see LICENSE.txt at the top level of * the source code distribution for details. */ -echo "
"; + require_once 'includes/print-graph-alerts.inc.php'; diff --git a/html/pages/device/alerts.inc.php b/html/pages/device/alerts.inc.php index bdde37582..ef355a841 100644 --- a/html/pages/device/alerts.inc.php +++ b/html/pages/device/alerts.inc.php @@ -11,6 +11,5 @@ * option) any later version. Please see LICENSE.txt at the top level of * the source code distribution for details. */ - require_once 'includes/common/alerts.inc.php'; echo implode('',$common_output); diff --git a/html/pages/device/edit/alerts.inc.php b/html/pages/device/edit/alerts.inc.php index 1465b686b..7320c94fc 100644 --- a/html/pages/device/edit/alerts.inc.php +++ b/html/pages/device/edit/alerts.inc.php @@ -107,4 +107,4 @@ require_once 'includes/modal/new_alert_rule.inc.php';
- + \ No newline at end of file diff --git a/html/pages/device/edit/apps.inc.php b/html/pages/device/edit/apps.inc.php index 9ed743de7..c885666df 100644 --- a/html/pages/device/edit/apps.inc.php +++ b/html/pages/device/edit/apps.inc.php @@ -62,7 +62,7 @@ echo "
- +
@@ -99,4 +99,4 @@ echo '
'; echo ''; echo '
'; -echo ''; +echo ''; \ No newline at end of file diff --git a/html/pages/device/health/diskio.inc.php b/html/pages/device/health/diskio.inc.php index dd425d273..b612d2d4a 100644 --- a/html/pages/device/health/diskio.inc.php +++ b/html/pages/device/health/diskio.inc.php @@ -1,13 +1,5 @@ '; - -// echo(" -// -// -// -// -// "); $row = 1; foreach (dbFetchRows('SELECT * FROM `ucd_diskio` WHERE device_id = ? ORDER BY diskio_descr', array($device['device_id'])) as $drive) { @@ -27,9 +19,7 @@ foreach (dbFetchRows('SELECT * FROM `ucd_diskio` WHERE device_id = ? ORDER BY di $graph_array_zoom['from'] = $config['time']['twoday']; $graph_array_zoom['to'] = $config['time']['now']; - echo "'; + $overlib_link = overlib_link($fs_url, $drive['diskio_descr'], generate_graph_tag($graph_array_zoom), null); $types = array( 'diskio_bits', @@ -37,18 +27,24 @@ foreach (dbFetchRows('SELECT * FROM `ucd_diskio` WHERE device_id = ? ORDER BY di ); foreach ($types as $graph_type) { - echo ''; + if($graph_array['type']=="diskio_ops") { + $graph_type_title="Ops/sec"; + } + if($graph_array['type']=="diskio_bits") { + $graph_type_title="bps"; + } + echo "
+
+

$overlib_link - $graph_type_title

+
"; + echo "
"; + include 'includes/print-graphrow.inc.php'; + echo '
'; } $row++; -} - -echo '
Enable Application
DriveUsageFree
"; - echo overlib_link($fs_url, $drive['diskio_descr'], generate_graph_tag($graph_array_zoom), null); - echo '
'; $graph_array = array(); $graph_array['id'] = $drive['diskio_id']; $graph_array['type'] = $graph_type; - - include 'includes/print-graphrow.inc.php'; - - echo '
'; +} \ No newline at end of file diff --git a/html/pages/device/health/mempool.inc.php b/html/pages/device/health/mempool.inc.php index e2a6eaa51..2cfbcd207 100644 --- a/html/pages/device/health/mempool.inc.php +++ b/html/pages/device/health/mempool.inc.php @@ -2,9 +2,6 @@ $graph_type = 'mempool_usage'; -echo "
"; -echo ''; - $i = '1'; // FIXME css alternating colours @@ -46,25 +43,16 @@ foreach (dbFetchRows('SELECT * FROM `mempools` WHERE device_id = ?', array($devi $right_background = $background['right']; $left_background = $background['left']; - echo " - - - - '; - - echo "'; + echo ""; $i++; -}//end foreach - -echo '
".$text_descr." - ".print_percentage_bar(400, 20, $perc, "$used / $total", 'ffffff', $left_background, $free, 'ffffff', $right_background).' - '.$perc.'%
"; - $graph_array['id'] = $mempool['mempool_id']; $graph_array['type'] = $graph_type; + echo "
+
+

$text_descr
$used/$total - $perc% used

+
"; + echo "
"; include 'includes/print-graphrow.inc.php'; - - echo '
'; -echo '
'; +}//end foreach \ No newline at end of file diff --git a/html/pages/device/health/processor.inc.php b/html/pages/device/health/processor.inc.php index 725e37c21..dd60448a3 100644 --- a/html/pages/device/health/processor.inc.php +++ b/html/pages/device/health/processor.inc.php @@ -2,9 +2,6 @@ $graph_type = 'processor_usage'; -echo "
"; -echo ''; - $i = '1'; foreach (dbFetchRows('SELECT * FROM `processors` WHERE device_id = ?', array($device['device_id'])) as $proc) { $proc_url = 'graphs/id='.$proc['processor_id'].'/type=processor_usage/'; @@ -18,26 +15,16 @@ foreach (dbFetchRows('SELECT * FROM `processors` WHERE device_id = ?', array($de $proc_popup = "onmouseover=\"return overlib('
".$device['hostname'].' - '.$text_descr; $proc_popup .= "
"; $proc_popup .= "', RIGHT".$config['overlib_defaults'].');" onmouseout="return nd();"'; - $percent = round($proc['processor_usage']); - $background = get_percentage_colours($percent); - - echo (" - - - - '); - - echo "
".$text_descr." - ".print_percentage_bar(400, 20, $percent, $percent.'%', 'ffffff', $background['left'], (100 - $percent).'%', 'ffffff', $background['right']).' -
"; - $graph_array['id'] = $proc['processor_id']; $graph_array['type'] = $graph_type; + echo "
+
+

$text_descr
$percent% used

+
"; + echo "
"; include 'includes/print-graphrow.inc.php'; -}//end foreach - -echo '
'; -echo '
'; + echo "
"; +}//end foreach \ No newline at end of file diff --git a/html/pages/device/health/sensors.inc.php b/html/pages/device/health/sensors.inc.php index 7e38a58f9..b8523a493 100644 --- a/html/pages/device/health/sensors.inc.php +++ b/html/pages/device/health/sensors.inc.php @@ -1,6 +1,6 @@ '; +//echo ''; $row = 1; @@ -11,24 +11,24 @@ foreach (dbFetchRows('SELECT * FROM `sensors` WHERE `sensor_class` = ? AND `devi else { $row_colour = $list_colour_b; } - - echo " - - - - - - \n"; - echo "'; + echo ''; $row++; } -echo '
".$sensor['sensor_descr'].''.$sensor['sensor_type'].''.format_si($sensor['sensor_current']).$unit.''.format_si($sensor['sensor_limit']).$unit.''.format_si($sensor['sensor_limit_low']).$unit."
"; + $sensor_descr = $sensor['sensor_descr']; + $sensor_current = format_si($sensor['sensor_current']).$unit; + $sensor_limit = format_si($sensor['sensor_limit']).$unit; + $sensor_limit_low = format_si($sensor['sensor_limit_low']).$unit; + echo "
+
+

$sensor_descr
$sensor_current | $sensor_limit_low <> $sensor_limit

+
"; + echo "
"; $graph_array['id'] = $sensor['sensor_id']; $graph_array['type'] = $graph_type; include 'includes/print-graphrow.inc.php'; - echo '
'; +//echo ''; diff --git a/html/pages/device/health/storage.inc.php b/html/pages/device/health/storage.inc.php index d5f330c07..e65217457 100644 --- a/html/pages/device/health/storage.inc.php +++ b/html/pages/device/health/storage.inc.php @@ -2,15 +2,6 @@ $graph_type = 'storage_usage'; -echo ''; - -echo ' - - - - - '; - $row = 1; foreach (dbFetchRows('SELECT * FROM `storage` WHERE device_id = ? ORDER BY storage_descr', array($device['device_id'])) as $drive) { @@ -28,6 +19,7 @@ foreach (dbFetchRows('SELECT * FROM `storage` WHERE device_id = ? ORDER BY stora $used = formatStorage($used); $total = formatStorage($total); $free = formatStorage($free); + $storage_descr = $drive['storage_descr']; $fs_url = 'graphs/id='.$drive['storage_id'].'/type=storage_usage/'; @@ -35,22 +27,17 @@ foreach (dbFetchRows('SELECT * FROM `storage` WHERE device_id = ? ORDER BY stora $fs_popup .= ""; $fs_popup .= "', RIGHT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\""; - $background = get_percentage_colours($percent); - - echo "'; $graph_array['id'] = $drive['storage_id']; $graph_array['type'] = $graph_type; - echo "'; + echo ""; $row++; }//end foreach - -echo '
DriveUsageFree
".$drive['storage_descr']." - ".print_percentage_bar(400, 20, $perc, "$used / $total", 'ffffff', $background['left'], $perc.'%', 'ffffff', $background['right']).' - '.$free.'
"; - + echo "
+
+

$storage_descr
$used/$total - $perc% used

+
"; + echo "
"; include 'includes/print-graphrow.inc.php'; - - echo '
'; diff --git a/html/pages/device/hrdevice.inc.php b/html/pages/device/hrdevice.inc.php index 4b92a907c..e792f29ce 100644 --- a/html/pages/device/hrdevice.inc.php +++ b/html/pages/device/hrdevice.inc.php @@ -1,6 +1,7 @@ '; +echo '

Inventory

'; +echo '
'; +echo ''; // FIXME missing heading foreach (dbFetchRows('SELECT * FROM `hrDevice` WHERE `device_id` = ? ORDER BY `hrDeviceIndex`', array($device['device_id'])) as $hrdevice) { diff --git a/html/pages/device/performance.inc.php b/html/pages/device/performance.inc.php index dd5d15194..b03c7b696 100644 --- a/html/pages/device/performance.inc.php +++ b/html/pages/device/performance.inc.php @@ -35,19 +35,19 @@ if (empty($vars['dtpickerto'])) { ?>
-
-
-
- - -
-
- - -
- - -
+
+
+
+ + +
+
+ + +
+ + +