Merge remote-tracking branch 'origin/develop' into ent-3961-Añadir-caché-para-los-elementos-de-la-Consola-Visual

This commit is contained in:
Alejandro Gallardo Escobar 2019-05-27 11:31:24 +02:00
commit ce8ba54e09
38 changed files with 1053 additions and 655 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.735-190523 Version: 7.0NG.735-190527
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="7.0NG.735-190523" pandora_version="7.0NG.735-190527"
echo "Test if you has the tools for to make the packages." echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

@ -42,7 +42,7 @@ my $Sem = undef;
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.735'; use constant AGENT_VERSION => '7.0NG.735';
use constant AGENT_BUILD => '190523'; use constant AGENT_BUILD => '190527';
# Agent log default file size maximum and instances # Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000; use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.735 %define version 7.0NG.735
%define release 190523 %define release 190527
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.735 %define version 7.0NG.735
%define release 190523 %define release 190527
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -10,7 +10,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.735" PI_VERSION="7.0NG.735"
PI_BUILD="190523" PI_BUILD="190527"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{190523} {190527}
ViewReadme ViewReadme
{Yes} {Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils; using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1 #define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.735(Build 190523)") #define PANDORA_VERSION ("7.0NG.735(Build 190527)")
string pandora_path; string pandora_path;
string pandora_dir; string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST" VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent" VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.735(Build 190523))" VALUE "ProductVersion", "(7.0NG.735(Build 190527))"
VALUE "FileVersion", "1.0.0.0" VALUE "FileVersion", "1.0.0.0"
END END
END END

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 7.0NG.735-190523 Version: 7.0NG.735-190527
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="7.0NG.735-190523" pandora_version="7.0NG.735-190527"
package_pear=0 package_pear=0
package_pandora=1 package_pandora=1

View File

@ -169,6 +169,9 @@ if ($registration) {
} }
} }
$newsletter = null;
?> ?>
<script type="text/javascript"> <script type="text/javascript">

View File

@ -1220,6 +1220,7 @@ if ($update_module || $create_module) {
// Get macros. // Get macros.
$macros = (string) get_parameter('macros'); $macros = (string) get_parameter('macros');
$macros_names = (array) get_parameter('macro_name', []);
if (!empty($macros)) { if (!empty($macros)) {
$macros = json_decode(base64_decode($macros), true); $macros = json_decode(base64_decode($macros), true);
@ -1230,10 +1231,18 @@ if ($update_module || $create_module) {
$m_hide = $m['hide']; $m_hide = $m['hide'];
} }
if ($m_hide == '1') { if ($update_module) {
$macros[$k]['value'] = io_input_password(get_parameter($m['macro'], '')); if ($m_hide == '1') {
$macros[$k]['value'] = io_input_password(get_parameter($m['macro'], ''));
} else {
$macros[$k]['value'] = get_parameter($m['macro'], '');
}
} else { } else {
$macros[$k]['value'] = get_parameter($m['macro'], ''); if ($m_hide == '1') {
$macros[$k]['value'] = io_input_password($macros_names[$k]);
} else {
$macros[$k]['value'] = $macros_names[$k];
}
} }
} }

View File

@ -79,7 +79,7 @@ push_table_simple($data, 'plugin_1');
$data = []; $data = [];
$data[0] = 'macro_desc'; $data[0] = 'macro_desc';
$data[0] .= ui_print_help_tip('macro_help', true); $data[0] .= ui_print_help_tip('macro_help', true);
$data[1] = html_print_input_text('macro_name', 'macro_value', '', 100, 1024, true); $data[1] = html_print_input_text('macro_name[]', 'macro_value', '', 100, 1024, true);
$table_simple->colspan['macro_field'][1] = 3; $table_simple->colspan['macro_field'][1] = 3;
$table_simple->rowstyle['macro_field'] = 'display:none'; $table_simple->rowstyle['macro_field'] = 'display:none';

View File

@ -72,6 +72,7 @@ if (! check_acl($config['id_user'], 0, 'AW')) {
$options_policies = []; $options_policies = [];
$policies_options = enterprise_hook('massive_policies_options'); $policies_options = enterprise_hook('massive_policies_options');
$policies_options = array_unique($policies_options);
if ($policies_options != ENTERPRISE_NOT_HOOK) { if ($policies_options != ENTERPRISE_NOT_HOOK) {
$options_policies = array_merge($options_policies, $policies_options); $options_policies = array_merge($options_policies, $policies_options);

View File

@ -877,7 +877,7 @@ $class = 'databox filters';
<tr id="row_label" style="" class="datos"> <tr id="row_label" style="" class="datos">
<td style="font-weight:bold;"> <td style="font-weight:bold;">
<?php <?php
echo __('Label').ui_print_help_icon('reports_label_field', true); echo __('Label');
?> ?>
</td> </td>
<td style=""> <td style="">
@ -981,11 +981,6 @@ $class = 'databox filters';
<td style="font-weight:bold;"> <td style="font-weight:bold;">
<?php <?php
echo __('Period'); echo __('Period');
if ($type == 'projection_graph') {
echo ui_print_help_icon('projection_graph', true);
} else {
echo ui_print_help_icon('prediction_date', true);
}
?> ?>
</td> </td>
<td style=""> <td style="">
@ -1004,10 +999,7 @@ $class = 'databox filters';
<tr id="row_estimate" style="" class="datos"> <tr id="row_estimate" style="" class="datos">
<td style="font-weight:bold;"> <td style="font-weight:bold;">
<?php <?php
echo __('Projection period').ui_print_help_icon( echo __('Projection period');
'projection_graph',
true
);
?> ?>
</td> </td>
<td style=""> <td style="">
@ -1026,10 +1018,7 @@ $class = 'databox filters';
<tr id="row_interval" style="" class="datos"> <tr id="row_interval" style="" class="datos">
<td style="font-weight:bold;"> <td style="font-weight:bold;">
<?php <?php
echo __('Data range').ui_print_help_icon( echo __('Data range');
'prediction_date',
true
);
?> ?>
</td> </td>
<td> <td>
@ -4865,7 +4854,6 @@ function chooseType() {
switch (type) { switch (type) {
case 'event_report_agent': case 'event_report_agent':
case 'simple_graph': case 'simple_graph':
case 'agent_configuration':
case 'event_report_module': case 'event_report_module':
case 'alert_report_agent': case 'alert_report_agent':
case 'alert_report_module': case 'alert_report_module':
@ -4876,8 +4864,6 @@ function chooseType() {
case 'min_value': case 'min_value':
case 'max_value': case 'max_value':
case 'avg_value': case 'avg_value':
case 'projection_graph':
case 'prediction_date':
case 'TTRT': case 'TTRT':
case 'TTO': case 'TTO':
case 'MTBF': case 'MTBF':

View File

@ -745,7 +745,12 @@ function message_check_delete_items() {
} }
function added_ids_deleted_items_to_hidden_input() { function added_ids_deleted_items_to_hidden_input() {
message_check_delete_items(); var success = message_check_delete_items();
if(success === false){
$(".check_delete").prop("checked", false);
return false;
}
var ids = ''; var ids = '';
var first = true; var first = true;

View File

@ -28,7 +28,7 @@ $action_update_url_update_manager = (bool) get_parameter(
); );
if (!$action_update_url_update_manager) { if (!$action_update_url_update_manager) {
$url_update_manager = get_parameter('url_update_manager', get_um_url()); $url_update_manager = get_parameter('url_update_manager', $config['url_update_manager']);
$update_manager_proxy_server = get_parameter('update_manager_proxy_server', $config['update_manager_proxy_server']); $update_manager_proxy_server = get_parameter('update_manager_proxy_server', $config['update_manager_proxy_server']);
$update_manager_proxy_port = get_parameter('update_manager_proxy_port', $config['update_manager_proxy_port']); $update_manager_proxy_port = get_parameter('update_manager_proxy_port', $config['update_manager_proxy_port']);
$update_manager_proxy_user = get_parameter('update_manager_proxy_user', $config['update_manager_proxy_user']); $update_manager_proxy_user = get_parameter('update_manager_proxy_user', $config['update_manager_proxy_user']);

View File

@ -20,7 +20,7 @@
/** /**
* Pandora build version and version * Pandora build version and version
*/ */
$build_version = 'PC190523'; $build_version = 'PC190527';
$pandora_version = 'v7.0NG.735'; $pandora_version = 'v7.0NG.735';
// Do not overwrite default timezone set if defined. // Do not overwrite default timezone set if defined.

File diff suppressed because it is too large Load Diff

View File

@ -1914,6 +1914,11 @@ function reporting_event_report_module(
$return['title'] = $content['name']; $return['title'] = $content['name'];
$return['subtitle'] = agents_get_alias($content['id_agent']).' - '.io_safe_output(modules_get_agentmodule_name($content['id_agent_module'])); $return['subtitle'] = agents_get_alias($content['id_agent']).' - '.io_safe_output(modules_get_agentmodule_name($content['id_agent_module']));
$return['label'] = (isset($content['style']['label'])) ? $content['style']['label'] : '';
if ($return['label'] != '') {
$return['label'] = reporting_label_macro($content, $return['label']);
}
if (is_metaconsole()) { if (is_metaconsole()) {
metaconsole_restore_db(); metaconsole_restore_db();
} }
@ -1921,7 +1926,6 @@ function reporting_event_report_module(
$return['description'] = $content['description']; $return['description'] = $content['description'];
$return['show_extended_events'] = $content['show_extended_events']; $return['show_extended_events'] = $content['show_extended_events'];
$return['date'] = reporting_get_date_text($report, $content); $return['date'] = reporting_get_date_text($report, $content);
$return['label'] = (isset($content['style']['label'])) ? $content['style']['label'] : '';
$event_filter = $content['style']; $event_filter = $content['style'];
$return['show_summary_group'] = $event_filter['show_summary_group']; $return['show_summary_group'] = $event_filter['show_summary_group'];
@ -2741,6 +2745,17 @@ function reporting_group_report($report, $content)
} }
/**
* Create data report event agent.
*
* @param array $report Data report.
* @param array $content Content report.
* @param string $type Type report.
* @param integer $force_width_chart Force width.
* @param integer $force_height_chart Force height.
*
* @return array Data.
*/
function reporting_event_report_agent( function reporting_event_report_agent(
$report, $report,
$content, $content,
@ -2761,26 +2776,26 @@ function reporting_event_report_agent(
$history = true; $history = true;
} }
$return['title'] = $content['name']; $return['title'] = $content['name'];
$return['subtitle'] = agents_get_alias($content['id_agent']); $return['subtitle'] = agents_get_alias($content['id_agent']);
$return['description'] = $content['description']; $return['description'] = $content['description'];
$return['date'] = reporting_get_date_text($report, $content); $return['date'] = reporting_get_date_text($report, $content);
$return['label'] = (isset($content['style']['label'])) ? $content['style']['label'] : '';
$return['show_summary_group'] = $content['style']['show_summary_group']; $return['show_summary_group'] = $content['style']['show_summary_group'];
$return['show_extended_events'] = $content['show_extended_events']; $return['show_extended_events'] = $content['show_extended_events'];
$style = $content['style']; $style = $content['style'];
// filter // Filter.
$show_summary_group = $style['show_summary_group']; $show_summary_group = $style['show_summary_group'];
$filter_event_severity = json_decode($style['filter_event_severity'], true); $filter_event_severity = json_decode($style['filter_event_severity'], true);
$filter_event_type = json_decode($style['filter_event_type'], true); $filter_event_type = json_decode($style['filter_event_type'], true);
$filter_event_status = json_decode($style['filter_event_status'], true); $filter_event_status = json_decode($style['filter_event_status'], true);
$filter_event_filter_search = $style['event_filter_search']; $filter_event_filter_search = $style['event_filter_search'];
// graph // Graph.
$event_graph_by_user_validator = $style['event_graph_by_user_validator']; $event_graph_by_user_validator = $style['event_graph_by_user_validator'];
$event_graph_by_criticity = $style['event_graph_by_criticity']; $event_graph_by_criticity = $style['event_graph_by_criticity'];
$event_graph_validated_vs_unvalidated = $style['event_graph_validated_vs_unvalidated']; $event_graph_validated_vs_unvalidated = $style['event_graph_validated_vs_unvalidated'];
$return['data'] = reporting_get_agents_detailed_event( $return['data'] = reporting_get_agents_detailed_event(
@ -2825,6 +2840,12 @@ function reporting_event_report_agent(
$metaconsole_dbtable = false; $metaconsole_dbtable = false;
} }
$label = (isset($content['style']['label'])) ? $content['style']['label'] : '';
if ($label != '') {
$label = reporting_label_macro($content, $label);
}
$return['label'] = $label;
if ($event_graph_by_user_validator) { if ($event_graph_by_user_validator) {
$data_graph = events_get_count_events_validated_by_user( $data_graph = events_get_count_events_validated_by_user(
['id_agent' => $content['id_agent']], ['id_agent' => $content['id_agent']],
@ -2908,7 +2929,7 @@ function reporting_event_report_agent(
metaconsole_restore_db(); metaconsole_restore_db();
} }
// total_events // Total events.
if ($return['data'] != '') { if ($return['data'] != '') {
$return['total_events'] = count($return['data']); $return['total_events'] = count($return['data']);
} else { } else {
@ -2941,7 +2962,11 @@ function reporting_historical_data($report, $content)
$return['subtitle'] = $agent_name.' - '.$module_name; $return['subtitle'] = $agent_name.' - '.$module_name;
$return['description'] = $content['description']; $return['description'] = $content['description'];
$return['date'] = reporting_get_date_text($report, $content); $return['date'] = reporting_get_date_text($report, $content);
$return['label'] = (isset($content['style']['label'])) ? $content['style']['label'] : ''; $return['label'] = (isset($content['style']['label'])) ? $content['style']['label'] : '';
if ($return['label'] != '') {
$return['label'] = reporting_label_macro($content, $return['label']);
}
$return['keys'] = [ $return['keys'] = [
__('Date'), __('Date'),
@ -3017,7 +3042,6 @@ function reporting_database_serialized($report, $content)
$return['subtitle'] = $agent_name.' - '.$module_name; $return['subtitle'] = $agent_name.' - '.$module_name;
$return['description'] = $content['description']; $return['description'] = $content['description'];
$return['date'] = reporting_get_date_text($report, $content); $return['date'] = reporting_get_date_text($report, $content);
$return['label'] = (isset($content['style']['label'])) ? $content['style']['label'] : '';
$keys = []; $keys = [];
if (isset($content['header_definition']) && ($content['header_definition'] != '')) { if (isset($content['header_definition']) && ($content['header_definition'] != '')) {
@ -3043,6 +3067,11 @@ function reporting_database_serialized($report, $content)
metaconsole_connect($server); metaconsole_connect($server);
} }
$return['label'] = (isset($content['style']['label'])) ? $content['style']['label'] : '';
if ($return['label'] != '') {
$return['label'] = reporting_label_macro($content, $return['label']);
}
$datelimit = ($report['datetime'] - $content['period']); $datelimit = ($report['datetime'] - $content['period']);
$search_in_history_db = db_search_in_history_db($datelimit); $search_in_history_db = db_search_in_history_db($datelimit);
@ -3589,7 +3618,12 @@ function reporting_alert_report_agent($report, $content)
$return['subtitle'] = $agent_name; $return['subtitle'] = $agent_name;
$return['description'] = $content['description']; $return['description'] = $content['description'];
$return['date'] = reporting_get_date_text($report, $content); $return['date'] = reporting_get_date_text($report, $content);
$return['label'] = (isset($content['style']['label'])) ? $content['style']['label'] : ''; $return['label'] = (isset($content['style']['label'])) ? $content['style']['label'] : '';
if ($return['label'] != '') {
$return['label'] = reporting_label_macro($content, $return['label']);
}
$module_list = agents_get_modules($content['id_agent']); $module_list = agents_get_modules($content['id_agent']);
$data = []; $data = [];
@ -3721,6 +3755,9 @@ function reporting_alert_report_module($report, $content)
$return['description'] = $content['description']; $return['description'] = $content['description'];
$return['date'] = reporting_get_date_text($report, $content); $return['date'] = reporting_get_date_text($report, $content);
$return['label'] = (isset($content['style']['label'])) ? $content['style']['label'] : ''; $return['label'] = (isset($content['style']['label'])) ? $content['style']['label'] : '';
if ($return['label'] != '') {
$return['label'] = reporting_label_macro($content, $return['label']);
}
$data_row = []; $data_row = [];
@ -3923,7 +3960,6 @@ function reporting_monitor_report($report, $content)
$return['subtitle'] = $agent_name.' - '.$module_name; $return['subtitle'] = $agent_name.' - '.$module_name;
$return['description'] = $content['description']; $return['description'] = $content['description'];
$return['date'] = reporting_get_date_text($report, $content); $return['date'] = reporting_get_date_text($report, $content);
$return['label'] = (isset($content['style']['label'])) ? $content['style']['label'] : '';
if ($config['metaconsole']) { if ($config['metaconsole']) {
$id_meta = metaconsole_get_id_server($content['server_name']); $id_meta = metaconsole_get_id_server($content['server_name']);
@ -3932,6 +3968,11 @@ function reporting_monitor_report($report, $content)
metaconsole_connect($server); metaconsole_connect($server);
} }
$return['label'] = (isset($content['style']['label'])) ? $content['style']['label'] : '';
if ($return['label'] != '') {
$return['label'] = reporting_label_macro($content, $return['label']);
}
$module_name = io_safe_output( $module_name = io_safe_output(
modules_get_agentmodule_name($content['id_agent_module']) modules_get_agentmodule_name($content['id_agent_module'])
); );
@ -7335,6 +7376,7 @@ function reporting_simple_graph(
$report, $report,
$content $content
); );
$label = (isset($content['style']['label'])) ? $content['style']['label'] : ''; $label = (isset($content['style']['label'])) ? $content['style']['label'] : '';
if ($label != '') { if ($label != '') {
$label = reporting_label_macro($content, $label); $label = reporting_label_macro($content, $label);
@ -7346,7 +7388,7 @@ function reporting_simple_graph(
$return['chart'] = ''; $return['chart'] = '';
// Get chart // Get chart.
reporting_set_conf_charts($width, $height, $only_image, $type, $content, $ttl); reporting_set_conf_charts($width, $height, $only_image, $type, $content, $ttl);
if (!empty($force_width_chart)) { if (!empty($force_width_chart)) {

View File

@ -955,6 +955,8 @@ function update_manager_get_config_values()
global $build_version; global $build_version;
global $pandora_version; global $pandora_version;
enterprise_include_once('include/functions_license.php');
$license = db_get_value( $license = db_get_value(
db_escape_key_identifier('value'), db_escape_key_identifier('value'),
'tupdate_settings', 'tupdate_settings',
@ -962,7 +964,13 @@ function update_manager_get_config_values()
'customer_key' 'customer_key'
); );
$limit_count = db_get_value_sql('SELECT count(*) FROM tagente'); $data = enterprise_hook('license_get_info');
if ($data === ENTERPRISE_NOT_HOOK) {
$limit_count = db_get_value_sql('SELECT count(*) FROM tagente');
} else {
$limit_count = $data['count_enabled'];
}
return [ return [
'license' => $license, 'license' => $license,
@ -1211,7 +1219,7 @@ function update_manager_check_online_free_packages_available()
]; ];
$curlObj = curl_init(); $curlObj = curl_init();
curl_setopt($curlObj, CURLOPT_URL, get_um_url()); curl_setopt($curlObj, CURLOPT_URL, get_um_url().'server.php');
curl_setopt($curlObj, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curlObj, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curlObj, CURLOPT_POST, true); curl_setopt($curlObj, CURLOPT_POST, true);
curl_setopt($curlObj, CURLOPT_POSTFIELDS, $params); curl_setopt($curlObj, CURLOPT_POSTFIELDS, $params);
@ -1285,7 +1293,7 @@ function update_manager_check_online_free_packages($is_ajax=true)
*/ */
$curlObj = curl_init(); $curlObj = curl_init();
curl_setopt($curlObj, CURLOPT_URL, get_um_url()); curl_setopt($curlObj, CURLOPT_URL, get_um_url().'server.php');
curl_setopt($curlObj, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curlObj, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curlObj, CURLOPT_POST, true); curl_setopt($curlObj, CURLOPT_POST, true);
curl_setopt($curlObj, CURLOPT_POSTFIELDS, $params); curl_setopt($curlObj, CURLOPT_POSTFIELDS, $params);
@ -1436,7 +1444,7 @@ function update_manager_curl_request($action, $additional_params=false)
$params['action'] = $action; $params['action'] = $action;
$curlObj = curl_init(); $curlObj = curl_init();
curl_setopt($curlObj, CURLOPT_URL, get_um_url()); curl_setopt($curlObj, CURLOPT_URL, get_um_url().'server.php');
curl_setopt($curlObj, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curlObj, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curlObj, CURLOPT_POST, true); curl_setopt($curlObj, CURLOPT_POST, true);
curl_setopt($curlObj, CURLOPT_POSTFIELDS, $params); curl_setopt($curlObj, CURLOPT_POSTFIELDS, $params);

View File

@ -1,3 +1,5 @@
/* global $ */
function pandoraFlotPie( function pandoraFlotPie(
graph_id, graph_id,
values, values,
@ -1074,7 +1076,6 @@ function pandoraFlotArea(
.split(".") .split(".")
.shift(); .shift();
var width = params.width; var width = params.width;
var height = params.height;
var vconsole = params.vconsole; var vconsole = params.vconsole;
var dashboard = params.dashboard; var dashboard = params.dashboard;
var menu = params.menu; var menu = params.menu;
@ -1088,9 +1089,8 @@ function pandoraFlotArea(
var background_color = params.backgroundColor; var background_color = params.backgroundColor;
var legend_color = params.legend_color; var legend_color = params.legend_color;
var update_legend = {}; var update_legend = {};
//XXXXXX colocar
var force_integer = 0; var force_integer = 0;
var title = params.title;
if (typeof type === "undefined" || type == "") { if (typeof type === "undefined" || type == "") {
type = params.type_graph; type = params.type_graph;
@ -1105,8 +1105,6 @@ function pandoraFlotArea(
var red_up = parseFloat(data_module_graph.c_max); var red_up = parseFloat(data_module_graph.c_max);
var yellow_inverse = parseInt(data_module_graph.w_inv); var yellow_inverse = parseInt(data_module_graph.w_inv);
var red_inverse = parseInt(data_module_graph.c_inv); var red_inverse = parseInt(data_module_graph.c_inv);
//XXXXX
var markins_graph = true; var markins_graph = true;
// If threshold and up are the same, that critical or warning is disabled // If threshold and up are the same, that critical or warning is disabled
@ -1934,11 +1932,12 @@ function pandoraFlotArea(
} }
} }
var stacked = null;
var filled_s = 0.3;
switch (type) { switch (type) {
case "line": case "line":
case 2: case 2:
stacked = null;
filled_s = false;
break; break;
case 3: case 3:
stacked = "stack"; stacked = "stack";
@ -1960,7 +1959,15 @@ function pandoraFlotArea(
var data_base = new Array(); var data_base = new Array();
var lineWidth = $("#hidden-line_width_graph").val() || 1; var lineWidth = $("#hidden-line_width_graph").val() || 1;
i = 0; var i = 0;
var fill_color = "green";
var line_show = true;
var points_show = false;
var filled = false;
var steps_chart = false;
var radius = false;
var fill_points = fill_color;
$.each(values, function(index, value) { $.each(values, function(index, value) {
if (typeof value.data !== "undefined") { if (typeof value.data !== "undefined") {
if (index.search("alert") >= 0) { if (index.search("alert") >= 0) {
@ -1974,7 +1981,7 @@ function pandoraFlotArea(
switch (series_type[index]) { switch (series_type[index]) {
case "area": case "area":
line_show = true; line_show = true;
points_show = false; // XXX - false points_show = false;
filled = filled_s; filled = filled_s;
steps_chart = false; steps_chart = false;
radius = false; radius = false;
@ -1995,7 +2002,7 @@ function pandoraFlotArea(
points_show = true; points_show = true;
filled = false; filled = false;
steps_chart = false; steps_chart = false;
radius = 1.5; radius = 3;
fill_points = fill_color; fill_points = fill_color;
break; break;
case "unknown": case "unknown":
@ -2033,7 +2040,7 @@ function pandoraFlotArea(
}, },
points: { points: {
show: points_show, show: points_show,
radius: 3, radius: radius,
fillColor: fill_points fillColor: fill_points
}, },
legend: legend.index legend: legend.index
@ -2051,7 +2058,8 @@ function pandoraFlotArea(
number_ticks = 5; number_ticks = 5;
} }
var maxticks = date_array["period"] / 3600 / number_ticks; // masticks this variable is commented because the library defines the tick number by itself
// var maxticks = date_array["period"] / 3600 / number_ticks;
var options = { var options = {
series: { series: {
@ -2125,16 +2133,11 @@ function pandoraFlotArea(
options.selection = false; options.selection = false;
} }
var stack = 0,
bars = true,
lines = false,
steps = false;
var plot = $.plot($("#" + graph_id), datas, options); var plot = $.plot($("#" + graph_id), datas, options);
// Re-calculate the graph height with the legend height // Re-calculate the graph height with the legend height
if (dashboard) { if (dashboard) {
$acum = 0; var $acum = 0;
if (dashboard) $acum = 35; if (dashboard) $acum = 35;
var hDiff = var hDiff =
$("#" + graph_id).height() - $("#legend_" + graph_id).height() - $acum; $("#" + graph_id).height() - $("#legend_" + graph_id).height() - $acum;
@ -2143,22 +2146,12 @@ function pandoraFlotArea(
navigator.userAgent navigator.userAgent
) )
) { ) {
// not defined.???
} else { } else {
$("#" + graph_id).css("height", hDiff); $("#" + graph_id).css("height", hDiff);
} }
} }
/*
//XXXREvisar esto
if (vconsole) {
var myCanvas = plot.getCanvas();
plot.setupGrid(); // redraw plot to new size
plot.draw();
var image = myCanvas.toDataURL("image/png");
return;
}
*/
// Adjust the overview plot to the width and position of the main plot // Adjust the overview plot to the width and position of the main plot
adjust_left_width_canvas(graph_id, "overview_" + graph_id); adjust_left_width_canvas(graph_id, "overview_" + graph_id);
update_left_width_canvas(graph_id); update_left_width_canvas(graph_id);
@ -2251,7 +2244,7 @@ function pandoraFlotArea(
return; return;
} }
dataInSelection = ranges.xaxis.to - ranges.xaxis.from; var dataInSelection = ranges.xaxis.to - ranges.xaxis.from;
var maxticks_zoom = dataInSelection / 3600000 / number_ticks; var maxticks_zoom = dataInSelection / 3600000 / number_ticks;
if (maxticks_zoom < 0.001) { if (maxticks_zoom < 0.001) {
@ -2261,8 +2254,9 @@ function pandoraFlotArea(
} }
} }
var y_recal = "";
if (thresholded) { if (thresholded) {
var y_recal = axis_thresholded( y_recal = axis_thresholded(
threshold_data, threshold_data,
plot.getAxes().yaxis.min, plot.getAxes().yaxis.min,
plot.getAxes().yaxis.max, plot.getAxes().yaxis.max,
@ -2271,11 +2265,11 @@ function pandoraFlotArea(
red_up red_up
); );
} else { } else {
var y_recal = ranges.yaxis; y_recal = ranges.yaxis;
} }
if (thresholded) { if (thresholded) {
data_base_treshold = add_threshold( var data_base_treshold = add_threshold(
data_base, data_base,
threshold_data, threshold_data,
ranges.yaxis.from, ranges.yaxis.from,
@ -2400,7 +2394,6 @@ function pandoraFlotArea(
var updateLegendTimeout = null; var updateLegendTimeout = null;
var latestPosition = null; var latestPosition = null;
var currentPlot = null; var currentPlot = null;
var currentRanges = null;
// Update legend with the data of the plot in the mouse position // Update legend with the data of the plot in the mouse position
function updateLegend() { function updateLegend() {
@ -2434,7 +2427,7 @@ function pandoraFlotArea(
"Dec" "Dec"
]; ];
date_format = var date_format =
(d.getDate() < 10 ? "0" : "") + (d.getDate() < 10 ? "0" : "") +
d.getDate() + d.getDate() +
" " + " " +
@ -2455,7 +2448,7 @@ function pandoraFlotArea(
var timesize = $("#timestamp_" + graph_id).width(); var timesize = $("#timestamp_" + graph_id).width();
dataset = currentPlot.getData(); var dataset = currentPlot.getData();
var timenewpos = var timenewpos =
dataset[0].xaxis.p2c(pos.x) + dataset[0].xaxis.p2c(pos.x) +
@ -2481,9 +2474,8 @@ function pandoraFlotArea(
$("#timestamp_" + graph_id).css("left", timenewpos); $("#timestamp_" + graph_id).css("left", timenewpos);
} }
var dataset = currentPlot.getData();
var i = 0; var i = 0;
for (k = 0; k < dataset.length; k++) { for (var k = 0; k < dataset.length; k++) {
// k is the real series counter // k is the real series counter
// i is the series counter without thresholds // i is the series counter without thresholds
var series = dataset[k]; var series = dataset[k];
@ -2492,7 +2484,7 @@ function pandoraFlotArea(
} }
// find the nearest points, x-wise // find the nearest points, x-wise
for (j = 0; j < series.data.length; ++j) { for (var j = 0; j < series.data.length; ++j) {
if (series.data[j][0] > pos.x) { if (series.data[j][0] > pos.x) {
break; break;
} }
@ -2503,10 +2495,10 @@ function pandoraFlotArea(
} }
} }
y_array = format_unit_yaxes(y); var y_array = format_unit_yaxes(y);
y = y_array["y"]; y = y_array["y"];
how_bigger = y_array["unit"]; var how_bigger = y_array["unit"];
var data_legend = []; var data_legend = [];
@ -2516,8 +2508,9 @@ function pandoraFlotArea(
series_type[dataset[k]["label"]] != "unknown" && series_type[dataset[k]["label"]] != "unknown" &&
series_type[dataset[k]["label"]] != "percentil" series_type[dataset[k]["label"]] != "percentil"
) { ) {
var label_aux = "";
if (Object.keys(update_legend).length == 0) { if (Object.keys(update_legend).length == 0) {
var label_aux = legend[series.label]; label_aux = legend[series.label];
$("#legend_" + graph_id + " .legendLabel") $("#legend_" + graph_id + " .legendLabel")
.eq(i) .eq(i)
@ -2532,6 +2525,16 @@ function pandoraFlotArea(
unit unit
); );
} else { } 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) { $.each(update_legend, function(index, value) {
if (!value[x]) { if (!value[x]) {
x = x + 1; x = x + 1;
@ -2581,7 +2584,7 @@ function pandoraFlotArea(
avg_bigger; avg_bigger;
}); });
var label_aux = label_aux =
legend[series.label].split(":")[0] + data_legend[series.label]; legend[series.label].split(":")[0] + data_legend[series.label];
$("#legend_" + graph_id + " .legendLabel") $("#legend_" + graph_id + " .legendLabel")
.eq(i) .eq(i)
@ -2604,7 +2607,7 @@ function pandoraFlotArea(
} }
// Events // Events
$("#overview_" + graph_id).bind("plothover", function(event, pos, item) { $("#overview_" + graph_id).bind("plothover", function(event, pos) {
plot.setCrosshair({ x: pos.x, y: pos.y }); plot.setCrosshair({ x: pos.x, y: pos.y });
currentPlot = plot; currentPlot = plot;
latestPosition = pos; latestPosition = pos;
@ -2613,7 +2616,7 @@ function pandoraFlotArea(
} }
}); });
$("#" + graph_id).bind("plothover", function(event, pos, item) { $("#" + graph_id).bind("plothover", function(event, pos) {
overview.setCrosshair({ x: pos.x, y: pos.y }); overview.setCrosshair({ x: pos.x, y: pos.y });
currentPlot = plot; currentPlot = plot;
latestPosition = pos; latestPosition = pos;
@ -2636,7 +2639,6 @@ function pandoraFlotArea(
$("#extra_" + graph_id).css("width", "170px"); $("#extra_" + graph_id).css("width", "170px");
$("#extra_" + graph_id).css("height", "60px"); $("#extra_" + graph_id).css("height", "60px");
var dataset = plot.getData();
var extra_info = "<i>No info to show</i>"; var extra_info = "<i>No info to show</i>";
var extra_show = false; var extra_show = false;
var extra_height = $("#extra_" + graph_id).height(); var extra_height = $("#extra_" + graph_id).height();
@ -2657,8 +2659,6 @@ function pandoraFlotArea(
coord_x = coord_x - extra_width; coord_x = coord_x - extra_width;
} }
var coord_y = offset_graph.top + height_legend + extra_height;
$("#extra_" + graph_id).css("left", coord_x); $("#extra_" + graph_id).css("left", coord_x);
$("#extra_" + graph_id).css("top", coord_y); $("#extra_" + graph_id).css("top", coord_y);
@ -2677,21 +2677,22 @@ function pandoraFlotArea(
}); });
}); });
var extra_color = "#ffffff";
if (events_data.event_type.search("alert") >= 0) { if (events_data.event_type.search("alert") >= 0) {
$extra_color = "#FFA631"; extra_color = "#FFA631";
} else if (events_data.event_type.search("critical") >= 0) { } else if (events_data.event_type.search("critical") >= 0) {
$extra_color = "#FC4444"; extra_color = "#FC4444";
} else if (events_data.event_type.search("warning") >= 0) { } else if (events_data.event_type.search("warning") >= 0) {
$extra_color = "#FAD403"; extra_color = "#FAD403";
} else if (events_data.event_type.search("unknown") >= 0) { } else if (events_data.event_type.search("unknown") >= 0) {
$extra_color = "#3BA0FF"; extra_color = "#3BA0FF";
} else if (events_data.event_type.search("normal") >= 0) { } else if (events_data.event_type.search("normal") >= 0) {
$extra_color = "#80BA27"; extra_color = "#80BA27";
} else { } else {
$extra_color = "#ffffff"; extra_color = "#ffffff";
} }
$("#extra_" + graph_id).css("background-color", $extra_color); $("#extra_" + graph_id).css("background-color", extra_color);
extra_info = "<b>" + events_data.evento + ":"; extra_info = "<b>" + events_data.evento + ":";
extra_info += extra_info +=
@ -2717,9 +2718,10 @@ function pandoraFlotArea(
} }
if (image_treshold) { if (image_treshold) {
var y_recal = plot.getAxes().yaxis.max;
if (!thresholded) { if (!thresholded) {
// Recalculate the y axis // Recalculate the y axis
var y_recal = axis_thresholded( y_recal = axis_thresholded(
threshold_data, threshold_data,
plot.getAxes().yaxis.min, plot.getAxes().yaxis.min,
plot.getAxes().yaxis.max, plot.getAxes().yaxis.max,
@ -2727,11 +2729,9 @@ function pandoraFlotArea(
extremes, extremes,
red_up red_up
); );
} else {
var y_recal = plot.getAxes().yaxis.max;
} }
datas_treshold = add_threshold( var datas_treshold = add_threshold(
data_base, data_base,
threshold_data, threshold_data,
plot.getAxes().yaxis.min, plot.getAxes().yaxis.min,
@ -2762,7 +2762,7 @@ function pandoraFlotArea(
// Reset interactivity styles // Reset interactivity styles
function resetInteractivity() { function resetInteractivity() {
$("#timestamp_" + graph_id).hide(); $("#timestamp_" + graph_id).hide();
dataset = plot.getData(); var dataset = plot.getData();
for (i = 0; i < dataset.length; ++i) { for (i = 0; i < dataset.length; ++i) {
var series = dataset[i]; var series = dataset[i];
var label_aux = legend[series.label]; var label_aux = legend[series.label];
@ -2784,15 +2784,14 @@ function pandoraFlotArea(
overview.clearCrosshair(); overview.clearCrosshair();
} }
function yFormatter(v, axis) { function yFormatter(v) {
var formatted = v;
if (short_data) { if (short_data) {
var formatted = number_format(v, force_integer, "", short_data); formatted = number_format(v, force_integer, "", short_data);
} else { } else {
// It is an integer // It is an integer
if (v - Math.floor(v) == 0) { if (v - Math.floor(v) == 0) {
var formatted = number_format(v, force_integer, "", 2); formatted = number_format(v, force_integer, "", 2);
} else {
var formatted = v;
} }
} }
@ -2801,7 +2800,7 @@ function pandoraFlotArea(
return formatted; return formatted;
} }
function lFormatter(v, item) { function lFormatter(v) {
return '<span style="color:' + legend_color + '">' + legend[v] + "</span>"; return '<span style="color:' + legend_color + '">' + legend[v] + "</span>";
} }
@ -2858,9 +2857,10 @@ function pandoraFlotArea(
); );
thresholded = false; thresholded = false;
} else { } else {
var y_recal = plot.getAxes().yaxis.max;
if (!thresholded) { if (!thresholded) {
// Recalculate the y axis // Recalculate the y axis
var y_recal = axis_thresholded( y_recal = axis_thresholded(
threshold_data, threshold_data,
plot.getAxes().yaxis.min, plot.getAxes().yaxis.min,
plot.getAxes().yaxis.max, plot.getAxes().yaxis.max,
@ -2868,8 +2868,6 @@ function pandoraFlotArea(
extremes, extremes,
red_up red_up
); );
} else {
var y_recal = plot.getAxes().yaxis.max;
} }
datas_treshold = add_threshold( datas_treshold = add_threshold(
@ -2917,7 +2915,6 @@ function pandoraFlotArea(
homeurl + "images/zoom_cross.disabled.png" homeurl + "images/zoom_cross.disabled.png"
); );
overview.clearSelection(); overview.clearSelection();
currentRanges = null;
thresholded = false; thresholded = false;
max_draw = []; max_draw = [];
}); });
@ -2932,7 +2929,6 @@ function pandoraFlotArea(
// Add bottom margin in the legend // Add bottom margin in the legend
// Estimated height of 24 (works fine with this data in all browsers) // Estimated height of 24 (works fine with this data in all browsers)
menu_height = 24;
$("#legend_" + graph_id).css("margin-bottom", "10px"); $("#legend_" + graph_id).css("margin-bottom", "10px");
parent_height = parseInt( parent_height = parseInt(
$("#menu_" + graph_id) $("#menu_" + graph_id)
@ -2979,6 +2975,7 @@ function format_unit_yaxes(y) {
} }
function adjust_menu(graph_id, plot, parent_height, width, show_legend) { function adjust_menu(graph_id, plot, parent_height, width, show_legend) {
var left_ticks_width = 0;
if ( if (
$("#" + graph_id + " .xAxis .tickLabel") $("#" + graph_id + " .xAxis .tickLabel")
.eq(0) .eq(0)
@ -2988,14 +2985,11 @@ function adjust_menu(graph_id, plot, parent_height, width, show_legend) {
.eq(0) .eq(0)
.css("width") .css("width")
.split("px")[0]; .split("px")[0];
} else {
left_ticks_width = 0;
} }
var parent_height_new = 0; var legend_height = 0;
if (show_legend) { if (show_legend) {
var legend_height = legend_height =
parseInt( parseInt(
$("#legend_" + graph_id) $("#legend_" + graph_id)
.css("height") .css("height")
@ -3006,12 +3000,9 @@ function adjust_menu(graph_id, plot, parent_height, width, show_legend) {
.css("margin-top") .css("margin-top")
.split("px")[0] .split("px")[0]
); );
} else {
var legend_height = 0;
} }
var menu_height = "25"; var menu_height = "25";
if ( if (
$("#menu_" + graph_id).height() != undefined && $("#menu_" + graph_id).height() != undefined &&
$("#menu_" + graph_id).height() > 20 $("#menu_" + graph_id).height() > 20
@ -3019,7 +3010,7 @@ function adjust_menu(graph_id, plot, parent_height, width, show_legend) {
menu_height = $("#menu_" + graph_id).height(); menu_height = $("#menu_" + graph_id).height();
} }
offset = $("#" + graph_id)[0].offsetTop; var offset = $("#" + graph_id)[0].offsetTop;
$("#menu_" + graph_id).css("top", offset + "px"); $("#menu_" + graph_id).css("top", offset + "px");

View File

@ -82,9 +82,22 @@ function include_javascript_dependencies_flot_graph($return=false)
} }
// /**
// AREA GRAPHS //////// * Function create container for print charts.
// *
* @param integer $agent_module_id Id module.
* @param array $array_data Data.
* @param array $legend Legend.
* @param array $series_type Series.
* @param array $color Color.
* @param array $date_array Date.
* @param array $data_module_graph Data module.
* @param array $params Params.
* @param string $water_mark Water.
* @param array $array_events_alerts Events array.
*
* @return string Return graphs.
*/
function flot_area_graph( function flot_area_graph(
$agent_module_id, $agent_module_id,
$array_data, $array_data,
@ -99,8 +112,7 @@ function flot_area_graph(
) { ) {
global $config; global $config;
// include_javascript_dependencies_flot_graph(); // Get a unique identifier to graph.
// Get a unique identifier to graph
$graph_id = uniqid('graph_'); $graph_id = uniqid('graph_');
$background_style = ''; $background_style = '';
@ -126,19 +138,26 @@ function flot_area_graph(
break; break;
} }
$padding_vconsole = $params['dashboard'] ? 'padding: 1px 0px 10px 10px;' : ''; $padding_vconsole = ($params['dashboard']) ? 'padding: 1px 0px 10px 10px;' : '';
// Parent layer // Parent layer.
$return = "<div class='parent_graph' style='width: ".($params['width']).';'.$background_style.$padding_vconsole."'>"; $return = "<div class='parent_graph' style='width: ".($params['width']).';'.$background_style.$padding_vconsole."'>";
if (empty($params['title']) === false) {
$return .= '<p style="text-align:center;">'.$params['title'].'</p>';
}
// Set some containers to legend, graph, timestamp tooltip, etc. // Set some containers to legend, graph, timestamp tooltip, etc.
if ($params['show_legend']) { if ($params['show_legend']) {
$return .= "<p id='legend_$graph_id' style='text-align:left;'></p>"; $return .= '<p id="legend_'.$graph_id.'" style="text-align:left;"></p>';
} }
if (isset($params['graph_combined']) && $params['graph_combined'] if (isset($params['graph_combined']) && $params['graph_combined']
&& (!isset($params['from_interface']) || !$params['from_interface']) && (!isset($params['from_interface']) || !$params['from_interface'])
) { ) {
if (isset($params['threshold_data']) && is_array($params['threshold_data'])) { if (isset($params['threshold_data'])
&& is_array($params['threshold_data'])
) {
$yellow_threshold = $params['threshold_data']['yellow_threshold']; $yellow_threshold = $params['threshold_data']['yellow_threshold'];
$red_threshold = $params['threshold_data']['red_threshold']; $red_threshold = $params['threshold_data']['red_threshold'];
$yellow_up = $params['threshold_data']['yellow_up']; $yellow_up = $params['threshold_data']['yellow_up'];
@ -154,7 +173,7 @@ function flot_area_graph(
} else if (!isset($params['combined']) || !$params['combined']) { } else if (!isset($params['combined']) || !$params['combined']) {
$yellow_threshold = $data_module_graph['w_min']; $yellow_threshold = $data_module_graph['w_min'];
$red_threshold = $data_module_graph['c_min']; $red_threshold = $data_module_graph['c_min'];
// Get other required module datas to draw warning and critical // Get other required module datas to draw warning and critical.
if ($agent_module_id == 0) { if ($agent_module_id == 0) {
$yellow_up = 0; $yellow_up = 0;
$red_up = 0; $red_up = 0;
@ -166,8 +185,12 @@ function flot_area_graph(
$yellow_inverse = !($data_module_graph['w_inv'] == 0); $yellow_inverse = !($data_module_graph['w_inv'] == 0);
$red_inverse = !($data_module_graph['c_inv'] == 0); $red_inverse = !($data_module_graph['c_inv'] == 0);
} }
} else if (isset($params['from_interface']) && $params['from_interface']) { } else if (isset($params['from_interface'])
if (isset($params['threshold_data']) && is_array($params['threshold_data'])) { && $params['from_interface']
) {
if (isset($params['threshold_data'])
&& is_array($params['threshold_data'])
) {
$yellow_threshold = $params['threshold_data']['yellow_threshold']; $yellow_threshold = $params['threshold_data']['yellow_threshold'];
$red_threshold = $params['threshold_data']['red_threshold']; $red_threshold = $params['threshold_data']['red_threshold'];
$yellow_up = $params['threshold_data']['yellow_up']; $yellow_up = $params['threshold_data']['yellow_up'];
@ -200,7 +223,11 @@ function flot_area_graph(
); );
} }
$return .= html_print_input_hidden('line_width_graph', $config['custom_graph_width'], true); $return .= html_print_input_hidden(
'line_width_graph',
$config['custom_graph_width'],
true
);
$return .= "<div id='timestamp_$graph_id' $return .= "<div id='timestamp_$graph_id'
class='timestamp_graph' class='timestamp_graph'
style=' font-size:".$params['font_size']."pt; style=' font-size:".$params['font_size']."pt;
@ -239,20 +266,21 @@ function flot_area_graph(
$series_type_unique['data_'.$graph_id.'_'.$k] = $v; $series_type_unique['data_'.$graph_id.'_'.$k] = $v;
} }
// Store data series in javascript format // Store data series in javascript format.
$extra_width = (int) ($params['width'] / 3); $extra_width = (int) ($params['width'] / 3);
$return .= "<div id='extra_$graph_id' $return .= "<div id='extra_$graph_id'
style='font-size: ".$params['font_size'].'pt; style='font-size: ".$params['font_size'].'pt;
display:none; position:absolute; overflow: auto; display:none; position:absolute; overflow: auto;
max-height: '.($params['height'] + 50).'px; max-height: '.($params['height'] + 50).'px;
width: '.$extra_width."px; width: '.$extra_width."px;
background:#fff; padding: 2px 2px 2px 2px; background:#fff; padding: 2px 2px 2px 2px;
border: solid #000 1px;'></div>"; border: solid #000 1px;'></div>";
// Trick to get translated string from javascript // Trick to get translated string from javascript.
$return .= html_print_input_hidden('unknown_text', __('Unknown'), true); $return .= html_print_input_hidden('unknown_text', __('Unknown'), true);
$values = json_encode($array_data); $values = json_encode($array_data);
$legend = json_encode($legend); $legend = json_encode($legend);
$series_type = json_encode($series_type); $series_type = json_encode($series_type);
$color = json_encode($color); $color = json_encode($color);
@ -261,7 +289,7 @@ function flot_area_graph(
$params = json_encode($params); $params = json_encode($params);
$array_events_alerts = json_encode($array_events_alerts); $array_events_alerts = json_encode($array_events_alerts);
// Javascript code // Javascript code.
if ($font_size == '') { if ($font_size == '') {
$font_size = '\'\''; $font_size = '\'\'';
} }
@ -272,7 +300,7 @@ function flot_area_graph(
$return .= '});'; $return .= '});';
$return .= '</script>'; $return .= '</script>';
// Parent layer // Parent layer.
$return .= '</div>'; $return .= '</div>';
return $return; return $return;

View File

@ -129,7 +129,7 @@
<div style='height: 10px'> <div style='height: 10px'>
<?php <?php
$version = '7.0NG.735'; $version = '7.0NG.735';
$build = '190523'; $build = '190527';
$banner = "v$version Build $build"; $banner = "v$version Build $build";
error_reporting(0); error_reporting(0);

View File

@ -80,12 +80,34 @@ if (isset($_GET['modified']) && !$view_mode) {
$upd_info['id_skin'] = get_parameter('skin', $user_info['id_skin']); $upd_info['id_skin'] = get_parameter('skin', $user_info['id_skin']);
$upd_info['default_event_filter'] = get_parameter('event_filter', null); $upd_info['default_event_filter'] = get_parameter('event_filter', null);
$upd_info['block_size'] = get_parameter('block_size', $config['block_size']); $upd_info['block_size'] = get_parameter('block_size', $config['block_size']);
$upd_info['firstname'] = get_parameter('newsletter_reminder', $user_info['first_name']); $upd_info['middlename'] = get_parameter_switch('newsletter_reminder', $user_info['middlename']);
$default_block_size = get_parameter('default_block_size', 0); $default_block_size = get_parameter('default_block_size', 0);
if ($default_block_size) { if ($default_block_size) {
$upd_info['block_size'] = 0; $upd_info['block_size'] = 0;
} }
if ($upd_info['middlename'] == 1) {
// User wants to enable newsletter reminders.
if ($user_info['middlename'] > 0) {
// User has already registered!. No sense.
$upd_info['middlename'] = $user_info['middlename'];
} else {
// Force subscription reminder.
$upd_info['middlename'] = 0;
}
}
if ($upd_info['middlename'] == 0 || $upd_info['middlename'] == 0) {
// Switch is ON. user had not registered.
$newsletter_reminder_value = 1;
} else if ($upd_info['middlename'] < 1) {
// Switch is OFF. User do not want to register.
$newsletter_reminder_value = 0;
} else if ($upd_info['middlename'] > 0) {
// Switc is OFF. User is already registered!
$newsletter_reminder_value = 0;
}
$upd_info['section'] = get_parameter('section', $user_info['section']); $upd_info['section'] = get_parameter('section', $user_info['section']);
$upd_info['data_section'] = get_parameter('data_section', ''); $upd_info['data_section'] = get_parameter('data_section', '');
$dashboard = get_parameter('dashboard', ''); $dashboard = get_parameter('dashboard', '');
@ -396,23 +418,28 @@ if (check_acl($config['id_user'], 0, 'ER')) {
null, null,
true true
).'</div>'; ).'</div>';
} else if (license_free()) {
$newsletter = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Newsletter Subscribed').': </p>';
if ($user_info['middlename']) {
$newsletter .= '<span>'.__('Already subscribed to %s newsletter', get_product_name()).'</span></div>';
} else {
$newsletter .= '<span><a href="javascript: force_run_newsletter();">'.__('Subscribe to our newsletter').'</a></span></div>';
}
$newsletter_reminder = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Newsletter Reminder').': </p>';
if ($user_info['firstname'] != 0) {
$user_info['firstname'] = 1;
}
$newsletter_reminder .= html_print_checkbox_switch('newsletter_reminder', 1, $user_info['firstname'], true).'</div>';
} }
$newsletter = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Newsletter Subscribed').': </p>';
if ($user_info['middlename'] > 0) {
$newsletter .= '<span>'.__('Already subscribed to %s newsletter', get_product_name()).'</span>';
} else {
$newsletter .= '<span><a href="javascript: force_run_newsletter();">'.__('Subscribe to our newsletter').'</a></span></div>';
$newsletter_reminder = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Newsletter Reminder').': </p>';
$newsletter_reminder .= html_print_switch(
[
'name' => 'newsletter_reminder',
'value' => $newsletter_reminder_value,
'disabled' => false,
]
);
}
$newsletter_reminder .= '</div>';
$autorefresh_list_out = []; $autorefresh_list_out = [];
if (is_metaconsole()) { if (is_metaconsole()) {
$autorefresh_list_out['monitoring/tactical'] = 'Tactical view'; $autorefresh_list_out['monitoring/tactical'] = 'Tactical view';

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.735 %define version 7.0NG.735
%define release 190523 %define release 190527
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name httpd %define httpd_name httpd

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.735 %define version 7.0NG.735
%define release 190523 %define release 190527
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name httpd %define httpd_name httpd

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.735 %define version 7.0NG.735
%define release 190523 %define release 190527
%define httpd_name httpd %define httpd_name httpd
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name apache2 %define httpd_name apache2

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 7.0NG.735-190523 Version: 7.0NG.735-190527
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="7.0NG.735-190523" pandora_version="7.0NG.735-190527"
package_cpan=0 package_cpan=0
package_pandora=1 package_pandora=1

View File

@ -45,7 +45,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only # version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.735"; my $pandora_version = "7.0NG.735";
my $pandora_build = "190523"; my $pandora_build = "190527";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash # Setup hash
@ -1133,6 +1133,18 @@ sub pandora_load_config {
elsif ($parametro =~ m/^fsnmp\s(.*)/i) { elsif ($parametro =~ m/^fsnmp\s(.*)/i) {
$pa_config->{'fsnmp'}= clean_blank($1); $pa_config->{'fsnmp'}= clean_blank($1);
} }
# Pandora HA extra
elsif ($parametro =~ m/^ha_file\s(.*)/i) {
$pa_config->{'ha_file'} = clean_blank($1);
}
elsif ($parametro =~ m/^ha_pid_file\s(.*)/i) {
$pa_config->{'ha_pid_file'} = clean_blank($1);
}
elsif ($parametro =~ m/^pandora_service_cmd\s(.*)/i) {
$pa_config->{'pandora_service_cmd'} = clean_blank($1);
}
} # end of loop for parameter # } # end of loop for parameter #
# Set to RDBMS' standard port # Set to RDBMS' standard port

View File

@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only # version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.735"; my $pandora_version = "7.0NG.735";
my $pandora_build = "190523"; my $pandora_build = "190527";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] ); our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_server %define name pandorafms_server
%define version 7.0NG.735 %define version 7.0NG.735
%define release 190523 %define release 190527
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_server %define name pandorafms_server
%define version 7.0NG.735 %define version 7.0NG.735
%define release 190523 %define release 190527
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -9,7 +9,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.735" PI_VERSION="7.0NG.735"
PI_BUILD="190523" PI_BUILD="190527"
MODE=$1 MODE=$1
if [ $# -gt 1 ]; then if [ $# -gt 1 ]; then

View File

@ -34,7 +34,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB; use PandoraFMS::DB;
# version: define current version # version: define current version
my $version = "7.0NG.735 PS190523"; my $version = "7.0NG.735 PS190527";
# Pandora server configuration # Pandora server configuration
my %conf; my %conf;

View File

@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv; Encode::Locale::decode_argv;
# version: define current version # version: define current version
my $version = "7.0NG.735 PS190523"; my $version = "7.0NG.735 PS190527";
# save program name for logging # save program name for logging
my $progname = basename($0); my $progname = basename($0);