From 2b047f62b69de2745ae78f60f75ecf65a4bd6df8 Mon Sep 17 00:00:00 2001 From: Paul Gear Date: Sat, 14 Jun 2014 07:55:17 +1000 Subject: [PATCH 1/4] Start at fixing up front page and moving top 10 into plugins --- html/includes/device-header.inc.php | 2 + html/includes/device-summary-horiz.inc.php | 45 ++++++++++++ html/includes/header.inc.php | 69 ------------------- .../{topnav.inc.php => object-cache.inc.php} | 51 -------------- html/pages/front/default.php | 4 +- 5 files changed, 49 insertions(+), 122 deletions(-) create mode 100644 html/includes/device-summary-horiz.inc.php delete mode 100644 html/includes/header.inc.php rename html/includes/{topnav.inc.php => object-cache.inc.php} (74%) diff --git a/html/includes/device-header.inc.php b/html/includes/device-header.inc.php index fc885958b..2ff0a0990 100644 --- a/html/includes/device-header.inc.php +++ b/html/includes/device-header.inc.php @@ -1,5 +1,7 @@ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 TotalUpDownIgnoredDisabled
Devices up down ignored disabled
Ports up down ignored shutdown
Services up down ignored disabled
+
diff --git a/html/includes/header.inc.php b/html/includes/header.inc.php deleted file mode 100644 index 0745a2618..000000000 --- a/html/includes/header.inc.php +++ /dev/null @@ -1,69 +0,0 @@ - -
- - - - -
- -Report Bug | '); -$toggle_url = preg_replace('/(\?|\&)widescreen=(yes|no)/', '', $_SERVER['REQUEST_URI']); -if (strstr($toggle_url,'?')) { $toggle_url .= '&'; } else { $toggle_url .= '?'; } - -if($_SESSION['widescreen'] === 1) -{ - echo('Normal width | '); -} else { - echo('Widescreen | '); -} - -if ($_SESSION['authenticated']) -{ - echo("Logged in as ".$_SESSION['username'].""); -} else { - echo("Not logged in!"); -} - -if (Net_IPv6::checkIPv6($_SERVER['REMOTE_ADDR'])) -{ - echo(' via IPv6'); -} else { - echo(' via IPv4'); -} - -if ($_SESSION['authenticated']) -{ - echo(" (Logout)"); -} -?> - -
-
- - -
-
- - - diff --git a/html/includes/topnav.inc.php b/html/includes/object-cache.inc.php similarity index 74% rename from html/includes/topnav.inc.php rename to html/includes/object-cache.inc.php index b8b3de42d..3377961ba 100644 --- a/html/includes/topnav.inc.php +++ b/html/includes/object-cache.inc.php @@ -69,54 +69,3 @@ if ($ports['down']) { $ports['bgcolour'] = "#ffcccc"; } else { $ports['bgcolo if ($services['down']) { $services['bgcolour'] = "#ffcccc"; } else { $services['bgcolour'] = "transparent"; } ?> -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 TotalUpDownIgnoredDisabled
Devices up down ignored disabled
Ports up down ignored shutdown
Services up down ignored disabled
-
-
-
-   -
-
-
diff --git a/html/pages/front/default.php b/html/pages/front/default.php index 670b0365e..c18636310 100644 --- a/html/pages/front/default.php +++ b/html/pages/front/default.php @@ -1,6 +1,6 @@ '); -include_once("includes/front/boxes.inc.php"); +include_once("includes/device-summary-horiz.inc.php"); echo(' From 20ca66919bcfa6891653dea512c960a8b36f6dc9 Mon Sep 17 00:00:00 2001 From: Paul Gear Date: Sat, 14 Jun 2014 08:05:29 +1000 Subject: [PATCH 2/4] Remove unused reference to web_header --- includes/defaults.inc.php | 1 - 1 file changed, 1 deletion(-) diff --git a/includes/defaults.inc.php b/includes/defaults.inc.php index 3403c30ad..61d8700b7 100644 --- a/includes/defaults.inc.php +++ b/includes/defaults.inc.php @@ -116,7 +116,6 @@ $config['page_title_prefix'] = ""; $config['page_title_suffix'] = $config['project_name']; $config['timestamp_format'] = 'd-m-Y H:i:s'; $config['page_gen'] = 0; # display MySqL & PHP stats in footer? -$config['web_header'] = "header.inc.php"; # in html/includes $config['login_message'] = "Unauthorised access or use shall render the user liable to criminal and/or civil prosecution."; $config['old_graphs'] = 1; // RRDfiles from before the great rra reform. This is default for a while. From 968a6ee9c4cf5c97f2959baf11a89f3ea10969c9 Mon Sep 17 00:00:00 2001 From: Paul Gear Date: Sat, 14 Jun 2014 09:31:22 +1000 Subject: [PATCH 3/4] Add vertical option for summary --- html/includes/device-summary-vert.inc.php | 59 +++++++++++++++++++++++ html/pages/front/default.php | 13 +++-- includes/defaults.inc.php | 1 + 3 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 html/includes/device-summary-vert.inc.php diff --git a/html/includes/device-summary-vert.inc.php b/html/includes/device-summary-vert.inc.php new file mode 100644 index 000000000..7a2086bf6 --- /dev/null +++ b/html/includes/device-summary-vert.inc.php @@ -0,0 +1,59 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SummaryDevicesPortsServices
Up
Down
Ignored
Disabled/Shutdown
Total
+
diff --git a/html/pages/front/default.php b/html/pages/front/default.php index c18636310..5cb434407 100644 --- a/html/pages/front/default.php +++ b/html/pages/front/default.php @@ -11,7 +11,7 @@ echo("
echo('
-
+
'); echo('
'); @@ -121,10 +121,17 @@ echo('
'); echo('
'); echo('
'); echo(' -
+
'); -include_once("includes/device-summary-horiz.inc.php"); +if ($config['vertical_summary']) +{ + include_once("includes/device-summary-vert.inc.php"); +} +else +{ + include_once("includes/device-summary-horiz.inc.php"); +} echo('
diff --git a/includes/defaults.inc.php b/includes/defaults.inc.php index 61d8700b7..1256d42db 100644 --- a/includes/defaults.inc.php +++ b/includes/defaults.inc.php @@ -110,6 +110,7 @@ $config['page_refresh'] = "300"; // Refresh the page every xx seconds, 0 to $config['front_page'] = "pages/front/default.php"; $config['front_page_settings']['top']['ports'] = 10; $config['front_page_settings']['top']['devices'] = 10; +$config['vertical_summary'] = 0; // Enable to use vertical summary on front page instead of horizontal $config['top_ports'] = 1; // This enables the top X ports box $config['top_devices'] = 1; // This enables the top X devices box $config['page_title_prefix'] = ""; From 608966e2ab9b4f96f1316c1f5614796a1961b76d Mon Sep 17 00:00:00 2001 From: Paul Gear Date: Sat, 14 Jun 2014 14:58:17 +1000 Subject: [PATCH 4/4] Remove accidental appearance of object cache --- html/includes/device-header.inc.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/html/includes/device-header.inc.php b/html/includes/device-header.inc.php index 2ff0a0990..fc885958b 100644 --- a/html/includes/device-header.inc.php +++ b/html/includes/device-header.inc.php @@ -1,7 +1,5 @@