diff options
| author | xian310 | 2012-12-21 19:59:39 +0100 |
|---|---|---|
| committer | Pim van den Berg | 2012-12-21 19:59:39 +0100 |
| commit | ea946240c9a5a11d337b7afcc8590870bc18cd84 (patch) | |
| tree | bcd0e0733775b430716ab06b6444aa8ccd6f3b00 /detail.php | |
| parent | type/default: resolve division by zero warning (diff) | |
| download | apt-panopticon_cgp-ea946240c9a5a11d337b7afcc8590870bc18cd84.zip apt-panopticon_cgp-ea946240c9a5a11d337b7afcc8590870bc18cd84.tar.gz apt-panopticon_cgp-ea946240c9a5a11d337b7afcc8590870bc18cd84.tar.bz2 apt-panopticon_cgp-ea946240c9a5a11d337b7afcc8590870bc18cd84.tar.xz | |
replace the ajax expand system by a navigation menu
Signed-off-by: Pim van den Berg <pim@nethuis.nl>
Diffstat (limited to '')
| -rw-r--r-- | detail.php | 40 |
1 files changed, 26 insertions, 14 deletions
| @@ -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 | ||
| 24 | if (!$plugin) { | ||
| 25 | $selected_plugins = $CONFIG['overview']; | ||
| 26 | } | ||
| 27 | else { | ||
| 28 | $selected_plugins = array($plugin); | ||
| 29 | } | ||
| 30 | |||
| 24 | html_start(); | 31 | html_start(); |
| 25 | 32 | ||
| 26 | printf('<h2><a href="%s">%s</a></h2>'."\n", | 33 | printf('<h2>%s</h2>'."\n", $host); |
| 27 | $CONFIG['weburl'].'host.php?h='.htmlentities($host), $host | 34 | |
| 28 | ); | 35 | $plugins = collectd_plugins($host); |
| 36 | |||
| 37 | if(!$plugins) { | ||
| 38 | echo "Unknown host\n"; | ||
| 39 | return false; | ||
| 40 | } | ||
| 41 | |||
| 42 | plugins_list($host, $CONFIG['overview'], $plugins, $selected_plugins); | ||
| 43 | |||
| 44 | |||
| 45 | echo '<div class="graphs">'; | ||
| 46 | plugin_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; |
| 41 | print "<ul>\n"; | 59 | print '<ul class="time-range">' . "\n"; |
| 42 | foreach($term as $key => $s) { | 60 | foreach($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 | } |
| 47 | print "</ul>\n"; | 66 | print "</ul>\n"; |
| 48 | 67 | ||
| 49 | $plugins = collectd_plugins($host); | ||
| 50 | |||
| 51 | if(!$plugins) { | ||
| 52 | echo "Unknown host\n"; | ||
| 53 | return false; | ||
| 54 | } | ||
| 55 | |||
| 56 | # show graph | ||
| 57 | printf('<img src="%s%s">'."\n", $CONFIG['weburl'], build_url('graph.php', $_GET)); | 68 | printf('<img src="%s%s">'."\n", $CONFIG['weburl'], build_url('graph.php', $_GET)); |
| 69 | echo '</div><! .graphs -->'; | ||
| 58 | 70 | ||
| 59 | html_end(); | 71 | html_end(); |
| 60 | 72 | ||
