mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 00:34:46 +02:00
Merge branch '1827-Graficas_TIP_eje_x_no_mantiene_ratio' into 'develop'
1827 graficas tip eje x no mantiene ratio See merge request artica/pandorafms!1529
This commit is contained in:
commit
597eb1fb16
@ -59,6 +59,10 @@ $table->data[1][0] = __('Remote config directory') .
|
|||||||
|
|
||||||
$table->data[1][1] = html_print_input_text ('remote_config', io_safe_output($config["remote_config"]), '', 30, 100, true);
|
$table->data[1][1] = html_print_input_text ('remote_config', io_safe_output($config["remote_config"]), '', 30, 100, true);
|
||||||
|
|
||||||
|
$table->data[2][0] = __('Phantomjs bin directory') . ui_print_help_tip (__("Directory where phantomjs binary file exists and has execution grants."), true);
|
||||||
|
|
||||||
|
$table->data[2][1] = html_print_input_text ('phantomjs_bin', io_safe_output($config["phantomjs_bin"]), '', 30, 100, true);
|
||||||
|
|
||||||
$table->data[6][0] = __('Auto login (hash) password');
|
$table->data[6][0] = __('Auto login (hash) password');
|
||||||
$table->data[6][1] = html_print_input_password ('loginhash_pwd', io_output_password($config["loginhash_pwd"]), '', 15, 15, true);
|
$table->data[6][1] = html_print_input_password ('loginhash_pwd', io_output_password($config["loginhash_pwd"]), '', 15, 15, true);
|
||||||
|
|
||||||
|
@ -3229,7 +3229,7 @@ function generator_chart_to_pdf($type_graph_pdf, $params, $params_combined = fal
|
|||||||
$session_id = session_id();
|
$session_id = session_id();
|
||||||
|
|
||||||
$result = exec(
|
$result = exec(
|
||||||
"phantomjs " . $file_js . " " .
|
$config['phantomjs_bin'] ."/phantomjs " . $file_js . " " .
|
||||||
$url . " '" .
|
$url . " '" .
|
||||||
$type_graph_pdf . "' '" .
|
$type_graph_pdf . "' '" .
|
||||||
$params_encode_json . "' '" .
|
$params_encode_json . "' '" .
|
||||||
|
@ -129,9 +129,10 @@ function config_update_config () {
|
|||||||
$error_update[] = __('Language settings');
|
$error_update[] = __('Language settings');
|
||||||
if (!config_update_value ('remote_config', (string) get_parameter ('remote_config')))
|
if (!config_update_value ('remote_config', (string) get_parameter ('remote_config')))
|
||||||
$error_update[] = __('Remote config directory');
|
$error_update[] = __('Remote config directory');
|
||||||
|
if (!config_update_value ('phantomjs_bin', (string) get_parameter ('phantomjs_bin')))
|
||||||
|
$error_update[] = __('phantomjs config directory');
|
||||||
if (!config_update_value ('loginhash_pwd', io_input_password((string) get_parameter ('loginhash_pwd'))))
|
if (!config_update_value ('loginhash_pwd', io_input_password((string) get_parameter ('loginhash_pwd'))))
|
||||||
$error_update[] = __('Auto login (hash) password');
|
$error_update[] = __('Auto login (hash) password');
|
||||||
|
|
||||||
if (!config_update_value ('timesource', (string) get_parameter ('timesource')))
|
if (!config_update_value ('timesource', (string) get_parameter ('timesource')))
|
||||||
$error_update[] = __('Time source');
|
$error_update[] = __('Time source');
|
||||||
if (!config_update_value ('autoupdate', (bool) get_parameter ('autoupdate')))
|
if (!config_update_value ('autoupdate', (bool) get_parameter ('autoupdate')))
|
||||||
@ -804,12 +805,9 @@ function config_update_config () {
|
|||||||
if (!config_update_value('ehorus_custom_field', (string) get_parameter('ehorus_custom_field', $config['ehorus_custom_field'])))
|
if (!config_update_value('ehorus_custom_field', (string) get_parameter('ehorus_custom_field', $config['ehorus_custom_field'])))
|
||||||
$error_update[] = __('eHorus id custom field');
|
$error_update[] = __('eHorus id custom field');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($error_update) > 0) {
|
if (count($error_update) > 0) {
|
||||||
$config['error_config_update_config'] = array();
|
$config['error_config_update_config'] = array();
|
||||||
$config['error_config_update_config']['correct'] = false;
|
$config['error_config_update_config']['correct'] = false;
|
||||||
@ -820,7 +818,7 @@ function config_update_config () {
|
|||||||
$config['error_config_update_config'] = array();
|
$config['error_config_update_config'] = array();
|
||||||
$config['error_config_update_config']['correct'] = true;
|
$config['error_config_update_config']['correct'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
enterprise_include_once('include/functions_policies.php');
|
enterprise_include_once('include/functions_policies.php');
|
||||||
$enterprise = enterprise_include_once ('include/functions_skins.php');
|
$enterprise = enterprise_include_once ('include/functions_skins.php');
|
||||||
if ($enterprise !== ENTERPRISE_NOT_HOOK) {
|
if ($enterprise !== ENTERPRISE_NOT_HOOK) {
|
||||||
@ -869,7 +867,17 @@ function config_process_config () {
|
|||||||
|
|
||||||
config_update_value ('remote_config', $default);
|
config_update_value ('remote_config', $default);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isset ($config['phantomjs_bin'])) {
|
||||||
|
if ($is_windows){
|
||||||
|
$default = 'C:\\PandoraFMS\\Pandora_Server\\data_in';
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$default = '/usr/bin';
|
||||||
|
}
|
||||||
|
config_update_value ('phantomjs_bin', $default);
|
||||||
|
}
|
||||||
|
|
||||||
if (!isset ($config['date_format'])) {
|
if (!isset ($config['date_format'])) {
|
||||||
config_update_value ('date_format', 'F j, Y, g:i a');
|
config_update_value ('date_format', 'F j, Y, g:i a');
|
||||||
}
|
}
|
||||||
@ -2178,21 +2186,28 @@ function config_check () {
|
|||||||
sprintf(__('Recommended value is: %s'), sprintf(__('%s or greater'), '800M')) . '<br><br>' . __('Please, change it on your PHP configuration file (php.ini) or contact with administrator (Dont forget restart apache process after changes)'),
|
sprintf(__('Recommended value is: %s'), sprintf(__('%s or greater'), '800M')) . '<br><br>' . __('Please, change it on your PHP configuration file (php.ini) or contact with administrator (Dont forget restart apache process after changes)'),
|
||||||
sprintf(__("Not recommended '%s' value in PHP configuration"), 'upload_max_filesize'));
|
sprintf(__("Not recommended '%s' value in PHP configuration"), 'upload_max_filesize'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$PHPmemory_limit_min = config_return_in_bytes('500M');
|
$PHPmemory_limit_min = config_return_in_bytes('500M');
|
||||||
|
|
||||||
if ($PHPmemory_limit < $PHPmemory_limit_min && $PHPmemory_limit !== '-1') {
|
if ($PHPmemory_limit < $PHPmemory_limit_min && $PHPmemory_limit !== '-1') {
|
||||||
set_pandora_error_for_header(
|
set_pandora_error_for_header(
|
||||||
sprintf(__('Recommended value is: %s'), sprintf(__('%s or greater'), '500M')) . '<br><br>' . __('Please, change it on your PHP configuration file (php.ini) or contact with administrator'),
|
sprintf(__('Recommended value is: %s'), sprintf(__('%s or greater'), '500M')) . '<br><br>' . __('Please, change it on your PHP configuration file (php.ini) or contact with administrator'),
|
||||||
sprintf(__("Not recommended '%s' value in PHP configuration"), 'memory_limit'));
|
sprintf(__("Not recommended '%s' value in PHP configuration"), 'memory_limit'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match("/system/", $PHPdisable_functions) or preg_match("/exec/", $PHPdisable_functions)) {
|
if (preg_match("/system/", $PHPdisable_functions) or preg_match("/exec/", $PHPdisable_functions)) {
|
||||||
set_pandora_error_for_header(
|
set_pandora_error_for_header(
|
||||||
__("Variable disable_functions containts functions system() or exec(), in PHP configuration file (php.ini)"). '<br /><br />' .
|
__("Variable disable_functions containts functions system() or exec(), in PHP configuration file (php.ini)"). '<br /><br />' .
|
||||||
__('Please, change it on your PHP configuration file (php.ini) or contact with administrator (Dont forget restart apache process after changes)'), __("Problems with disable functions in PHP.INI"));
|
__('Please, change it on your PHP configuration file (php.ini) or contact with administrator (Dont forget restart apache process after changes)'), __("Problems with disable functions in PHP.INI"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$result_ejectuion = exec($config['phantomjs_bin'] . 'phantomjs --version');
|
||||||
|
if(isset($result_ejectuion) || $result_ejectuion == ''){
|
||||||
|
set_pandora_error_for_header(
|
||||||
|
__('To be able to create images of the graphs for PDFs, please install the phantom.js extension. For that, it is necessary to follow these steps:') .
|
||||||
|
'<a src="">Click here</a>',
|
||||||
|
__("phantomjs is not installed"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function config_return_in_bytes($val) {
|
function config_return_in_bytes($val) {
|
||||||
|
@ -234,27 +234,20 @@ function grafico_modulo_sparse_data_chart (
|
|||||||
|
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
|
//XXX add zoom
|
||||||
|
$data_slice = $date_array['period'] / 250; //zoom
|
||||||
|
|
||||||
if( $data_module_graph['id_module_type'] == 23 ||
|
if( $data_module_graph['id_module_type'] == 23 ||
|
||||||
$data_module_graph['id_module_type'] == 3 ||
|
$data_module_graph['id_module_type'] == 3 ||
|
||||||
$data_module_graph['id_module_type'] == 17 ||
|
$data_module_graph['id_module_type'] == 17 ||
|
||||||
$data_module_graph['id_module_type'] == 10 ||
|
$data_module_graph['id_module_type'] == 10 ||
|
||||||
$data_module_graph['id_module_type'] == 33 ){
|
$data_module_graph['id_module_type'] == 33 ){
|
||||||
|
|
||||||
//XXXXXXXXXXX SLICES
|
|
||||||
/*
|
|
||||||
"SELECT count(*) as data, min(utimestamp) as utimestamp
|
|
||||||
FROM tagente_datos_string
|
|
||||||
WHERE id_agente_modulo = 227
|
|
||||||
AND utimestamp > 1527584831
|
|
||||||
AND utimestamp < 1527671231
|
|
||||||
GROUP by ROUND(utimestamp / 300);"
|
|
||||||
*/
|
|
||||||
$data = db_get_all_rows_filter (
|
$data = db_get_all_rows_filter (
|
||||||
'tagente_datos_string',
|
'tagente_datos_string',
|
||||||
array ('id_agente_modulo' => (int)$agent_module_id,
|
array ('id_agente_modulo' => (int)$agent_module_id,
|
||||||
"utimestamp > '". $date_array['start_date']. "'",
|
"utimestamp > '". $date_array['start_date']. "'",
|
||||||
"utimestamp < '". $date_array['final_date'] . "'",
|
"utimestamp < '". $date_array['final_date'] . "'",
|
||||||
'group' => "ROUND(utimestamp / 300)",
|
'group' => "ROUND(utimestamp / $data_slice)",
|
||||||
'order' => 'utimestamp ASC'),
|
'order' => 'utimestamp ASC'),
|
||||||
array ('count(*) as datos', 'min(utimestamp) as utimestamp'),
|
array ('count(*) as datos', 'min(utimestamp) as utimestamp'),
|
||||||
'AND',
|
'AND',
|
||||||
@ -262,33 +255,17 @@ function grafico_modulo_sparse_data_chart (
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
/*
|
$data = db_get_all_rows_filter (
|
||||||
if(true){
|
'tagente_datos',
|
||||||
$data = db_get_all_rows_filter (
|
array ('id_agente_modulo' => (int)$agent_module_id,
|
||||||
'tagente_datos',
|
"utimestamp > '". $date_array['start_date']. "'",
|
||||||
array ('id_agente_modulo' => (int)$agent_module_id,
|
"utimestamp < '". $date_array['final_date'] . "'",
|
||||||
"utimestamp > '". $date_array['start_date']. "'",
|
'group' => "ROUND(utimestamp / $data_slice)",
|
||||||
"utimestamp < '". $date_array['final_date'] . "'",
|
'order' => 'utimestamp ASC'),
|
||||||
'group' => "ROUND(utimestamp / 86400)",
|
array ('max(datos) as datos', 'min(utimestamp) as utimestamp'),
|
||||||
'order' => 'utimestamp ASC'),
|
'AND',
|
||||||
array ('max(datos) as datos', 'min(utimestamp) as utimestamp'),
|
$data_module_graph['history_db']
|
||||||
'AND',
|
);
|
||||||
$data_module_graph['history_db']
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
*/
|
|
||||||
$data = db_get_all_rows_filter (
|
|
||||||
'tagente_datos',
|
|
||||||
array ('id_agente_modulo' => (int)$agent_module_id,
|
|
||||||
"utimestamp > '". $date_array['start_date']. "'",
|
|
||||||
"utimestamp < '". $date_array['final_date'] . "'",
|
|
||||||
'order' => 'utimestamp ASC'),
|
|
||||||
array ('datos', 'utimestamp'),
|
|
||||||
'AND',
|
|
||||||
$data_module_graph['history_db']
|
|
||||||
);
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($data === false){
|
if($data === false){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user