mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Manual (by hand) cherry pick of commit c7fa8710ec64fb90f77736bfc25d432bb7777dc2
This commit is contained in:
parent
6d07408af8
commit
99247f7286
@ -7100,6 +7100,10 @@ function reporting_get_event_histogram ($events) {
|
||||
include_once ('../../include/graphs/functions_gd.php');
|
||||
$max_value = count($events);
|
||||
|
||||
if (defined("METACONSOLE"))
|
||||
$max_value = SECONDS_1HOUR;
|
||||
|
||||
|
||||
$ttl = 1;
|
||||
$urlImage = ui_get_full_url(false, true, false, false);
|
||||
|
||||
@ -7113,6 +7117,11 @@ function reporting_get_event_histogram ($events) {
|
||||
EVENT_CRIT_CRITICAL => COL_CRITICAL
|
||||
);
|
||||
|
||||
if (defined("METACONSOLE")) {
|
||||
$full_legend = array();
|
||||
$cont = 0;
|
||||
}
|
||||
|
||||
foreach ($events as $data) {
|
||||
|
||||
switch ($data['criticity']) {
|
||||
@ -7144,11 +7153,22 @@ function reporting_get_event_histogram ($events) {
|
||||
$color = EVENT_CRIT_WARNING_OR_CRITICAL;
|
||||
break;
|
||||
}
|
||||
|
||||
if (defined("METACONSOLE")) {
|
||||
$full_legend[$cont] = $data['timestamp'];
|
||||
$graph_data[] = array(
|
||||
'data' => $color,
|
||||
'utimestamp' => $data['utimestamp'] - get_system_time ()
|
||||
);
|
||||
$cont++;
|
||||
}
|
||||
else {
|
||||
$graph_data[] = array(
|
||||
'data' => $color,
|
||||
'utimestamp' => 1
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$table->width = '100%';
|
||||
$table->data = array ();
|
||||
@ -7158,13 +7178,18 @@ function reporting_get_event_histogram ($events) {
|
||||
$table->data[0][0] = "" ;
|
||||
|
||||
if (!empty($graph_data)) {
|
||||
if (defined("METACONSOLE"))
|
||||
$slicebar = flot_slicesbar_graph($graph_data, $max_value, "100%", 35, $full_legend, $colors, $config['fontpath'], $config['round_corner'], $urlI
|
||||
else
|
||||
$slicebar = slicesbar_graph($graph_data, $max_value, 700, 25, $colors, $config['fontpath'], $config['round_corner'], $urlImage, $ttl);
|
||||
|
||||
$table->data[0][0] = $slicebar;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$table->data[0][0] = __('No events');
|
||||
}
|
||||
|
||||
if(!defined('METACONSOLE')){
|
||||
if (!defined('METACONSOLE')) {
|
||||
$event_graph = '<fieldset class="databox tactical_set">
|
||||
<legend>' .
|
||||
__('Events info (1hr)') .
|
||||
|
Loading…
x
Reference in New Issue
Block a user