From 8bf309b808142d21aade10a40466403adf2001d7 Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Tue, 29 Sep 2009 19:56:44 +0200 Subject: layout improvement based on daniel's patch The page is divided into a header, content and footer. It is styled better and the header links to the main page. Patch from Daniel von Fange (Leancoder): http://pommi.nethuis.nl/storage/software/cgp/leancoder-css.cgp-v-0-1.patch --- detail.php | 2 +- host.php | 8 ++++---- inc/html.inc.php | 9 +++++++++ index.php | 4 ++-- layout/style.css | 28 +++++++++++++++++++++++++++- 5 files changed, 43 insertions(+), 8 deletions(-) diff --git a/detail.php b/detail.php index 3512716..d8bd4eb 100644 --- a/detail.php +++ b/detail.php @@ -15,7 +15,7 @@ $seconds = $_GET['s']; html_start(); -printf('

« %s

'."\n", +printf('

« %s

'."\n", $CONFIG['weburl'].'/host.php?h='.htmlentities($host), $host ); diff --git a/host.php b/host.php index aee29d8..e8979aa 100644 --- a/host.php +++ b/host.php @@ -9,7 +9,7 @@ $splugin = $_GET['p']; html_start(); -printf('

« %s

'."\n", $CONFIG['weburl'], $host); +printf('

« %s

'."\n", $CONFIG['weburl'], $host); $plugins = collectd_plugins($host); @@ -21,7 +21,7 @@ if(!$plugins) { # first the ones defined in overview foreach($CONFIG['overview'] as $plugin) { if (in_array($plugin, $plugins)) { - printf("

[-] %s

\n", $plugin); + printf("

[-] %s

\n", $plugin); graphs_from_plugin($host, $plugin); } } @@ -31,10 +31,10 @@ foreach($plugins as $plugin) { if (!in_array($plugin, $CONFIG['overview'])) { $url = sprintf('%s'."\n", $CONFIG['weburl'], $host, $plugin, $plugin); if ($splugin == $plugin) { - printf("

[-] %s

\n", $url); + printf("

[-] %s

\n", $url); graphs_from_plugin($host, $plugin); } else { - printf("

[+] %s

\n", $url); + printf("

[+] %s

\n", $url); } } } diff --git a/inc/html.inc.php b/inc/html.inc.php index 0a5b342..99ecef2 100644 --- a/inc/html.inc.php +++ b/inc/html.inc.php @@ -15,12 +15,21 @@ function html_start() { + + +
+ EOT; } function html_end() { echo << + EOT; diff --git a/index.php b/index.php index f937bcc..cf0cb85 100644 --- a/index.php +++ b/index.php @@ -10,7 +10,7 @@ $h = array(); # show all categorized hosts foreach($CONFIG['cat'] as $cat => $hosts) { - printf("

%s

\n", $cat); + printf("

%s

\n", $cat); host_summary($hosts); $h = array_merge($h, $hosts); } @@ -21,7 +21,7 @@ $uhosts = array_diff($chosts, $h); # show all uncategorized hosts if ($uhosts) { - echo "

uncategorized

\n"; + echo "

uncategorized

\n"; host_summary($uhosts); } diff --git a/layout/style.css b/layout/style.css index 08b6757..787069b 100644 --- a/layout/style.css +++ b/layout/style.css @@ -1,9 +1,35 @@ +body { + font-family: sans-serif; + margin: 0px; +} + +#header { + background: #4d79b5; + padding-left: 10px; +} + +#header a{ + display: block; + padding: 8px; + color: #fff; + text-decoration: none; +} + +#content, #footer{ + padding: 0px 20px 16px; +} + h1 { + margin-top: 0; + font-size: 1em; +} + +h2 { font-size: 1.5em; margin: 0.5em 0; } -h2 { +h3 { font-size: 1em; } -- cgit v1.1