aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/detail.php
diff options
context:
space:
mode:
Diffstat (limited to 'detail.php')
-rw-r--r--detail.php40
1 files changed, 26 insertions, 14 deletions
diff --git a/detail.php b/detail.php
index 503a411..20f250a 100644
--- a/detail.php
+++ b/detail.php
@@ -21,11 +21,29 @@ $width = GET('x');
21$heigth = GET('y'); 21$heigth = GET('y');
22$seconds = GET('s'); 22$seconds = GET('s');
23 23
24if (!$plugin) {
25 $selected_plugins = $CONFIG['overview'];
26}
27else {
28 $selected_plugins = array($plugin);
29}
30
24html_start(); 31html_start();
25 32
26printf('<h2><a href="%s">%s</a></h2>'."\n", 33printf('<h2>%s</h2>'."\n", $host);
27 $CONFIG['weburl'].'host.php?h='.htmlentities($host), $host 34
28); 35$plugins = collectd_plugins($host);
36
37if(!$plugins) {
38 echo "Unknown host\n";
39 return false;
40}
41
42plugins_list($host, $CONFIG['overview'], $plugins, $selected_plugins);
43
44
45echo '<div class="graphs">';
46plugin_header($host, $plugin);
29 47
30$term = array( 48$term = array(
31 '2hour' => 3600*2, 49 '2hour' => 3600*2,
@@ -38,23 +56,17 @@ $term = array(
38); 56);
39 57
40$args = $_GET; 58$args = $_GET;
41print "<ul>\n"; 59print '<ul class="time-range">' . "\n";
42foreach($term as $key => $s) { 60foreach($term as $key => $s) {
43 $args['s'] = $s; 61 $args['s'] = $s;
44 printf('<li><a href="%s%s">%s</a></li>'."\n", 62 $selected = selected_timerange($seconds, $s);
45 $CONFIG['weburl'], build_url('detail.php', $args), $key); 63 printf('<li><a %s href="%s%s">%s</a></li>'."\n",
64 $selected, $CONFIG['weburl'], build_url('detail.php', $args), $key);
46} 65}
47print "</ul>\n"; 66print "</ul>\n";
48 67
49$plugins = collectd_plugins($host);
50
51if(!$plugins) {
52 echo "Unknown host\n";
53 return false;
54}
55
56# show graph
57printf('<img src="%s%s">'."\n", $CONFIG['weburl'], build_url('graph.php', $_GET)); 68printf('<img src="%s%s">'."\n", $CONFIG['weburl'], build_url('graph.php', $_GET));
69echo '</div><! .graphs -->';
58 70
59html_end(); 71html_end();
60 72