Merge branch 'ent-6397-Revision-visual-en-informes' into 'develop'
fixed visual errors and default values See merge request artica/pandorafms!3500
This commit is contained in:
commit
a32e6ad9b0
|
@ -2105,6 +2105,14 @@ class ConsoleSupervisor
|
|||
|
||||
$fontpath = io_safe_output($config['fontpath']);
|
||||
|
||||
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
||||
// Windows.
|
||||
$fontpath = $config['homedir'].'\include\fonts\\'.$fontpath;
|
||||
} else {
|
||||
$home = str_replace('\\', '/', $config['homedir']);
|
||||
$fontpath = $home.'/include/fonts/'.$fontpath;
|
||||
}
|
||||
|
||||
if (($fontpath == '')
|
||||
|| (file_exists($fontpath) === false)
|
||||
) {
|
||||
|
|
|
@ -1217,8 +1217,14 @@ function config_update_config()
|
|||
$error_update[] = __('Default zoom graphs');
|
||||
}
|
||||
|
||||
if (!config_update_value('graph_image_height', (int) get_parameter('graph_image_height', 280))) {
|
||||
$error_update[] = __('Default height of the chart image');
|
||||
if (!config_update_value(
|
||||
'graph_image_height',
|
||||
(int) get_parameter('graph_image_height', 130)
|
||||
)
|
||||
) {
|
||||
$error_update[] = __(
|
||||
'Default height of the chart image'
|
||||
);
|
||||
}
|
||||
|
||||
// --------------------------------------------------
|
||||
|
@ -1324,7 +1330,7 @@ function config_update_config()
|
|||
$error_update[] = __('HTML font size for SLA (em)');
|
||||
}
|
||||
|
||||
if (!config_update_value('global_font_size_report', get_parameter('global_font_size_report', 14))) {
|
||||
if (!config_update_value('global_font_size_report', get_parameter('global_font_size_report', 10))) {
|
||||
$error_update[] = __('PDF font size (px)');
|
||||
}
|
||||
|
||||
|
@ -1987,7 +1993,7 @@ function config_process_config()
|
|||
}
|
||||
|
||||
if (!isset($config['font_size'])) {
|
||||
config_update_value('font_size', 6);
|
||||
config_update_value('font_size', 8);
|
||||
}
|
||||
|
||||
if (!isset($config['limit_parameters_massive'])) {
|
||||
|
@ -2057,17 +2063,9 @@ function config_process_config()
|
|||
}
|
||||
|
||||
if (!isset($config['fontpath'])) {
|
||||
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
||||
// Windows.
|
||||
$fontpath = $config['homedir'].'\include\fonts\smallfont.ttf';
|
||||
} else {
|
||||
$home = str_replace('\\', '/', $config['homedir']);
|
||||
$fontpath = $home.'/include/fonts/smallfont.ttf';
|
||||
}
|
||||
|
||||
config_update_value(
|
||||
'fontpath',
|
||||
$fontpath
|
||||
'opensans.ttf'
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -2864,7 +2862,7 @@ function config_process_config()
|
|||
}
|
||||
|
||||
if (!isset($config['graph_image_height'])) {
|
||||
config_update_value('graph_image_height', 280);
|
||||
config_update_value('graph_image_height', 130);
|
||||
}
|
||||
|
||||
if (!isset($config['zoom_graph'])) {
|
||||
|
@ -2919,17 +2917,20 @@ function config_process_config()
|
|||
config_update_value('custom_report_info', 1);
|
||||
}
|
||||
|
||||
// Juanma (06/05/2014) New feature: Custom front page for reports.
|
||||
if (!isset($config['custom_report_front'])) {
|
||||
config_update_value('custom_report_front', 0);
|
||||
}
|
||||
|
||||
if (!isset($config['global_font_size_report'])) {
|
||||
config_update_value('global_font_size_report', 10);
|
||||
}
|
||||
|
||||
if (!isset($config['font_size_item_report'])) {
|
||||
config_update_value('font_size_item_report', 2);
|
||||
}
|
||||
|
||||
if (!isset($config['custom_report_front_font'])) {
|
||||
config_update_value('custom_report_front_font', 'FreeSans.ttf');
|
||||
config_update_value('custom_report_front_font', 'opensans.ttf');
|
||||
}
|
||||
|
||||
if (!isset($config['custom_report_front_logo'])) {
|
||||
|
|
|
@ -512,8 +512,6 @@ function db_get_row_filter($table, $filter, $fields=false, $where_join='AND', $h
|
|||
*
|
||||
* @return mixed The selected field of the first row in a select statement.
|
||||
*/
|
||||
|
||||
|
||||
function db_get_sql($sql, $field=0, $search_history_db=false)
|
||||
{
|
||||
$result = db_get_all_rows_sql($sql, $search_history_db);
|
||||
|
@ -567,25 +565,34 @@ function db_get_all_rows_sql($sql, $search_history_db=false, $cache=true, $dbcon
|
|||
/**
|
||||
* Returns the time the module is in unknown status (by events)
|
||||
*
|
||||
* @param integer $id_agente_modulo module to check
|
||||
* @param integer $tstart begin of search
|
||||
* @param integer $tend end of search
|
||||
* @param integer $id_agente_modulo Module to check.
|
||||
* @param boolean $tstart Begin of search.
|
||||
* @param boolean $tend End of search.
|
||||
* @param boolean $historydb HistoryDb.
|
||||
* @param integer $fix_to_range Range.
|
||||
*
|
||||
* @return array Return array or false.
|
||||
*/
|
||||
function db_get_module_ranges_unknown($id_agente_modulo, $tstart=false, $tend=false, $historydb=false, $fix_to_range=0)
|
||||
{
|
||||
function db_get_module_ranges_unknown(
|
||||
$id_agente_modulo,
|
||||
$tstart=false,
|
||||
$tend=false,
|
||||
$historydb=false,
|
||||
$fix_to_range=0
|
||||
) {
|
||||
global $config;
|
||||
|
||||
if (!isset($id_agente_modulo)) {
|
||||
if (isset($id_agente_modulo) === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((!isset($tstart)) || ($tstart === false)) {
|
||||
// Return data from the begining
|
||||
if ((isset($tstart) === false) || ($tstart === false)) {
|
||||
// Return data from the begining.
|
||||
$tstart = 0;
|
||||
}
|
||||
|
||||
if ((!isset($tend)) || ($tend === false)) {
|
||||
// Return data until now
|
||||
if ((isset($tend) === false) || ($tend === false)) {
|
||||
// Return data until now.
|
||||
$tend = time();
|
||||
}
|
||||
|
||||
|
@ -593,24 +600,49 @@ function db_get_module_ranges_unknown($id_agente_modulo, $tstart=false, $tend=fa
|
|||
return false;
|
||||
}
|
||||
|
||||
// Retrieve going unknown events in range
|
||||
$query = 'SELECT * FROM tevento WHERE id_agentmodule = '.$id_agente_modulo." AND event_type like 'going_%' "." AND utimestamp >= $tstart AND utimestamp <= $tend ".' ORDER BY utimestamp ASC';
|
||||
// Retrieve going unknown events in range.
|
||||
$query = sprintf(
|
||||
'SELECT *
|
||||
FROM tevento
|
||||
WHERE id_agentmodule = %d
|
||||
AND event_type like "going_%%"
|
||||
AND utimestamp >= %d
|
||||
AND utimestamp <= %d
|
||||
ORDER BY utimestamp ASC
|
||||
',
|
||||
$id_agente_modulo,
|
||||
$tstart,
|
||||
$tend
|
||||
);
|
||||
$events = db_get_all_rows_sql($query, $historydb);
|
||||
|
||||
$query = 'SELECT * FROM tevento WHERE id_agentmodule = '.$id_agente_modulo." AND event_type like 'going_%' "." AND utimestamp < $tstart ".' ORDER BY utimestamp DESC LIMIT 1;';
|
||||
$query = sprintf(
|
||||
'SELECT *
|
||||
FROM tevento
|
||||
WHERE id_agentmodule = %d
|
||||
AND event_type like "going_%%"
|
||||
AND utimestamp < %d
|
||||
ORDER BY utimestamp DESC
|
||||
LIMIT 1
|
||||
',
|
||||
$id_agente_modulo,
|
||||
$tstart
|
||||
);
|
||||
$previous_event = db_get_all_rows_sql($query, $historydb);
|
||||
|
||||
if ($previous_event !== false) {
|
||||
$last_status = $previous_event[0]['event_type'] == 'going_unknown' ? 1 : 0;
|
||||
$last_status = ($previous_event[0]['event_type'] == 'going_unknown') ? 1 : 0;
|
||||
} else {
|
||||
$last_status = 0;
|
||||
}
|
||||
|
||||
if ((! is_array($events)) && (! is_array($previous_event))) {
|
||||
if ((is_array($events) === false)
|
||||
&& (is_array($previous_event) === false)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (! is_array($events)) {
|
||||
if (is_array($events) === false) {
|
||||
if ($previous_event[0]['event_type'] == 'going_unknown') {
|
||||
return [
|
||||
[
|
||||
|
@ -622,7 +654,7 @@ function db_get_module_ranges_unknown($id_agente_modulo, $tstart=false, $tend=fa
|
|||
|
||||
$return = [];
|
||||
$i = 0;
|
||||
if (is_array($events)) {
|
||||
if (is_array($events) === true) {
|
||||
foreach ($events as $event) {
|
||||
switch ($event['event_type']) {
|
||||
case 'going_up_critical':
|
||||
|
@ -647,11 +679,14 @@ function db_get_module_ranges_unknown($id_agente_modulo, $tstart=false, $tend=fa
|
|||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
// Nothing.
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($return[0])) {
|
||||
if (isset($return[0]) === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -662,10 +697,10 @@ function db_get_module_ranges_unknown($id_agente_modulo, $tstart=false, $tend=fa
|
|||
/**
|
||||
* Uncompresses and returns the data of a given id_agent_module
|
||||
*
|
||||
* @param integer $id_agente_modulo id_agente_modulo
|
||||
* @param utimestamp $tstart Begin of the catch
|
||||
* @param utimestamp $tend End of the catch
|
||||
* @param integer $interval Size of slice (default-> module_interval)
|
||||
* @param integer $id_agente_modulo Id_agente_modulo.
|
||||
* @param utimestamp $tstart Begin of the catch.
|
||||
* @param utimestamp $tend End of the catch.
|
||||
* @param integer $slice_size Size of slice(default-> module_interval).
|
||||
*
|
||||
* @return hash with the data uncompressed in blocks of module_interval
|
||||
* false in case of empty result
|
||||
|
@ -683,16 +718,20 @@ function db_get_module_ranges_unknown($id_agente_modulo, $tstart=false, $tend=fa
|
|||
* datos
|
||||
* utimestamp
|
||||
*/
|
||||
function db_uncompress_module_data($id_agente_modulo, $tstart=false, $tend=false, $slice_size=false)
|
||||
{
|
||||
function db_uncompress_module_data(
|
||||
$id_agente_modulo,
|
||||
$tstart=false,
|
||||
$tend=false,
|
||||
$slice_size=false
|
||||
) {
|
||||
global $config;
|
||||
|
||||
if (!isset($id_agente_modulo)) {
|
||||
if (isset($id_agente_modulo) === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((!isset($tend)) || ($tend === false)) {
|
||||
// Return data until now
|
||||
if ((isset($tend) === false) || ($tend === false)) {
|
||||
// Return data until now.
|
||||
$tend = time();
|
||||
}
|
||||
|
||||
|
@ -705,7 +744,7 @@ function db_uncompress_module_data($id_agente_modulo, $tstart=false, $tend=false
|
|||
|
||||
$module = modules_get_agentmodule($id_agente_modulo);
|
||||
if ($module === false) {
|
||||
// module not exists
|
||||
// Module not exists.
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -727,27 +766,34 @@ function db_uncompress_module_data($id_agente_modulo, $tstart=false, $tend=false
|
|||
|
||||
$result = modules_get_first_date($id_agente_modulo, $tstart);
|
||||
$first_utimestamp = $result['first_utimestamp'];
|
||||
$search_historydb = $result['search_historydb'];
|
||||
$search_historydb = (isset($result['search_historydb']) === true) ? $result['search_historydb'] : false;
|
||||
|
||||
if ($first_utimestamp === false) {
|
||||
$first_data['utimestamp'] = $tstart;
|
||||
$first_data['datos'] = false;
|
||||
} else {
|
||||
$query = "SELECT datos,utimestamp FROM $table ";
|
||||
$query .= " WHERE id_agente_modulo=$id_agente_modulo ";
|
||||
$query .= ' AND utimestamp = '.$first_utimestamp;
|
||||
$query = sprintf(
|
||||
'SELECT datos,utimestamp
|
||||
FROM %s
|
||||
WHERE id_agente_modulo = %d
|
||||
AND utimestamp = %d
|
||||
',
|
||||
$table,
|
||||
$id_agente_modulo,
|
||||
$first_utimestamp
|
||||
);
|
||||
|
||||
$data = db_get_all_rows_sql($query, $search_historydb);
|
||||
|
||||
if ($data === false) {
|
||||
// first utimestamp not found in active database
|
||||
// SEARCH HISTORY DB
|
||||
// First utimestamp not found in active database
|
||||
// SEARCH HISTORY DB.
|
||||
$search_historydb = true;
|
||||
$data = db_get_all_rows_sql($query, $search_historydb);
|
||||
}
|
||||
|
||||
if ($data === false) {
|
||||
// Not init
|
||||
// Not init.
|
||||
$first_data['utimestamp'] = $tstart;
|
||||
$first_data['datos'] = false;
|
||||
} else {
|
||||
|
@ -756,20 +802,31 @@ function db_uncompress_module_data($id_agente_modulo, $tstart=false, $tend=false
|
|||
}
|
||||
}
|
||||
|
||||
$query = " SELECT utimestamp, datos FROM $table ";
|
||||
$query .= " WHERE id_agente_modulo=$id_agente_modulo AND utimestamp >= $tstart AND utimestamp <= $tend";
|
||||
$query .= ' ORDER BY utimestamp ASC';
|
||||
// Retrieve all data from module in given range
|
||||
$query = sprintf(
|
||||
'SELECT utimestamp, datos
|
||||
FROM %s
|
||||
WHERE id_agente_modulo = %d
|
||||
AND utimestamp >= %d
|
||||
AND utimestamp <= %d
|
||||
ORDER BY utimestamp ASC
|
||||
',
|
||||
$table,
|
||||
$id_agente_modulo,
|
||||
$tstart,
|
||||
$tend
|
||||
);
|
||||
|
||||
// Retrieve all data from module in given range.
|
||||
$raw_data = db_get_all_rows_sql($query, $search_historydb);
|
||||
|
||||
$module_interval = modules_get_interval($id_agente_modulo);
|
||||
|
||||
if (($raw_data === false) && ( $first_utimestamp === false )) {
|
||||
// No data
|
||||
// No data.
|
||||
return false;
|
||||
}
|
||||
|
||||
// Retrieve going unknown events in range
|
||||
// Retrieve going unknown events in range.
|
||||
$unknown_events = db_get_module_ranges_unknown(
|
||||
$id_agente_modulo,
|
||||
$tstart,
|
||||
|
@ -778,16 +835,21 @@ function db_uncompress_module_data($id_agente_modulo, $tstart=false, $tend=false
|
|||
1
|
||||
);
|
||||
|
||||
// if time to is missing in last event force time to outside range time
|
||||
if ($unknown_events && !isset($unknown_events[(count($unknown_events) - 1)]['time_to'])) {
|
||||
// If time to is missing in last event force time to outside range time.
|
||||
if ($unknown_events
|
||||
&& isset($unknown_events[(count($unknown_events) - 1)]['time_to']) === false
|
||||
) {
|
||||
$unknown_events[(count($unknown_events) - 1)]['time_to'] = $tend;
|
||||
}
|
||||
|
||||
// if time to is missing in first event force time to outside range time
|
||||
// If time to is missing in first event force time to outside range time.
|
||||
if ($first_data['datos'] === false && !$flag_async) {
|
||||
$last_inserted_value = false;
|
||||
} else if (($unknown_events && !isset($unknown_events[0]['time_from']) && !$flag_async)
|
||||
|| ($first_utimestamp < $tstart - (SECONDS_1DAY + 2 * $module_interval) && !$flag_async)
|
||||
} else if (($unknown_events
|
||||
&& isset($unknown_events[0]['time_from']) === false
|
||||
&& $flag_async === false)
|
||||
|| ($first_utimestamp < $tstart - (SECONDS_1DAY + 2 * $module_interval)
|
||||
&& $flag_async === false)
|
||||
) {
|
||||
$last_inserted_value = $first_data['datos'];
|
||||
$unknown_events[0]['time_from'] = $tstart;
|
||||
|
@ -795,24 +857,24 @@ function db_uncompress_module_data($id_agente_modulo, $tstart=false, $tend=false
|
|||
$last_inserted_value = $first_data['datos'];
|
||||
}
|
||||
|
||||
// Retrieve module_interval to build the template
|
||||
// Retrieve module_interval to build the template.
|
||||
if ($slice_size === false) {
|
||||
$slice_size = $module_interval;
|
||||
}
|
||||
|
||||
$return = [];
|
||||
|
||||
// Point current_timestamp to begin of the set and initialize flags
|
||||
// Point current_timestamp to begin of the set and initialize flags.
|
||||
$current_timestamp = $tstart;
|
||||
$last_timestamp = $first_data['utimestamp'];
|
||||
$last_value = $first_data['datos'];
|
||||
|
||||
// reverse array data optimization
|
||||
if (is_array($raw_data)) {
|
||||
// Reverse array data optimization.
|
||||
if (is_array($raw_data) === true) {
|
||||
$raw_data = array_reverse($raw_data);
|
||||
}
|
||||
|
||||
// Build template
|
||||
// Build template.
|
||||
$pool_id = 0;
|
||||
$now = time();
|
||||
|
||||
|
@ -822,7 +884,7 @@ function db_uncompress_module_data($id_agente_modulo, $tstart=false, $tend=false
|
|||
$current_unknown = null;
|
||||
}
|
||||
|
||||
if (is_array($raw_data)) {
|
||||
if (is_array($raw_data) === true) {
|
||||
$current_raw_data = array_pop($raw_data);
|
||||
} else {
|
||||
$current_raw_data = null;
|
||||
|
@ -838,33 +900,34 @@ function db_uncompress_module_data($id_agente_modulo, $tstart=false, $tend=false
|
|||
) {
|
||||
$tmp_data['utimestamp'] = $current_timestamp;
|
||||
|
||||
// check not init
|
||||
// Check not init.
|
||||
$tmp_data['datos'] = $last_value === false ? false : null;
|
||||
|
||||
// async not unknown
|
||||
// Async not unknown.
|
||||
if ($flag_async && $tmp_data['datos'] === null) {
|
||||
$tmp_data['datos'] = $last_inserted_value;
|
||||
}
|
||||
|
||||
// debug purpose
|
||||
// $tmp_data["obs"] = "unknown extra";
|
||||
// Debug purpose.
|
||||
// $tmp_data["obs"] = "unknown extra";.
|
||||
array_push($return[$pool_id]['data'], $tmp_data);
|
||||
}
|
||||
|
||||
// insert raw data
|
||||
// Insert raw data.
|
||||
while (($current_raw_data != null) &&
|
||||
( ($current_timestamp_end > $current_raw_data['utimestamp']) &&
|
||||
($current_timestamp <= $current_raw_data['utimestamp']) ) ) {
|
||||
// Add real data detected
|
||||
// Add real data detected.
|
||||
if (count($return[$pool_id]['data']) == 0) {
|
||||
// insert first slice data
|
||||
// Insert first slice data.
|
||||
$tmp_data['utimestamp'] = $current_timestamp;
|
||||
$tmp_data['datos'] = $last_inserted_value;
|
||||
// debug purpose
|
||||
// $tmp_data["obs"] = "virtual data (raw)";
|
||||
// Debug purpose
|
||||
// $tmp_data["obs"] = "virtual data (raw)";.
|
||||
$tmp_data['type'] = ($current_timestamp == $tstart || ($current_timestamp == $tend) ? 0 : 1);
|
||||
// virtual data
|
||||
// Add order to avoid usort missorder in same utimestamp data cells
|
||||
// Virtual data.
|
||||
// Add order to avoid usort missorder
|
||||
// in same utimestamp data cells.
|
||||
$tmp_data['order'] = 1;
|
||||
array_push($return[$pool_id]['data'], $tmp_data);
|
||||
}
|
||||
|
@ -872,10 +935,10 @@ function db_uncompress_module_data($id_agente_modulo, $tstart=false, $tend=false
|
|||
$tmp_data['utimestamp'] = $current_raw_data['utimestamp'];
|
||||
$tmp_data['datos'] = $current_raw_data['datos'];
|
||||
$tmp_data['type'] = 0;
|
||||
// real data
|
||||
// debug purpose
|
||||
// Real data.
|
||||
// Debug purpose
|
||||
// $tmp_data["obs"] = "real data";
|
||||
// Add order to avoid usort missorder in same utimestamp data cells
|
||||
// Add order to avoid usort missorder in same utimestamp data cells.
|
||||
$tmp_data['order'] = 2;
|
||||
array_push($return[$pool_id]['data'], $tmp_data);
|
||||
|
||||
|
@ -888,7 +951,7 @@ function db_uncompress_module_data($id_agente_modulo, $tstart=false, $tend=false
|
|||
}
|
||||
}
|
||||
|
||||
// unknown
|
||||
// Unknown.
|
||||
$data_slices = $return[$pool_id]['data'];
|
||||
if (!$flag_async) {
|
||||
while (($current_unknown != null) &&
|
||||
|
@ -899,23 +962,25 @@ function db_uncompress_module_data($id_agente_modulo, $tstart=false, $tend=false
|
|||
&& ( $current_timestamp_end >= $current_unknown['time_from'] )
|
||||
) {
|
||||
if (count($return[$pool_id]['data']) == 0) {
|
||||
// insert first slice data
|
||||
// Insert first slice data.
|
||||
$tmp_data['utimestamp'] = $current_timestamp;
|
||||
$tmp_data['datos'] = $last_inserted_value;
|
||||
// debug purpose
|
||||
// Debug purpose
|
||||
// $tmp_data["obs"] = "virtual data (e)";
|
||||
// Add order to avoid usort missorder in same utimestamp data cells
|
||||
// Add order to avoid usort missorder
|
||||
// in same utimestamp data cells.
|
||||
$tmp_data['order'] = 1;
|
||||
|
||||
array_push($return[$pool_id]['data'], $tmp_data);
|
||||
}
|
||||
|
||||
// Add unknown state detected
|
||||
// Add unknown state detected.
|
||||
$tmp_data['utimestamp'] = $current_unknown['time_from'];
|
||||
$tmp_data['datos'] = null;
|
||||
// debug purpose
|
||||
// Debug purpose
|
||||
// $tmp_data["obs"] = "event data unknown from";
|
||||
// Add order to avoid usort missorder in same utimestamp data cells
|
||||
// Add order to avoid usort missorder
|
||||
// in same utimestamp data cells.
|
||||
$tmp_data['order'] = 2;
|
||||
array_push($return[$pool_id]['data'], $tmp_data);
|
||||
$current_unknown['time_from'] = null;
|
||||
|
@ -923,19 +988,21 @@ function db_uncompress_module_data($id_agente_modulo, $tstart=false, $tend=false
|
|||
&& ($current_timestamp_end > $current_unknown['time_to'] )
|
||||
) {
|
||||
if (count($return[$pool_id]['data']) == 0) {
|
||||
// add first slice data always
|
||||
// insert first slice data
|
||||
// Add first slice data always
|
||||
// Insert first slice data.
|
||||
$tmp_data['utimestamp'] = $current_timestamp;
|
||||
$tmp_data['datos'] = $last_inserted_value;
|
||||
// debug purpose
|
||||
// Debug purpose
|
||||
// $tmp_data["obs"] = "virtual data (event_to)";
|
||||
// Add order to avoid usort missorder in same utimestamp data cells
|
||||
// Add order to avoid usort missorder
|
||||
// in same utimestamp data cells.
|
||||
$tmp_data['order'] = 1;
|
||||
array_push($return[$pool_id]['data'], $tmp_data);
|
||||
}
|
||||
|
||||
$tmp_data['utimestamp'] = $current_unknown['time_to'];
|
||||
// Add order to avoid usort missorder in same utimestamp data cells
|
||||
// Add order to avoid usort missorder
|
||||
// in same utimestamp data cells.
|
||||
$tmp_data['order'] = 2;
|
||||
$i = count($data_slices);
|
||||
while ($i >= 0) {
|
||||
|
@ -947,8 +1014,8 @@ function db_uncompress_module_data($id_agente_modulo, $tstart=false, $tend=false
|
|||
$i--;
|
||||
}
|
||||
|
||||
// debug purpose
|
||||
// $tmp_data["obs"] = "event data unknown to";
|
||||
// Debug purpose
|
||||
// $tmp_data["obs"] = "event data unknown to";.
|
||||
array_push($return[$pool_id]['data'], $tmp_data);
|
||||
if ($unknown_events) {
|
||||
$current_unknown = array_shift($unknown_events);
|
||||
|
@ -963,15 +1030,15 @@ function db_uncompress_module_data($id_agente_modulo, $tstart=false, $tend=false
|
|||
|
||||
$return[$pool_id]['utimestamp'] = $current_timestamp;
|
||||
if (count($return[$pool_id]['data']) == 0) {
|
||||
// insert first slice data
|
||||
// Insert first slice data.
|
||||
$tmp_data['utimestamp'] = $current_timestamp;
|
||||
$tmp_data['datos'] = $last_inserted_value;
|
||||
// debug purpose
|
||||
// $tmp_data["obs"] = "virtual data (empty)";
|
||||
// Debug purpose
|
||||
// $tmp_data["obs"] = "virtual data (empty)";.
|
||||
array_push($return[$pool_id]['data'], $tmp_data);
|
||||
}
|
||||
|
||||
// sort current slice
|
||||
// Sort current slice.
|
||||
if (count($return[$pool_id]['data']) > 1) {
|
||||
usort(
|
||||
$return[$pool_id]['data'],
|
||||
|
@ -985,16 +1052,16 @@ function db_uncompress_module_data($id_agente_modulo, $tstart=false, $tend=false
|
|||
);
|
||||
}
|
||||
|
||||
// put the last slice data like first element of next slice
|
||||
// Put the last slice data like first element of next slice.
|
||||
$last_inserted_value = end($return[$pool_id]['data']);
|
||||
$last_inserted_value = $last_inserted_value['datos'];
|
||||
|
||||
// increment
|
||||
// Increment.
|
||||
$pool_id++;
|
||||
$current_timestamp = $current_timestamp_end;
|
||||
}
|
||||
|
||||
// slice to the end.
|
||||
// Slice to the end.
|
||||
if ($pool_id == 1) {
|
||||
$end_array = [];
|
||||
$end_array['data'][0]['utimestamp'] = $tend;
|
||||
|
|
|
@ -3780,6 +3780,7 @@ function agents_get_network_interfaces_array(
|
|||
'height' => $config['graph_image_height'],
|
||||
'landscape' => $content['landscape'],
|
||||
'return_img_base_64' => true,
|
||||
'backgroundColor' => 'transparent',
|
||||
'graph_render' => $content['graph_render'],
|
||||
];
|
||||
|
||||
|
@ -8257,6 +8258,7 @@ function reporting_custom_graph(
|
|||
'height' => $config['graph_image_height'],
|
||||
'landscape' => $content['landscape'],
|
||||
'return_img_base_64' => true,
|
||||
'backgroundColor' => 'transparent',
|
||||
];
|
||||
|
||||
$params_combined = [
|
||||
|
|
|
@ -2788,7 +2788,7 @@ function reporting_html_graph($table, $item)
|
|||
{
|
||||
$table->colspan['chart']['cell'] = 3;
|
||||
$table->cellstyle['chart']['cell'] = 'text-align: center;';
|
||||
$table->data['chart']['cell'] = $item['chart'].'<br><br><br><br>';
|
||||
$table->data['chart']['cell'] = $item['chart'];
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -528,7 +528,7 @@ $.fn.VUseTooltip = function() {
|
|||
previousLabel = item.series.label;
|
||||
$("#tooltip").remove();
|
||||
|
||||
var x = item.datapoint[0];
|
||||
//var x = item.datapoint[0];
|
||||
|
||||
var y = item.datapoint[1];
|
||||
if (typeof y != "string") {
|
||||
|
@ -2428,63 +2428,27 @@ function pandoraFlotArea(
|
|||
unit
|
||||
);
|
||||
} else {
|
||||
var min_y_array;
|
||||
var min_y = 0;
|
||||
var min_bigger = "";
|
||||
var max_y_array;
|
||||
var max_y = 0;
|
||||
var max_bigger = "";
|
||||
var avg_y_array;
|
||||
var avg_y = 0;
|
||||
var avg_bigger = "";
|
||||
|
||||
$.each(update_legend, function(index, value) {
|
||||
if (!value[x]) {
|
||||
x = x + 1;
|
||||
if (typeof value[x] !== "undefined") {
|
||||
data_legend[index] =
|
||||
" Min: " +
|
||||
number_format(value[x].min, 0, unit, short_data, divisor) +
|
||||
" Max: " +
|
||||
number_format(value[x].max, 0, unit, short_data, divisor) +
|
||||
" Avg: " +
|
||||
number_format(value[x].avg, 0, unit, short_data, divisor);
|
||||
}
|
||||
if (typeof value[x].min !== "undefined" && value[x].min) {
|
||||
min_y_array = format_unit_yaxes(value[x].min);
|
||||
min_y = min_y_array["y"];
|
||||
min_bigger = min_y_array["unit"];
|
||||
} else {
|
||||
min_y = 0;
|
||||
min_bigger = "";
|
||||
}
|
||||
|
||||
if (typeof value[x].max !== "undefined" && value[x].max) {
|
||||
max_y_array = format_unit_yaxes(value[x].max);
|
||||
max_y = max_y_array["y"];
|
||||
max_bigger = max_y_array["unit"];
|
||||
} else {
|
||||
max_y = 0;
|
||||
max_bigger = "";
|
||||
}
|
||||
|
||||
if (typeof value[x].avg !== "undefined" && value[x].avg) {
|
||||
avg_y_array = format_unit_yaxes(value[x].avg);
|
||||
avg_y = avg_y_array["y"];
|
||||
avg_bigger = avg_y_array["unit"];
|
||||
} else {
|
||||
avg_y = 0;
|
||||
avg_bigger = "";
|
||||
}
|
||||
|
||||
data_legend[index] =
|
||||
" Min: " +
|
||||
number_format(value[x].min, 0, unit, short_data, divisor) +
|
||||
" Max: " +
|
||||
number_format(value[x].max, 0, unit, short_data, divisor) +
|
||||
" Avg: " +
|
||||
number_format(value[x].avg, 0, unit, short_data, divisor);
|
||||
});
|
||||
|
||||
label_aux =
|
||||
legend[series.label].split(": Min")[0] +
|
||||
": " +
|
||||
data_legend[series.label];
|
||||
$("#legend_" + graph_id + " .legendLabel")
|
||||
.eq(i)
|
||||
.html(label_aux);
|
||||
if (typeof data_legend[series.label] !== "undefined") {
|
||||
label_aux =
|
||||
legend[series.label].split(": Min")[0] +
|
||||
": " +
|
||||
data_legend[series.label];
|
||||
$("#legend_" + graph_id + " .legendLabel")
|
||||
.eq(i)
|
||||
.html(label_aux);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2700,7 +2664,15 @@ function pandoraFlotArea(
|
|||
}
|
||||
|
||||
function lFormatter(v) {
|
||||
return '<span style="color:' + legend_color + '">' + legend[v] + "</span>";
|
||||
var style =
|
||||
"color:" +
|
||||
legend_color +
|
||||
"; font-family:" +
|
||||
font +
|
||||
"Font; font-size:" +
|
||||
(parseInt(font_size) + 2) +
|
||||
"px;";
|
||||
return '<span style="' + style + '">' + legend[v] + "</span>";
|
||||
}
|
||||
|
||||
$("#overview_" + graph_id).css("display", "none");
|
||||
|
|
|
@ -413,6 +413,15 @@ select:-internal-list-box {
|
|||
src: url("../fonts/unicode.ttf") format("truetype");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "opensansFont";
|
||||
src: url("../../fonts/opensans.woff2") format("woff2");
|
||||
}
|
||||
|
||||
.opensansfont {
|
||||
font-family: opensansFont, sans-serif;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "roboto";
|
||||
src: url("../../fonts/roboto.woff2") format("woff2");
|
||||
|
@ -1424,90 +1433,6 @@ div#agent_wizard_subtabs {
|
|||
line-height: 18pt;
|
||||
}
|
||||
|
||||
/*
|
||||
span.users {
|
||||
background: url(../../images/group.png) no-repeat;
|
||||
}
|
||||
span.agents {
|
||||
background: url(../../images/bricks.png) no-repeat;
|
||||
}
|
||||
span.data {
|
||||
background: url(../../images/data.png) no-repeat;
|
||||
}
|
||||
span.alerts {
|
||||
background: url(../../images/bell.png) no-repeat;
|
||||
}
|
||||
span.time {
|
||||
background: url(../../images/hourglass.png) no-repeat;
|
||||
}
|
||||
span.net {
|
||||
background: url(../../images/network.png) no-repeat;
|
||||
}
|
||||
span.master {
|
||||
background: url(../../images/master.png) no-repeat;
|
||||
}
|
||||
span.wmi {
|
||||
background: url(../../images/wmi.png) no-repeat;
|
||||
}
|
||||
span.prediction {
|
||||
background: url(../../images/chart_bar.png) no-repeat;
|
||||
}
|
||||
span.plugin {
|
||||
background: url(../../images/plugin.png) no-repeat;
|
||||
}
|
||||
span.export {
|
||||
background: url(../../images/database_refresh.png) no-repeat;
|
||||
}
|
||||
span.snmp {
|
||||
background: url(../../images/snmp.png) no-repeat;
|
||||
}
|
||||
span.binary {
|
||||
background: url(../../images/binary.png) no-repeat;
|
||||
}
|
||||
span.recon {
|
||||
background: url(../../images/recon.png) no-repeat;
|
||||
}
|
||||
span.rmess {
|
||||
background: url(../../images/email_open.png) no-repeat;
|
||||
}
|
||||
span.nrmess {
|
||||
background: url(../../images/email.png) no-repeat;
|
||||
}
|
||||
span.recon_server {
|
||||
background: url(../../images/recon.png) no-repeat;
|
||||
}
|
||||
span.wmi_server {
|
||||
background: url(../../images/wmi.png) no-repeat;
|
||||
}
|
||||
span.export_server {
|
||||
background: url(../../images/server_export.png) no-repeat;
|
||||
}
|
||||
span.inventory_server {
|
||||
background: url(../../images/page_white_text.png) no-repeat;
|
||||
}
|
||||
span.web_server {
|
||||
background: url(../../images/world.png) no-repeat;
|
||||
}
|
||||
*/
|
||||
|
||||
/* This kind of span do not have any sense, should be replaced on PHP code
|
||||
by a real img in code. They are not useful because insert too much margin around
|
||||
(for example, not valid to use in the table of server view */
|
||||
/*span.users, span.agents, span.data, span.alerts, span.time, span.net,
|
||||
span.master, span.snmp, span.binary, span.recon, span.wmi, span.prediction,
|
||||
span.plugin, span.plugin, span.export, span.recon_server, span.wmi_server,
|
||||
span.export_server, span.inventory_server, span.web_server {
|
||||
margin-left: 4px;
|
||||
margin-top: 10px;
|
||||
padding: 4px 8px 12px 30px;
|
||||
display: block;
|
||||
}
|
||||
span.rmess, span.nrmess {
|
||||
margin-left: 14px;
|
||||
padding: 1px 0px 10px 30px;
|
||||
display: block;
|
||||
}*/
|
||||
|
||||
/* New styles for data box */
|
||||
/*
|
||||
* ---------------------------------------------------------------------
|
||||
|
@ -1603,24 +1528,6 @@ table.databox {
|
|||
color: #333;
|
||||
}
|
||||
|
||||
/* For use in Netflow */
|
||||
/*
|
||||
table.databox_grid {
|
||||
margin: 25px;
|
||||
}
|
||||
|
||||
table.databox_grid > th {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
table.databox_grid > td {
|
||||
padding: 6px;
|
||||
margin: 4px;
|
||||
border-bottom: 1px solid #acacac;
|
||||
border-right: 1px solid #acacac;
|
||||
}
|
||||
*/
|
||||
|
||||
/* events */
|
||||
table.alternate tr:nth-child(odd) td {
|
||||
background-color: #ffffff;
|
||||
|
@ -1636,50 +1543,6 @@ table.rounded_cells td {
|
|||
border-radius: 6px;
|
||||
}
|
||||
|
||||
/*#head_l {
|
||||
float: left;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
#head_r {
|
||||
float: right;
|
||||
text-align: right;
|
||||
margin-right: 10px;
|
||||
padding-top: 0px;
|
||||
}
|
||||
#head_m {
|
||||
position: absolute;
|
||||
padding-top: 6px;
|
||||
padding-left: 12em;
|
||||
}*/
|
||||
/*span#logo_text1 {
|
||||
font: bolder 3em Arial, Sans-serif;
|
||||
letter-spacing: -2px;
|
||||
color: #eee;
|
||||
}
|
||||
span#logo_text2 {
|
||||
font: 3em Arial, Sans-serif;
|
||||
letter-spacing: -2px;
|
||||
color: #aaa;
|
||||
}
|
||||
|
||||
div#logo_text3 {
|
||||
text-align: right;
|
||||
font: 2em Arial, Sans-serif;
|
||||
letter-spacing: 6px;
|
||||
color: #aaa;
|
||||
font-weight: bold;
|
||||
margin-top: 0px;
|
||||
margin-left: 4px;
|
||||
padding-top: 0px;
|
||||
}
|
||||
|
||||
.bb0 {
|
||||
border-bottom: 0px;
|
||||
}
|
||||
.bt0 {
|
||||
border-top: 0px;
|
||||
}*/
|
||||
.action-buttons {
|
||||
text-align: right;
|
||||
}
|
||||
|
@ -1722,7 +1585,6 @@ input.config,
|
|||
input.filter,
|
||||
input.cancel,
|
||||
input.default,
|
||||
input.filter,
|
||||
input.pdf,
|
||||
input.spinn {
|
||||
padding-right: 30px;
|
||||
|
@ -1861,19 +1723,6 @@ div#main_pure {
|
|||
.ui-draggable {
|
||||
cursor: move;
|
||||
}
|
||||
/*#layout_trash_drop {
|
||||
float: right;
|
||||
width: 300px;
|
||||
height: 180px;
|
||||
background: #fff url("../../images/trash.png") no-repeat bottom left;
|
||||
}
|
||||
#layout_trash_drop div {
|
||||
display: block;
|
||||
}
|
||||
#layout_editor_drop {
|
||||
float: left;
|
||||
width: 300px;
|
||||
}*/
|
||||
|
||||
/* IE 7 Hack */
|
||||
#editor {
|
||||
|
@ -1923,12 +1772,6 @@ select#template,
|
|||
select#action {
|
||||
width: 250px;
|
||||
}
|
||||
/*#label-checkbox-matches_value,
|
||||
#label-checkbox-copy_modules,
|
||||
#label-checkbox-copy_alerts {
|
||||
display: inline;
|
||||
font-weight: normal;
|
||||
}*/
|
||||
|
||||
/* Modules */
|
||||
table#simple {
|
||||
|
|
|
@ -61,7 +61,7 @@ thead.header_tr tr th.th_first {
|
|||
}
|
||||
|
||||
thead.header_tr tr th.th_description {
|
||||
background-color: #fafafa;
|
||||
background-color: #ffffff;
|
||||
color: #1c1c1c;
|
||||
text-align: justify;
|
||||
}
|
||||
|
@ -126,7 +126,6 @@ div.mpdf_toc_level_1 {
|
|||
margin-left: 2em;
|
||||
text-indent: -2em;
|
||||
padding-right: 1em;
|
||||
padding-bottom: 1em;
|
||||
}
|
||||
|
||||
span.mpdf_toc_t_level_1 {
|
||||
|
|
|
@ -105,7 +105,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
|
|||
('show_vc', 1),
|
||||
('inventory_changes_blacklist', '1,2,20,21'),
|
||||
('custom_report_front', 0),
|
||||
('custom_report_front_font', 'FreeSans.ttf'),
|
||||
('custom_report_front_font', 'opensans.ttf'),
|
||||
('custom_report_front_logo', 'images/pandora_logo_white.jpg'),
|
||||
('custom_report_front_header', ''),
|
||||
('custom_report_front_footer', ''),
|
||||
|
|
Loading…
Reference in New Issue