-
Notifications
You must be signed in to change notification settings - Fork 14
/
env_view.php
43 lines (38 loc) · 1.55 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<a class="anchor" name="overview"> </a>
<div class="block_title"><a href="#overview">Environment overview</a></div>
<div class="graph_block">
<?php
$graph_args = "env=$env";
if (isset($g)) { $graph_reports = array($g); }
elseif (isset($m)) { $metric_graph = $m; }
else { $graph_reports = find_dashboards($env); }
if (isset($m)) {
print print_zoom_graph($graph_args, "m=$metric_graph", $z, $from, $until);
}
elseif (isset($graph_reports)) {
foreach ($graph_reports as $graph_report) {
print print_zoom_graph($graph_args, "g=$graph_report", $z, $from, $until);
}
}
?>
</div>
<a class="anchor" name="clusters"> </a>
<div class="block_title"><a href="#clusters">Clusters</a></div>
<?php
if (isset($g)) { print "<div class=\"graph_block\">"; }
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 "<div class=\"graph_block_title\"><a href=\"?$graph_args&c=$cluster_name&from=$gs&until=$ge\">$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>"; }
}
if (isset($g)) { print "</div>"; }
?>