aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorPim van den Berg2009-09-29 19:56:44 +0200
committerPim van den Berg2009-09-29 20:06:19 +0200
commit8bf309b808142d21aade10a40466403adf2001d7 (patch)
treef584b93a3a8fdd42782c29661fe906455ad15483
parentchange webdir/weburl and include/require usage (diff)
downloadapt-panopticon_cgp-8bf309b808142d21aade10a40466403adf2001d7.zip
apt-panopticon_cgp-8bf309b808142d21aade10a40466403adf2001d7.tar.gz
apt-panopticon_cgp-8bf309b808142d21aade10a40466403adf2001d7.tar.bz2
apt-panopticon_cgp-8bf309b808142d21aade10a40466403adf2001d7.tar.xz
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
-rw-r--r--detail.php2
-rw-r--r--host.php8
-rw-r--r--inc/html.inc.php9
-rw-r--r--index.php4
-rw-r--r--layout/style.css28
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'];
15 15
16html_start(); 16html_start();
17 17
18printf('<h1><a href="%s">&laquo;</a> %s</h1>'."\n", 18printf('<h2><a href="%s">&laquo;</a> %s</h2>'."\n",
19 $CONFIG['weburl'].'/host.php?h='.htmlentities($host), $host 19 $CONFIG['weburl'].'/host.php?h='.htmlentities($host), $host
20); 20);
21 21
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'];
9 9
10html_start(); 10html_start();
11 11
12printf('<h1><a href="%s">&laquo;</a> %s</h1>'."\n", $CONFIG['weburl'], $host); 12printf('<h2><a href="%s">&laquo;</a> %s</h2>'."\n", $CONFIG['weburl'], $host);
13 13
14$plugins = collectd_plugins($host); 14$plugins = collectd_plugins($host);
15 15
@@ -21,7 +21,7 @@ if(!$plugins) {
21# first the ones defined in overview 21# first the ones defined in overview
22foreach($CONFIG['overview'] as $plugin) { 22foreach($CONFIG['overview'] as $plugin) {
23 if (in_array($plugin, $plugins)) { 23 if (in_array($plugin, $plugins)) {
24 printf("<h2>[-] %s</h2>\n", $plugin); 24 printf("<h3>[-] %s</h3>\n", $plugin);
25 graphs_from_plugin($host, $plugin); 25 graphs_from_plugin($host, $plugin);
26 } 26 }
27} 27}
@@ -31,10 +31,10 @@ foreach($plugins as $plugin) {
31 if (!in_array($plugin, $CONFIG['overview'])) { 31 if (!in_array($plugin, $CONFIG['overview'])) {
32 $url = sprintf('<a href="%s/host.php?h=%s&p=%s">%s</a>'."\n", $CONFIG['weburl'], $host, $plugin, $plugin); 32 $url = sprintf('<a href="%s/host.php?h=%s&p=%s">%s</a>'."\n", $CONFIG['weburl'], $host, $plugin, $plugin);
33 if ($splugin == $plugin) { 33 if ($splugin == $plugin) {
34 printf("<h2>[-] %s</h2>\n", $url); 34 printf("<h3>[-] %s</h3>\n", $url);
35 graphs_from_plugin($host, $plugin); 35 graphs_from_plugin($host, $plugin);
36 } else { 36 } else {
37 printf("<h2>[+] %s</h2>\n", $url); 37 printf("<h3>[+] %s</h3>\n", $url);
38 } 38 }
39 } 39 }
40} 40}
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() {
15</head> 15</head>
16<body> 16<body>
17 17
18<div id="header">
19 <h1><a href="{$CONFIG['weburl']}">Collectd Graph Panel</a></h1>
20</div>
21
22<div id="content">
23
18EOT; 24EOT;
19} 25}
20 26
21function html_end() { 27function html_end() {
22 echo <<<EOT 28 echo <<<EOT
29</div>
30<div id="footer">
23<hr><span class="small">Collectd Graph Panel is distributed under the GNU General Public License (GPL)</span> 31<hr><span class="small">Collectd Graph Panel is distributed under the GNU General Public License (GPL)</span>
32</div>
24</body> 33</body>
25</html> 34</html>
26EOT; 35EOT;
diff --git a/index.php b/index.php
index f937bcc..cf0cb85 100644
--- a/index.php
+++ b/index.php
@@ -10,7 +10,7 @@ $h = array();
10 10
11# show all categorized hosts 11# show all categorized hosts
12foreach($CONFIG['cat'] as $cat => $hosts) { 12foreach($CONFIG['cat'] as $cat => $hosts) {
13 printf("<h1>%s</h1>\n", $cat); 13 printf("<h2>%s</h2>\n", $cat);
14 host_summary($hosts); 14 host_summary($hosts);
15 $h = array_merge($h, $hosts); 15 $h = array_merge($h, $hosts);
16} 16}
@@ -21,7 +21,7 @@ $uhosts = array_diff($chosts, $h);
21 21
22# show all uncategorized hosts 22# show all uncategorized hosts
23if ($uhosts) { 23if ($uhosts) {
24 echo "<h1>uncategorized</h1>\n"; 24 echo "<h2>uncategorized</h2>\n";
25 host_summary($uhosts); 25 host_summary($uhosts);
26} 26}
27 27
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 @@
1body {
2 font-family: sans-serif;
3 margin: 0px;
4}
5
6#header {
7 background: #4d79b5;
8 padding-left: 10px;
9}
10
11#header a{
12 display: block;
13 padding: 8px;
14 color: #fff;
15 text-decoration: none;
16}
17
18#content, #footer{
19 padding: 0px 20px 16px;
20}
21
1h1 { 22h1 {
23 margin-top: 0;
24 font-size: 1em;
25}
26
27h2 {
2 font-size: 1.5em; 28 font-size: 1.5em;
3 margin: 0.5em 0; 29 margin: 0.5em 0;
4} 30}
5 31
6h2 { 32h3 {
7 font-size: 1em; 33 font-size: 1em;
8} 34}
9 35