diff options
Diffstat (limited to '')
-rw-r--r-- | conf/common.inc.php | 4 | ||||
-rw-r--r-- | detail.php | 6 | ||||
-rw-r--r-- | inc/collectd.inc.php | 2 | ||||
-rw-r--r-- | inc/html.inc.php | 10 |
4 files changed, 10 insertions, 12 deletions
diff --git a/conf/common.inc.php b/conf/common.inc.php index c4884d6..165c73f 100644 --- a/conf/common.inc.php +++ b/conf/common.inc.php | |||
@@ -3,6 +3,4 @@ | |||
3 | require_once 'config.php'; | 3 | require_once 'config.php'; |
4 | 4 | ||
5 | $CONFIG['webdir'] = preg_replace('/\/[a-z\.]+$/', '', $_SERVER['SCRIPT_FILENAME']); | 5 | $CONFIG['webdir'] = preg_replace('/\/[a-z\.]+$/', '', $_SERVER['SCRIPT_FILENAME']); |
6 | $CONFIG['weburl'] = preg_replace('/\/[a-z\.]+$/', '', $_SERVER['SCRIPT_NAME']); | 6 | $CONFIG['weburl'] = preg_replace('/(?<=\/)[a-z\.]+$/', '', $_SERVER['SCRIPT_NAME']); |
7 | |||
8 | ?> | ||
@@ -23,7 +23,7 @@ $seconds = GET('s'); | |||
23 | html_start(); | 23 | html_start(); |
24 | 24 | ||
25 | printf('<h2><a href="%s">%s</a></h2>'."\n", | 25 | printf('<h2><a href="%s">%s</a></h2>'."\n", |
26 | $CONFIG['weburl'].'/host.php?h='.htmlentities($host), $host | 26 | $CONFIG['weburl'].'host.php?h='.htmlentities($host), $host |
27 | ); | 27 | ); |
28 | 28 | ||
29 | $term = array( | 29 | $term = array( |
@@ -40,7 +40,7 @@ $args = $_GET; | |||
40 | print "<ul>\n"; | 40 | print "<ul>\n"; |
41 | foreach($term as $key => $s) { | 41 | foreach($term as $key => $s) { |
42 | $args['s'] = $s; | 42 | $args['s'] = $s; |
43 | printf('<li><a href="%s/%s">%s</a></li>'."\n", | 43 | printf('<li><a href="%s%s">%s</a></li>'."\n", |
44 | $CONFIG['weburl'], build_url('detail.php', $args), $key); | 44 | $CONFIG['weburl'], build_url('detail.php', $args), $key); |
45 | } | 45 | } |
46 | print "</ul>\n"; | 46 | print "</ul>\n"; |
@@ -53,7 +53,7 @@ if(!$plugins) { | |||
53 | } | 53 | } |
54 | 54 | ||
55 | # show graph | 55 | # show graph |
56 | printf('<img src="%s/%s">'."\n", $CONFIG['weburl'], build_url('graph.php', $_GET)); | 56 | printf('<img src="%s%s">'."\n", $CONFIG['weburl'], build_url('graph.php', $_GET)); |
57 | 57 | ||
58 | html_end(); | 58 | html_end(); |
59 | 59 | ||
diff --git a/inc/collectd.inc.php b/inc/collectd.inc.php index 11dc91f..439d507 100644 --- a/inc/collectd.inc.php +++ b/inc/collectd.inc.php | |||
@@ -133,7 +133,7 @@ function graphs_from_plugin($host, $plugin) { | |||
133 | ? $CONFIG['time_range'][$plugin] | 133 | ? $CONFIG['time_range'][$plugin] |
134 | : $CONFIG['time_range']['default']; | 134 | : $CONFIG['time_range']['default']; |
135 | 135 | ||
136 | printf('<a href="%s/%s"><img src="%s/%s"></a>'."\n", | 136 | printf('<a href="%s%s"><img src="%s%s"></a>'."\n", |
137 | $CONFIG['weburl'], | 137 | $CONFIG['weburl'], |
138 | build_url('detail.php', $items, $time), | 138 | build_url('detail.php', $items, $time), |
139 | $CONFIG['weburl'], | 139 | $CONFIG['weburl'], |
diff --git a/inc/html.inc.php b/inc/html.inc.php index d4a31f2..2e71488 100644 --- a/inc/html.inc.php +++ b/inc/html.inc.php | |||
@@ -18,8 +18,8 @@ function html_start() { | |||
18 | <head> | 18 | <head> |
19 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | 19 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
20 | <title>CGP{$path}</title> | 20 | <title>CGP{$path}</title> |
21 | <link rel="stylesheet" href="{$CONFIG['weburl']}/layout/style.css" type="text/css"> | 21 | <link rel="stylesheet" href="{$CONFIG['weburl']}layout/style.css" type="text/css"> |
22 | <script type="text/javascript" src="{$CONFIG['weburl']}/ajax.js"></script> | 22 | <script type="text/javascript" src="{$CONFIG['weburl']}ajax.js"></script> |
23 | </head> | 23 | </head> |
24 | <body> | 24 | <body> |
25 | 25 | ||
@@ -51,7 +51,7 @@ function html_end() { | |||
51 | echo <<<EOT | 51 | echo <<<EOT |
52 | </div> | 52 | </div> |
53 | <div id="footer"> | 53 | <div id="footer"> |
54 | <hr><span class="small"><a href="http://pommi.nethuis.nl/category/cgp/" rel="external">Collectd Graph Panel</a> ({$version}) is distributed under the <a href="{$CONFIG['weburl']}/doc/LICENSE" rel="licence">GNU General Public License (GPLv3)</a></span> | 54 | <hr><span class="small"><a href="http://pommi.nethuis.nl/category/cgp/" rel="external">Collectd Graph Panel</a> ({$version}) is distributed under the <a href="{$CONFIG['weburl']}doc/LICENSE" rel="licence">GNU General Public License (GPLv3)</a></span> |
55 | </div> | 55 | </div> |
56 | </body> | 56 | </body> |
57 | </html> | 57 | </html> |
@@ -71,7 +71,7 @@ function plugin_header($host, $plugin, $status) { | |||
71 | $a = '-'; | 71 | $a = '-'; |
72 | } | 72 | } |
73 | 73 | ||
74 | return printf("<h3><span class=\"point\" onclick=\"javascript:%sP('%s','%s')\"><img src=\"%s/layout/%s.gif\" alt=\"[%s]\"> %s</span></h3>\n", $f, $host, $plugin, $CONFIG['weburl'], $i, $a, $plugin); | 74 | return printf("<h3><span class=\"point\" onclick=\"javascript:%sP('%s','%s')\"><img src=\"%slayout/%s.gif\" alt=\"[%s]\"> %s</span></h3>\n", $f, $host, $plugin, $CONFIG['weburl'], $i, $a, $plugin); |
75 | } | 75 | } |
76 | 76 | ||
77 | function host_summary($hosts) { | 77 | function host_summary($hosts) { |
@@ -88,7 +88,7 @@ function host_summary($hosts) { | |||
88 | $host_counter++; | 88 | $host_counter++; |
89 | 89 | ||
90 | printf('<tr class="%s">', $row_style[$host_counter % 2]); | 90 | printf('<tr class="%s">', $row_style[$host_counter % 2]); |
91 | printf('<th><a href="%s/host.php?h=%s">%s</a></th>', | 91 | printf('<th><a href="%shost.php?h=%s">%s</a></th>', |
92 | $CONFIG['weburl'],$host, $host); | 92 | $CONFIG['weburl'],$host, $host); |
93 | 93 | ||
94 | if ($CONFIG['showload']) { | 94 | if ($CONFIG['showload']) { |