forked from loadavg/loadavg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchart.php
executable file
·74 lines (55 loc) · 2.18 KB
/
chart.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
/**
* LoadAvg - Server Monitoring & Analytics
* http://www.loadavg.com
*
* Charts module interface
* called by charting modules module to render charts!
*
* @link https://github.com/loadavg/loadavg
* @author Karsten Becker
* @copyright 2014 Sputnik7
*
* This file is licensed under the Affero General Public License version 3 or
* later.
*/
?>
<?php
//get status of interface ebefore rendering
$moduleCollapse = "accordion-body collapse in";
$moduleCollapseStatus = "true";
if ($cookies) {
$this->getUIaccordionCookie($moduleCollapse, $moduleCollapseStatus, $module);
}
?>
<div id="accordion-<?php echo $module;?>" width="100%" class="accordion-group" data-collapse-closed="<?php echo $module;?>" cookie-closed=<?php echo $moduleCollapseStatus; ?> >
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" href="#category<?php echo $module; ?>" >
<?php echo $moduleSettings['module']['name']; //$chart->label; ?>
</a>
</div>
<div id="category<?php echo $module; ?>" class="<?php echo $moduleCollapse;?>">
<div class="accordion-inner">
<?php
//keeps track of number of chart modules in a chart
$chartModules = 0;
//keeps track of first time loop us run - so javascript code
//is only loaded the first time in chartmodule when rendering charts
$loadJavascript = true;
foreach ( $charts['args'] as $chart ) {
$chartModules++;
//data about chart to be rendered
$chart = json_decode($chart);
//get the log file NAME or names when there is a range and sets it in array chart->logfile
//returns multiple files when multiple log files
//echo $chart->logfile;
$class->setLogFile($chart->logfile, $dateRange, $module );
//get actual datasets needed to send to template to render chart
$chartData = $class->getChartRenderData( $chart, $functionSettings, $module );
include( HOME_PATH . '/lib/charts/chartmodule.php');
$loadJavascript = false;
} ?>
</div> <!-- // Accordion inner end -->
</div> <!-- // Accordion category end -->
</div> <!-- // Accordion end -->
<div id="separator" class="separator bottom"></div>