1 | <?php |
||
2 | |||
3 | $domain_list = Rrd::getRrdApplicationArrays($device, $app['app_id'], 'docker'); |
||
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
4 | |||
5 | print_optionbar_start(); |
||
6 | |||
7 | $link_array = [ |
||
8 | 'page' => 'device', |
||
9 | 'device' => $device['device_id'], |
||
10 | 'tab' => 'apps', |
||
11 | 'app' => 'docker', |
||
12 | ]; |
||
13 | |||
14 | $containers_list = []; |
||
15 | |||
16 | foreach ($domain_list as $label) { |
||
17 | $container = $label; |
||
18 | |||
19 | if ($vars['container'] == $container) { |
||
20 | $label = sprintf('⚫ %s', $label); |
||
21 | } |
||
22 | |||
23 | array_push($containers_list, generate_link($label, $link_array, ['container' => $container])); |
||
24 | } |
||
25 | |||
26 | printf('%s | containers: %s', generate_link('All Containers', $link_array), implode(', ', $containers_list)); |
||
27 | |||
28 | print_optionbar_end(); |
||
29 | |||
30 | $graphs = [ |
||
31 | 'docker_pids' => 'PIDs', |
||
32 | 'docker_mem_limit' => 'Container memory limit', |
||
33 | 'docker_mem_used' => 'Container memory used', |
||
34 | 'docker_cpu_usage' => 'Container CPU usage, %', |
||
35 | 'docker_mem_perc' => 'Container Memory usage, %', |
||
36 | ]; |
||
37 | |||
38 | foreach ($graphs as $key => $text) { |
||
39 | $graph_type = $key; |
||
40 | $graph_array['height'] = '100'; |
||
41 | $graph_array['width'] = '215'; |
||
42 | $graph_array['to'] = time(); |
||
43 | $graph_array['id'] = $app['app_id']; |
||
44 | $graph_array['type'] = 'application_' . $key; |
||
45 | |||
46 | if (isset($vars['container'])) { |
||
47 | $graph_array['container'] = $vars['container']; |
||
48 | } |
||
49 | |||
50 | echo '<div class="panel panel-default"> |
||
51 | <div class="panel-heading"> |
||
52 | <h3 class="panel-title">' . $text . '</h3> |
||
53 | </div> |
||
54 | <div class="panel-body"> |
||
55 | <div class="row">'; |
||
56 | include 'includes/html/print-graphrow.inc.php'; |
||
57 | echo '</div>'; |
||
58 | echo '</div>'; |
||
59 | echo '</div>'; |
||
60 | } |
||
61 |