forked from lensen/graphsky
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenv_view.php
26 lines (22 loc) · 1.07 KB
/
env_view.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<span class="anchor" id="clusters"></span>
<div class="block_title"><a href="#clusters">Clusters</a></div>
<?php
$graph_args = "env=$env";
$cluster_search = json_decode(file_get_contents($conf['graphite_search_url'] . $conf['graphite_prefix'] . "$env.*"), TRUE);
$clusters = $cluster_search['results'];
natsort($clusters);
foreach ($clusters as $cluster) {
$cluster_name = str_replace($conf['graphite_prefix'] . "$env.", "", $cluster);
$graph_reports = array();
if (isset($g)) { $graph_reports = array($g); }
else { $graph_reports = find_dashboards($env, $cluster_name); }
if (!isset($g)) { print "<a href=\"?$graph_args&c=$cluster_name&from=$gs&until=$ge\"><div class=\"banner_text\">$cluster_name</div></a><div class=\"graph_block\">"; }
foreach ($graph_reports as $graph_report) {
if ( show_on_dashboard($graph_report, $env, $cluster_name) ) {
$current_graph_args = "$graph_args&c=$cluster_name";
print print_graph($current_graph_args, "g=$graph_report", $z, $from, $until);
}
}
if (!isset($g)){ print "</div>"; }
}
?>