diff options
Diffstat (limited to 'host.php')
-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 | ||