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 /host.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-- | host.php | 36 |
1 files changed, 14 insertions, 22 deletions
@@ -5,7 +5,14 @@ require_once 'inc/html.inc.php'; | |||
5 | require_once 'inc/collectd.inc.php'; | 5 | require_once 'inc/collectd.inc.php'; |
6 | 6 | ||
7 | $host = validate_get(GET('h'), 'host'); | 7 | $host = validate_get(GET('h'), 'host'); |
8 | $splugin = validate_get(GET('p'), 'plugin'); | 8 | $plugin = validate_get(GET('p'), 'plugin'); |
9 | |||
10 | if (!$plugin) { | ||
11 | $selected_plugins = $CONFIG['overview']; | ||
12 | } | ||
13 | else { | ||
14 | $selected_plugins = array($plugin); | ||
15 | } | ||
9 | 16 | ||
10 | html_start(); | 17 | html_start(); |
11 | 18 | ||
@@ -18,29 +25,14 @@ if(!$plugins) { | |||
18 | return false; | 25 | return false; |
19 | } | 26 | } |
20 | 27 | ||
21 | # first the ones defined in overview | 28 | plugins_list($host, $CONFIG['overview'], $plugins, $selected_plugins); |
22 | foreach($CONFIG['overview'] as $plugin) { | ||
23 | if (in_array($plugin, $plugins)) { | ||
24 | printf('<div id="%s">'."\n", $plugin); | ||
25 | plugin_header($host, $plugin, 0); | ||
26 | graphs_from_plugin($host, $plugin); | ||
27 | print "</div>\n"; | ||
28 | } | ||
29 | } | ||
30 | 29 | ||
31 | # other plugins | 30 | echo '<div class="graphs">'; |
32 | foreach($plugins as $plugin) { | 31 | foreach ($selected_plugins as $selected_plugin) { |
33 | if (!in_array($plugin, $CONFIG['overview'])) { | 32 | plugin_header($host, $selected_plugin); |
34 | printf('<div id="%s">'."\n", $plugin); | 33 | graphs_from_plugin($host, $selected_plugin); |
35 | if ($splugin == $plugin) { | ||
36 | plugin_header($host, $plugin, 0); | ||
37 | graphs_from_plugin($host, $plugin); | ||
38 | } else { | ||
39 | plugin_header($host, $plugin, 1); | ||
40 | } | ||
41 | print "</div>\n"; | ||
42 | } | ||
43 | } | 34 | } |
35 | echo '</div><! .graphs -->'; | ||
44 | 36 | ||
45 | html_end(); | 37 | html_end(); |
46 | 38 | ||