Add label with macros in reports. Ticket: #37
(cherry picked from commit a804040d79
)
This commit is contained in:
parent
ab72824247
commit
bdba5c4c05
|
@ -51,6 +51,7 @@ $idAgent = null;
|
||||||
$idAgentModule = null;
|
$idAgentModule = null;
|
||||||
$idCustomGraph = null;
|
$idCustomGraph = null;
|
||||||
$text = null;
|
$text = null;
|
||||||
|
$label = null;
|
||||||
$header = null;
|
$header = null;
|
||||||
$idCustom = null;
|
$idCustom = null;
|
||||||
$url = null;
|
$url = null;
|
||||||
|
@ -553,7 +554,33 @@ switch ($action) {
|
||||||
$max_values = $item ['top_n_value']; // Max values
|
$max_values = $item ['top_n_value']; // Max values
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
switch ($type) {
|
||||||
|
case 'event_report_agent':
|
||||||
|
case 'simple_graph':
|
||||||
|
case 'agent_configuration':
|
||||||
|
case 'event_report_module':
|
||||||
|
case 'alert_report_agent':
|
||||||
|
case 'alert_report_module':
|
||||||
|
case 'historical_data':
|
||||||
|
case 'sumatory':
|
||||||
|
case 'database_serialized':
|
||||||
|
case 'monitor_report':
|
||||||
|
case 'min_value':
|
||||||
|
case 'max_value':
|
||||||
|
case 'avg_value':
|
||||||
|
case 'projection_graph':
|
||||||
|
case 'prediction_date':
|
||||||
|
case 'TTRT':
|
||||||
|
case 'TTO':
|
||||||
|
case 'MTBF':
|
||||||
|
case 'MTTR':
|
||||||
|
case 'simple_baseline_graph':
|
||||||
|
$label = (isset($style['label'])) ? $style['label'] : '';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$label = '';
|
||||||
|
break;
|
||||||
|
}
|
||||||
//Restore db connection
|
//Restore db connection
|
||||||
if ($meta && $server_name != '') {
|
if ($meta && $server_name != '') {
|
||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
|
@ -640,7 +667,6 @@ $class = 'databox filters';
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr id="row_description" style="" class="datos">
|
<tr id="row_description" style="" class="datos">
|
||||||
<td style="font-weight:bold;"><?php echo __('Description'); ?></td>
|
<td style="font-weight:bold;"><?php echo __('Description'); ?></td>
|
||||||
<td style="">
|
<td style="">
|
||||||
|
@ -650,6 +676,16 @@ $class = 'databox filters';
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr id="row_label" style="" class="datos">
|
||||||
|
<td style="font-weight:bold;"><?php echo __('Label') .
|
||||||
|
ui_print_help_icon ('reports_label_field',true); ?></td>
|
||||||
|
<td style="">
|
||||||
|
<?php
|
||||||
|
echo html_print_input_text ('label', $label, '', 50, 255, true);
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr id="row_period" style="" class="datos">
|
<tr id="row_period" style="" class="datos">
|
||||||
<td style="font-weight:bold;">
|
<td style="font-weight:bold;">
|
||||||
<?php
|
<?php
|
||||||
|
@ -2193,6 +2229,7 @@ function chooseType() {
|
||||||
type = $("#type").val();
|
type = $("#type").val();
|
||||||
|
|
||||||
$("#row_description").hide();
|
$("#row_description").hide();
|
||||||
|
$("#row_label").hide();
|
||||||
$("#row_period").hide();
|
$("#row_period").hide();
|
||||||
$("#row_agent").hide();
|
$("#row_agent").hide();
|
||||||
$("#row_module").hide();
|
$("#row_module").hide();
|
||||||
|
@ -2740,7 +2777,32 @@ function chooseType() {
|
||||||
$("#row_resolution").show();
|
$("#row_resolution").show();
|
||||||
$("#row_servers").show();
|
$("#row_servers").show();
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
switch (type) {
|
||||||
|
case 'event_report_agent':
|
||||||
|
case 'simple_graph':
|
||||||
|
case 'agent_configuration':
|
||||||
|
case 'event_report_module':
|
||||||
|
case 'alert_report_agent':
|
||||||
|
case 'alert_report_module':
|
||||||
|
case 'historical_data':
|
||||||
|
case 'sumatory':
|
||||||
|
case 'database_serialized':
|
||||||
|
case 'monitor_report':
|
||||||
|
case 'min_value':
|
||||||
|
case 'max_value':
|
||||||
|
case 'avg_value':
|
||||||
|
case 'projection_graph':
|
||||||
|
case 'prediction_date':
|
||||||
|
case 'TTRT':
|
||||||
|
case 'TTO':
|
||||||
|
case 'MTBF':
|
||||||
|
case 'MTTR':
|
||||||
|
case 'simple_baseline_graph':
|
||||||
|
$("#row_label").show();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -903,6 +903,7 @@ switch ($action) {
|
||||||
$values['name'] = (string) get_parameter('name');
|
$values['name'] = (string) get_parameter('name');
|
||||||
$values['description'] = get_parameter('description');
|
$values['description'] = get_parameter('description');
|
||||||
$values['type'] = get_parameter('type', null);
|
$values['type'] = get_parameter('type', null);
|
||||||
|
$label = get_parameter('label', '');
|
||||||
// Added support for projection graphs, prediction date and SLA reports
|
// Added support for projection graphs, prediction date and SLA reports
|
||||||
// 'top_n_value','top_n' and 'text' fields will be reused for these types of report
|
// 'top_n_value','top_n' and 'text' fields will be reused for these types of report
|
||||||
switch ($values['type']) {
|
switch ($values['type']) {
|
||||||
|
@ -1127,12 +1128,45 @@ switch ($action) {
|
||||||
$style['event_filter_search'] =
|
$style['event_filter_search'] =
|
||||||
$event_filter_search;
|
$event_filter_search;
|
||||||
break;
|
break;
|
||||||
|
case 'event_report_agent':
|
||||||
|
if ($label != '')
|
||||||
|
$style['label'] = $label;
|
||||||
|
else
|
||||||
|
$style['label'] = '';
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'simple_graph':
|
case 'simple_graph':
|
||||||
// Warning. We are using this column to hold this value to avoid
|
// Warning. We are using this column to hold this value to avoid
|
||||||
// the modification of the database for compatibility reasons.
|
// the modification of the database for compatibility reasons.
|
||||||
$style['only_avg'] = (int) get_parameter('only_avg');
|
$style['only_avg'] = (int) get_parameter('only_avg');
|
||||||
|
if ($label != '')
|
||||||
|
$style['label'] = $label;
|
||||||
|
else
|
||||||
|
$style['label'] = '';
|
||||||
|
break;
|
||||||
|
case 'agent_configuration':
|
||||||
|
case 'event_report_module':
|
||||||
|
case 'alert_report_agent':
|
||||||
|
case 'alert_report_module':
|
||||||
|
case 'historical_data':
|
||||||
|
case 'sumatory':
|
||||||
|
case 'database_serialized':
|
||||||
|
case 'monitor_report':
|
||||||
|
case 'min_value':
|
||||||
|
case 'max_value':
|
||||||
|
case 'avg_value':
|
||||||
|
case 'projection_graph':
|
||||||
|
case 'prediction_date':
|
||||||
|
case 'TTRT':
|
||||||
|
case 'TTO':
|
||||||
|
case 'MTBF':
|
||||||
|
case 'MTTR':
|
||||||
|
case 'simple_baseline_graph':
|
||||||
|
if ($label != '')
|
||||||
|
$style['label'] = $label;
|
||||||
|
else
|
||||||
|
$style['label'] = '';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1166,6 +1200,7 @@ switch ($action) {
|
||||||
$values['type'] = get_parameter('type', null);
|
$values['type'] = get_parameter('type', null);
|
||||||
$values['name'] = (string) get_parameter('name');
|
$values['name'] = (string) get_parameter('name');
|
||||||
$values['description'] = get_parameter('description');
|
$values['description'] = get_parameter('description');
|
||||||
|
$label = get_parameter('label', '');
|
||||||
|
|
||||||
// Support for projection graph, prediction date and SLA reports
|
// Support for projection graph, prediction date and SLA reports
|
||||||
// 'top_n_value', 'top_n' and 'text' fields will be reused for these types of report
|
// 'top_n_value', 'top_n' and 'text' fields will be reused for these types of report
|
||||||
|
@ -1401,6 +1436,12 @@ switch ($action) {
|
||||||
$style['event_filter_search'] =
|
$style['event_filter_search'] =
|
||||||
$event_filter_search;
|
$event_filter_search;
|
||||||
break;
|
break;
|
||||||
|
case 'event_report_agent':
|
||||||
|
if ($label != '')
|
||||||
|
$style['label'] = $label;
|
||||||
|
else
|
||||||
|
$style['label'] = '';
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -1408,6 +1449,33 @@ switch ($action) {
|
||||||
// Warning. We are using this column to hold this value to avoid
|
// Warning. We are using this column to hold this value to avoid
|
||||||
// the modification of the database for compatibility reasons.
|
// the modification of the database for compatibility reasons.
|
||||||
$style['only_avg'] = (int) get_parameter('only_avg');
|
$style['only_avg'] = (int) get_parameter('only_avg');
|
||||||
|
if ($label != '')
|
||||||
|
$style['label'] = $label;
|
||||||
|
else
|
||||||
|
$style['label'] = '';
|
||||||
|
break;
|
||||||
|
case 'agent_configuration':
|
||||||
|
case 'event_report_module':
|
||||||
|
case 'alert_report_agent':
|
||||||
|
case 'alert_report_module':
|
||||||
|
case 'historical_data':
|
||||||
|
case 'sumatory':
|
||||||
|
case 'database_serialized':
|
||||||
|
case 'monitor_report':
|
||||||
|
case 'min_value':
|
||||||
|
case 'max_value':
|
||||||
|
case 'avg_value':
|
||||||
|
case 'projection_graph':
|
||||||
|
case 'prediction_date':
|
||||||
|
case 'TTRT':
|
||||||
|
case 'TTO':
|
||||||
|
case 'MTBF':
|
||||||
|
case 'MTTR':
|
||||||
|
case 'simple_baseline_graph':
|
||||||
|
if ($label != '')
|
||||||
|
$style['label'] = $label;
|
||||||
|
else
|
||||||
|
$style['label'] = '';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1498,6 +1498,17 @@ function agents_get_address ($id_agent) {
|
||||||
return (string) db_get_value ('direccion', 'tagente', 'id_agente', (int) $id_agent);
|
return (string) db_get_value ('direccion', 'tagente', 'id_agente', (int) $id_agent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get description of an agent.
|
||||||
|
*
|
||||||
|
* @param int Agent id
|
||||||
|
*
|
||||||
|
* @return string The address of the given agent
|
||||||
|
*/
|
||||||
|
function agents_get_description ($id_agent) {
|
||||||
|
return (string) db_get_value ('comentarios', 'tagente', 'id_agente', (int) $id_agent);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the agent that matches an IP address
|
* Get the agent that matches an IP address
|
||||||
*
|
*
|
||||||
|
|
|
@ -4036,7 +4036,7 @@ function graph_netflow_host_traffic ($data, $unit, $width = 700, $height = 700)
|
||||||
* @param integer date date
|
* @param integer date date
|
||||||
*/
|
*/
|
||||||
function grafico_modulo_string ($agent_module_id, $period, $show_events,
|
function grafico_modulo_string ($agent_module_id, $period, $show_events,
|
||||||
$width, $height , $title, $unit_name, $show_alerts, $avg_only = 0, $pure = 0,
|
$width, $height, $title, $unit_name, $show_alerts, $avg_only = 0, $pure = 0,
|
||||||
$date = 0, $only_image = false, $homeurl = '', $adapt_key = '', $ttl = 1, $menu = true) {
|
$date = 0, $only_image = false, $homeurl = '', $adapt_key = '', $ttl = 1, $menu = true) {
|
||||||
global $config;
|
global $config;
|
||||||
global $graphic_type;
|
global $graphic_type;
|
||||||
|
|
|
@ -1021,6 +1021,17 @@ function modules_get_agentmodule_name ($id_agente_modulo) {
|
||||||
return (string) db_get_value ('nombre', 'tagente_modulo', 'id_agente_modulo', (int) $id_agente_modulo);
|
return (string) db_get_value ('nombre', 'tagente_modulo', 'id_agente_modulo', (int) $id_agente_modulo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the module descripcion of an agent module.
|
||||||
|
*
|
||||||
|
* @param int $id_agente_modulo Agent module id.
|
||||||
|
*
|
||||||
|
* @return string descripcion of the given agent module.
|
||||||
|
*/
|
||||||
|
function modules_get_agentmodule_descripcion ($id_agente_modulo) {
|
||||||
|
return (string) db_get_value ('descripcion', 'tagente_modulo', 'id_agente_modulo', (int) $id_agente_modulo);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the module type of an agent module.
|
* Get the module type of an agent module.
|
||||||
*
|
*
|
||||||
|
|
|
@ -123,7 +123,6 @@ function reporting_make_reporting_data($report = null, $id_report,
|
||||||
return reporting_check_structure_report($report);
|
return reporting_check_structure_report($report);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
foreach ($contents as $content) {
|
foreach ($contents as $content) {
|
||||||
if (!empty($period)) {
|
if (!empty($period)) {
|
||||||
$content['period'] = $period;
|
$content['period'] = $period;
|
||||||
|
@ -1345,6 +1344,7 @@ function reporting_event_report_module($report, $content) {
|
||||||
modules_get_agentmodule_name($content['id_agent_module']));
|
modules_get_agentmodule_name($content['id_agent_module']));
|
||||||
$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'] : '';
|
||||||
|
|
||||||
$data = reporting_get_module_detailed_event(
|
$data = reporting_get_module_detailed_event(
|
||||||
$content['id_agent_module'], $content['period'],
|
$content['id_agent_module'], $content['period'],
|
||||||
|
@ -1512,6 +1512,7 @@ function reporting_agent_module($report, $content) {
|
||||||
$return['subtitle'] = $group_name . " - " . $module_group_name;
|
$return['subtitle'] = $group_name . " - " . $module_group_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["data"] = array();
|
$return["data"] = array();
|
||||||
|
|
||||||
|
@ -2080,6 +2081,7 @@ function reporting_event_report_agent($report, $content,
|
||||||
$return['subtitle'] = agents_get_name($content['id_agent']);
|
$return['subtitle'] = agents_get_name($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'] : '';
|
||||||
|
|
||||||
$style = $content['style'];
|
$style = $content['style'];
|
||||||
|
|
||||||
|
@ -2214,6 +2216,7 @@ function reporting_historical_data($report, $content) {
|
||||||
$return['title'] = $content['name'];
|
$return['title'] = $content['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['keys'] = array(__('Date'), __('Data'));
|
$return['keys'] = array(__('Date'), __('Data'));
|
||||||
|
|
||||||
|
@ -2250,6 +2253,7 @@ function reporting_database_serialized($report, $content) {
|
||||||
$return['title'] = $content['name'];
|
$return['title'] = $content['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 = array();
|
$keys = array();
|
||||||
if ($content['header_definition'] != '') {
|
if ($content['header_definition'] != '') {
|
||||||
|
@ -2675,6 +2679,7 @@ 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'] : '';
|
||||||
|
|
||||||
$alerts = agents_get_alerts($content['id_agent']);
|
$alerts = agents_get_alerts($content['id_agent']);
|
||||||
|
|
||||||
|
@ -2804,6 +2809,7 @@ function reporting_alert_report_module($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'] : '';
|
||||||
|
|
||||||
switch ($config["dbtype"]) {
|
switch ($config["dbtype"]) {
|
||||||
case "mysql":
|
case "mysql":
|
||||||
|
@ -2995,6 +3001,7 @@ function reporting_monitor_report($report, $content) {
|
||||||
$return['title'] = $content['name'];
|
$return['title'] = $content['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"]);
|
||||||
|
@ -3148,6 +3155,7 @@ function reporting_simple_baseline_graph($report, $content,
|
||||||
$return['title'] = $content['name'];
|
$return['title'] = $content['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'] : '';
|
||||||
|
|
||||||
// Get chart
|
// Get chart
|
||||||
reporting_set_conf_charts($width, $height, $only_image, $type,
|
reporting_set_conf_charts($width, $height, $only_image, $type,
|
||||||
|
@ -3208,6 +3216,7 @@ function reporting_prediction_date($report, $content) {
|
||||||
$return['title'] = $content['name'];
|
$return['title'] = $content['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'] : '';
|
||||||
|
|
||||||
set_time_limit(500);
|
set_time_limit(500);
|
||||||
|
|
||||||
|
@ -3249,9 +3258,8 @@ function reporting_projection_graph($report, $content,
|
||||||
$return['title'] = $content['name'];
|
$return['title'] = $content['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'] : '';
|
||||||
|
|
||||||
|
|
||||||
$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']));
|
||||||
$agent_name = io_safe_output(
|
$agent_name = io_safe_output(
|
||||||
|
@ -3336,6 +3344,7 @@ function reporting_agent_configuration($report, $content) {
|
||||||
$return['title'] = $content['name'];
|
$return['title'] = $content['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"]);
|
||||||
|
@ -3522,6 +3531,7 @@ function reporting_value($report, $content, $type) {
|
||||||
$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['agent_name'] = $agent_name;
|
$return['agent_name'] = $agent_name;
|
||||||
$return['module_name'] = $module_name;
|
$return['module_name'] = $module_name;
|
||||||
|
@ -4330,6 +4340,12 @@ function reporting_custom_graph($report, $content, $type = 'dinamic',
|
||||||
array_push ($weights, $graph_item["weight"]);
|
array_push ($weights, $graph_item["weight"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$labels = array();
|
||||||
|
if (in_array('label',$content['style'])) {
|
||||||
|
$label = reporting_label_macro($content, $content['style']['label']);
|
||||||
|
$labels = array_fill_keys($modules, $label);
|
||||||
|
}
|
||||||
|
|
||||||
$return['chart'] = '';
|
$return['chart'] = '';
|
||||||
// Get chart
|
// Get chart
|
||||||
reporting_set_conf_charts($width, $height, $only_image, $type,
|
reporting_set_conf_charts($width, $height, $only_image, $type,
|
||||||
|
@ -4354,7 +4370,17 @@ function reporting_custom_graph($report, $content, $type = 'dinamic',
|
||||||
$report["datetime"],
|
$report["datetime"],
|
||||||
$only_image,
|
$only_image,
|
||||||
ui_get_full_url(false, false, false, false),
|
ui_get_full_url(false, false, false, false),
|
||||||
$ttl);
|
$ttl,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
'white',
|
||||||
|
array(),
|
||||||
|
array(),
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
$labels);
|
||||||
break;
|
break;
|
||||||
case 'data':
|
case 'data':
|
||||||
break;
|
break;
|
||||||
|
@ -4407,6 +4433,10 @@ function reporting_simple_graph($report, $content, $type = 'dinamic',
|
||||||
$return["date"] = reporting_get_date_text(
|
$return["date"] = reporting_get_date_text(
|
||||||
$report,
|
$report,
|
||||||
$content);
|
$content);
|
||||||
|
$label = (isset($content['style']['label'])) ? $content['style']['label'] : '';
|
||||||
|
if ($label != '') {
|
||||||
|
$label = reporting_label_macro($content, $label);
|
||||||
|
}
|
||||||
|
|
||||||
$only_avg = true;
|
$only_avg = true;
|
||||||
// Due to database compatibility problems, the 'only_avg' value
|
// Due to database compatibility problems, the 'only_avg' value
|
||||||
|
@ -4447,7 +4477,7 @@ function reporting_simple_graph($report, $content, $type = 'dinamic',
|
||||||
false,
|
false,
|
||||||
$width,
|
$width,
|
||||||
$height,
|
$height,
|
||||||
'',
|
$label,
|
||||||
'',
|
'',
|
||||||
false,
|
false,
|
||||||
$only_avg,
|
$only_avg,
|
||||||
|
@ -4472,7 +4502,7 @@ function reporting_simple_graph($report, $content, $type = 'dinamic',
|
||||||
false,
|
false,
|
||||||
$width,
|
$width,
|
||||||
$height,
|
$height,
|
||||||
'',
|
$label,
|
||||||
'',
|
'',
|
||||||
false,
|
false,
|
||||||
$only_avg,
|
$only_avg,
|
||||||
|
@ -8716,4 +8746,82 @@ function reporting_get_agentmodule_sla_working_timestamp ($period, $date_end, $w
|
||||||
return $wt;
|
return $wt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function reporting_label_macro ($item, $label) {
|
||||||
|
|
||||||
|
switch ($item['type']) {
|
||||||
|
case 'event_report_agent':
|
||||||
|
case 'alert_report_agent':
|
||||||
|
case 'agent_configuration':
|
||||||
|
if (preg_match("/_agent_/", $label)) {
|
||||||
|
$agent_name = agents_get_name($item['id_agent']);
|
||||||
|
$label = str_replace("_agent_", $agent_name, $label);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (preg_match("/_agentdescription_/", $label)) {
|
||||||
|
$agent_name = agents_get_description($item['id_agent']);
|
||||||
|
$label = str_replace("_agentdescription_", $agent_name, $label);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (preg_match("/_agentgroup_/", $label)) {
|
||||||
|
$agent_name = groups_get_name(agents_get_agent_group($item['id_agent']),true);
|
||||||
|
$label = str_replace("_agentgroup_", $agent_name, $label);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (preg_match("/_address_/", $label)) {
|
||||||
|
$agent_name = agents_get_address($item['id_agent']);
|
||||||
|
$label = str_replace("_address_", $agent_name, $label);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'simple_graph':
|
||||||
|
case 'custom_graph':
|
||||||
|
case 'simple_baseline_graph':
|
||||||
|
case 'event_report_module':
|
||||||
|
case 'alert_report_module':
|
||||||
|
case 'historical_data':
|
||||||
|
case 'sumatory':
|
||||||
|
case 'database_serialized':
|
||||||
|
case 'monitor_report':
|
||||||
|
case 'min_value':
|
||||||
|
case 'max_value':
|
||||||
|
case 'avg_value':
|
||||||
|
case 'projection_graph':
|
||||||
|
case 'prediction_date':
|
||||||
|
case 'TTRT':
|
||||||
|
case 'TTO':
|
||||||
|
case 'MTBF':
|
||||||
|
case 'MTTR':
|
||||||
|
if (preg_match("/_agent_/", $label)) {
|
||||||
|
$agent_name = agents_get_name($item['id_agent']);
|
||||||
|
$label = str_replace("_agent_", $agent_name, $label);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (preg_match("/_agentdescription_/", $label)) {
|
||||||
|
$agent_name = agents_get_description($item['id_agent']);
|
||||||
|
$label = str_replace("_agentdescription_", $agent_name, $label);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (preg_match("/_agentgroup_/", $label)) {
|
||||||
|
$agent_name = groups_get_name(agents_get_agent_group($item['id_agent']),true);
|
||||||
|
$label = str_replace("_agentgroup_", $agent_name, $label);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (preg_match("/_address_/", $label)) {
|
||||||
|
$agent_name = agents_get_address($item['id_agent']);
|
||||||
|
$label = str_replace("_address_", $agent_name, $label);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (preg_match("/_module_/", $label)) {
|
||||||
|
$module_name = modules_get_agentmodule_name($item['id_agent_module']);
|
||||||
|
$label = str_replace("_module_", $module_name, $label);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (preg_match("/_moduledescription_/", $label)) {
|
||||||
|
$module_description = modules_get_agentmodule_descripcion($item['id_agent_module']);
|
||||||
|
$label = str_replace("_moduledescription_", $module_description, $label);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $label;
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -38,7 +38,7 @@ include_once($config['homedir'] . "/include/functions_ui.php");
|
||||||
include_once($config['homedir'] . "/include/functions_netflow.php");
|
include_once($config['homedir'] . "/include/functions_netflow.php");
|
||||||
|
|
||||||
function reporting_html_header(&$table, $mini, $title, $subtitle,
|
function reporting_html_header(&$table, $mini, $title, $subtitle,
|
||||||
$period, $date, $from, $to) {
|
$period, $date, $from, $to, $label = '') {
|
||||||
|
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
|
@ -73,7 +73,8 @@ function reporting_html_header(&$table, $mini, $title, $subtitle,
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
if (empty($subtitle) && (empty($date_text))) {
|
if (empty($subtitle) && (empty($date_text))) {
|
||||||
$data[] = $sizh . $title . $sizhfin;
|
$title = $sizh . $title . $sizhfin;
|
||||||
|
$data[] = $title;
|
||||||
$table->colspan[0][0] = 3;
|
$table->colspan[0][0] = 3;
|
||||||
}
|
}
|
||||||
else if (empty($subtitle)) {
|
else if (empty($subtitle)) {
|
||||||
|
@ -87,7 +88,11 @@ function reporting_html_header(&$table, $mini, $title, $subtitle,
|
||||||
$table->colspan[0][1] = 2;
|
$table->colspan[0][1] = 2;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$data[] = $sizh . $title . $sizhfin;
|
$title = $sizh . $title;
|
||||||
|
if ($label != '') {
|
||||||
|
$title .= '<br >' . __('Label: ') . $label;
|
||||||
|
}
|
||||||
|
$data[] = $title . $sizhfin;
|
||||||
$data[] = $sizh . $subtitle . $sizhfin;
|
$data[] = $sizh . $subtitle . $sizhfin;
|
||||||
$data[] = "<div style='text-align: right;'>" . $sizh . $date_text . $sizhfin . "</div>";
|
$data[] = "<div style='text-align: right;'>" . $sizh . $date_text . $sizhfin . "</div>";
|
||||||
}
|
}
|
||||||
|
@ -111,14 +116,19 @@ function reporting_html_print_report($report, $mini = false) {
|
||||||
$table->colspan = array ();
|
$table->colspan = array ();
|
||||||
$table->rowstyle = array ();
|
$table->rowstyle = array ();
|
||||||
|
|
||||||
|
if (isset($item['label']) && $item['label'] != '') {
|
||||||
|
$label = reporting_label_macro($item, $item['label']);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$label = '';
|
||||||
reporting_html_header($table,
|
reporting_html_header($table,
|
||||||
$mini, $item['title'],
|
$mini, $item['title'],
|
||||||
$item['subtitle'],
|
$item['subtitle'],
|
||||||
$item['date']['period'],
|
$item['date']['period'],
|
||||||
$item['date']['date'],
|
$item['date']['date'],
|
||||||
$item['date']['from'],
|
$item['date']['from'],
|
||||||
$item['date']['to']);
|
$item['date']['to'],
|
||||||
|
$label);
|
||||||
|
|
||||||
if ($item["description"] != "") {
|
if ($item["description"] != "") {
|
||||||
$table->data['description_row']['description'] = $item["description"];
|
$table->data['description_row']['description'] = $item["description"];
|
||||||
|
|
|
@ -265,7 +265,8 @@ function area_graph($flash_chart, $chart_data, $width, $height, $color,
|
||||||
$vconsole,
|
$vconsole,
|
||||||
$agent_module_id,
|
$agent_module_id,
|
||||||
$font,
|
$font,
|
||||||
$font_size);
|
$font_size,
|
||||||
|
$xaxisname);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$graph = array();
|
$graph = array();
|
||||||
|
|
|
@ -0,0 +1,137 @@
|
||||||
|
/*
|
||||||
|
CAxis Labels Plugin for flot. :P
|
||||||
|
Copyright (c) 2010 Xuan Luo
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
The above copyright notice and this permission notice shall be
|
||||||
|
included in all copies or substantial portions of the Software.
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
(function ($) {
|
||||||
|
var options = { };
|
||||||
|
|
||||||
|
function init(plot) {
|
||||||
|
// This is kind of a hack. There are no hooks in Flot between
|
||||||
|
// the creation and measuring of the ticks (setTicks, measureTickLabels
|
||||||
|
// in setupGrid() ) and the drawing of the ticks and plot box
|
||||||
|
// (insertAxisLabels in setupGrid() ).
|
||||||
|
//
|
||||||
|
// Therefore, we use a trick where we run the draw routine twice:
|
||||||
|
// the first time to get the tick measurements, so that we can change
|
||||||
|
// them, and then have it draw it again.
|
||||||
|
var secondPass = false;
|
||||||
|
plot.hooks.draw.push(function (plot, ctx) {
|
||||||
|
if (!secondPass) {
|
||||||
|
// MEASURE AND SET OPTIONS
|
||||||
|
$.each(plot.getAxes(), function(axisName, axis) {
|
||||||
|
var opts = axis.options // Flot 0.7
|
||||||
|
|| plot.getOptions()[axisName]; // Flot 0.6
|
||||||
|
if (!opts || !opts.axisLabel)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var w, h;
|
||||||
|
if (opts.axisLabelUseCanvas != false)
|
||||||
|
opts.axisLabelUseCanvas = true;
|
||||||
|
|
||||||
|
if (opts.axisLabelUseCanvas) {
|
||||||
|
// canvas text
|
||||||
|
if (!opts.axisLabelFontSizePixels)
|
||||||
|
opts.axisLabelFontSizePixels = 14;
|
||||||
|
if (!opts.axisLabelFontFamily)
|
||||||
|
opts.axisLabelFontFamily = 'sans-serif';
|
||||||
|
// since we currently always display x as horiz.
|
||||||
|
// and y as vertical, we only care about the height
|
||||||
|
w = opts.axisLabelFontSizePixels;
|
||||||
|
h = opts.axisLabelFontSizePixels;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// HTML text
|
||||||
|
var elem = $('<div class="axisLabels" style="position:absolute;">' + opts.axisLabel + '</div>');
|
||||||
|
plot.getPlaceholder().append(elem);
|
||||||
|
w = elem.outerWidth(true);
|
||||||
|
h = elem.outerHeight(true);
|
||||||
|
elem.remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (axisName.charAt(0) == 'x')
|
||||||
|
axis.labelHeight += h;
|
||||||
|
else
|
||||||
|
axis.labelWidth += w;
|
||||||
|
opts.labelHeight = axis.labelHeight;
|
||||||
|
opts.labelWidth = axis.labelWidth;
|
||||||
|
});
|
||||||
|
// re-draw with new label widths and heights
|
||||||
|
secondPass = true;
|
||||||
|
plot.setupGrid();
|
||||||
|
plot.draw();
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// DRAW
|
||||||
|
$.each(plot.getAxes(), function(axisName, axis) {
|
||||||
|
var opts = axis.options // Flot 0.7
|
||||||
|
|| plot.getOptions()[axisName]; // Flot 0.6
|
||||||
|
if (!opts || !opts.axisLabel)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (opts.axisLabelUseCanvas) {
|
||||||
|
// canvas text
|
||||||
|
var ctx = plot.getCanvas().getContext('2d');
|
||||||
|
ctx.save();
|
||||||
|
ctx.font = opts.axisLabelFontSizePixels + 'px ' +
|
||||||
|
opts.axisLabelFontFamily;
|
||||||
|
var width = ctx.measureText(opts.axisLabel).width;
|
||||||
|
var height = opts.axisLabelFontSizePixels;
|
||||||
|
var x, y;
|
||||||
|
if (axisName.charAt(0) == 'x') {
|
||||||
|
x = plot.getPlotOffset().left + plot.width()/2 - width/2;
|
||||||
|
y = plot.getCanvas().height;
|
||||||
|
} else {
|
||||||
|
x = height * 0.72;
|
||||||
|
y = plot.getPlotOffset().top + plot.height()/2 - width/2;
|
||||||
|
}
|
||||||
|
ctx.translate(x, y);
|
||||||
|
ctx.rotate((axisName.charAt(0) == 'x') ? 0 : -Math.PI/2);
|
||||||
|
ctx.fillText(opts.axisLabel, 0, 0);
|
||||||
|
ctx.restore();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// HTML text
|
||||||
|
plot.getPlaceholder().find('#' + axisName + 'Label').remove();
|
||||||
|
var elem = $('<div id="' + axisName + 'Label" class="axisLabels" style="position:absolute;">' + opts.axisLabel + '</div>');
|
||||||
|
if (axisName.charAt(0) == 'x') {
|
||||||
|
//~ elem.css('left', plot.getPlotOffset().left + plot.width()/4 - elem.outerWidth()/2 + 'px');
|
||||||
|
elem.css('bottom', '0px');
|
||||||
|
elem.css('width', '100%');
|
||||||
|
} else {
|
||||||
|
elem.css('top', plot.getPlotOffset().top + plot.height()/2 - elem.outerHeight()/2 + 'px');
|
||||||
|
elem.css('left', '0px');
|
||||||
|
}
|
||||||
|
plot.getPlaceholder().append(elem);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
secondPass = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$.plot.plugins.push({
|
||||||
|
init: init,
|
||||||
|
options: options,
|
||||||
|
name: 'axisLabels',
|
||||||
|
version: '1.0'
|
||||||
|
});
|
||||||
|
})(jQuery);
|
|
@ -829,7 +829,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
|
||||||
alert_ids, legend_alerts, yellow_threshold, red_threshold,
|
alert_ids, legend_alerts, yellow_threshold, red_threshold,
|
||||||
force_integer, separator, separator2,
|
force_integer, separator, separator2,
|
||||||
yellow_up, red_up, yellow_inverse, red_inverse,
|
yellow_up, red_up, yellow_inverse, red_inverse,
|
||||||
series_suffix_str, dashboard, vconsole) {
|
series_suffix_str, dashboard, vconsole, xaxisname) {
|
||||||
|
|
||||||
var threshold = true;
|
var threshold = true;
|
||||||
var thresholded = false;
|
var thresholded = false;
|
||||||
|
@ -1510,6 +1510,9 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
|
||||||
markings: markings
|
markings: markings
|
||||||
},
|
},
|
||||||
xaxes: [ {
|
xaxes: [ {
|
||||||
|
axisLabelFontSizePixels: font_size,
|
||||||
|
axisLabelUseCanvas: false,
|
||||||
|
axisLabel: xaxisname,
|
||||||
tickFormatter: xFormatter,
|
tickFormatter: xFormatter,
|
||||||
minTickSize: steps,
|
minTickSize: steps,
|
||||||
color: '#000'
|
color: '#000'
|
||||||
|
|
|
@ -51,6 +51,8 @@ function include_javascript_dependencies_flot_graph($return = false) {
|
||||||
<script language="javascript" type="text/javascript" src="'.
|
<script language="javascript" type="text/javascript" src="'.
|
||||||
ui_get_full_url($metaconsole_hack . '/include/graphs/flot/jquery.flot.symbol.min.js') .'"></script>
|
ui_get_full_url($metaconsole_hack . '/include/graphs/flot/jquery.flot.symbol.min.js') .'"></script>
|
||||||
<script language="javascript" type="text/javascript" src="'.
|
<script language="javascript" type="text/javascript" src="'.
|
||||||
|
ui_get_full_url($metaconsole_hack . '/include/graphs/flot/jquery.flot.axislabels.js') .'"></script>
|
||||||
|
<script language="javascript" type="text/javascript" src="'.
|
||||||
ui_get_full_url($metaconsole_hack . '/include/graphs/flot/pandora.flot.js') .'"></script>';
|
ui_get_full_url($metaconsole_hack . '/include/graphs/flot/pandora.flot.js') .'"></script>';
|
||||||
$output .= "
|
$output .= "
|
||||||
<script type='text/javascript'>
|
<script type='text/javascript'>
|
||||||
|
@ -110,15 +112,15 @@ function flot_area_simple_graph($chart_data, $width, $height, $color,
|
||||||
$serie_types = array(), $chart_extra_data = array(),
|
$serie_types = array(), $chart_extra_data = array(),
|
||||||
$yellow_threshold = 0, $red_threshold = 0, $adapt_key= '',
|
$yellow_threshold = 0, $red_threshold = 0, $adapt_key= '',
|
||||||
$force_integer = false, $series_suffix_str = '', $menu = true,
|
$force_integer = false, $series_suffix_str = '', $menu = true,
|
||||||
$background_color = 'white', $dashboard = false, $vconsole = false, $agent_module_id = 0, $font = '',$font_size = 7) {
|
$background_color = 'white', $dashboard = false, $vconsole = false, $agent_module_id = 0, $font = '',$font_size = 7, $xaxisname = '') {
|
||||||
|
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
return flot_area_graph($chart_data, $width, $height, $color,
|
return flot_area_graph($chart_data, $width, $height, $color,
|
||||||
$legend, $long_index, $homeurl, $unit, 'area_simple',
|
$legend, $long_index, $homeurl, $unit, 'area_simple',
|
||||||
$water_mark, $serie_types, $chart_extra_data, $yellow_threshold,
|
$water_mark, $serie_types, $chart_extra_data, $yellow_threshold,
|
||||||
$red_threshold, $adapt_key, $force_integer, $series_suffix_str,
|
$red_threshold, $adapt_key, $force_integer, $series_suffix_str,
|
||||||
$menu, $background_color, $dashboard, $vconsole, $agent_module_id,$font,$font_size);
|
$menu, $background_color, $dashboard, $vconsole, $agent_module_id,$font,$font_size, $xaxisname);
|
||||||
}
|
}
|
||||||
|
|
||||||
function flot_line_stacked_graph($chart_data, $width, $height, $color,
|
function flot_line_stacked_graph($chart_data, $width, $height, $color,
|
||||||
|
@ -157,8 +159,8 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend,
|
||||||
$long_index, $homeurl, $unit, $type, $water_mark, $serie_types,
|
$long_index, $homeurl, $unit, $type, $water_mark, $serie_types,
|
||||||
$chart_extra_data, $yellow_threshold, $red_threshold, $adapt_key,
|
$chart_extra_data, $yellow_threshold, $red_threshold, $adapt_key,
|
||||||
$force_integer, $series_suffix_str = '', $menu = true,
|
$force_integer, $series_suffix_str = '', $menu = true,
|
||||||
$background_color = 'white', $dashboard = false, $vconsole = false, $agent_module_id = 0,$font = '',$font_size = 7) {
|
$background_color = 'white', $dashboard = false, $vconsole = false, $agent_module_id = 0,$font = '',$font_size = 7, $xaxisname = '') {
|
||||||
|
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
|
|
||||||
|
@ -447,7 +449,8 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend,
|
||||||
"'$red_inverse', \n" .
|
"'$red_inverse', \n" .
|
||||||
"'$series_suffix_str',
|
"'$series_suffix_str',
|
||||||
" . json_encode($dashboard) . ",\n
|
" . json_encode($dashboard) . ",\n
|
||||||
" . json_encode($vconsole) . ");";
|
" . json_encode($vconsole) . ",\n" .
|
||||||
|
"'$xaxisname');";
|
||||||
$return .= "\n//]]>";
|
$return .= "\n//]]>";
|
||||||
$return .= "</script>";
|
$return .= "</script>";
|
||||||
|
|
||||||
|
@ -757,7 +760,7 @@ function flot_vcolumn_chart ($graph_data, $width, $height, $color, $legend, $lon
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function flot_slicesbar_graph ($graph_data, $period, $width, $height, $legend, $colors, $fontpath, $round_corner, $homeurl, $watermark = '', $adapt_key = '', $stat_win = false) {
|
function flot_slicesbar_graph ($graph_data, $period, $width, $height, $legend, $colors, $fontpath, $round_corner, $homeurl, $watermark = '', $adapt_key = '', $stat_win = false, $id_agent = 0) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
include_javascript_dependencies_flot_graph();
|
include_javascript_dependencies_flot_graph();
|
||||||
|
@ -877,7 +880,7 @@ function flot_slicesbar_graph ($graph_data, $period, $width, $height, $legend, $
|
||||||
// Javascript code
|
// Javascript code
|
||||||
$return .= "<script type='text/javascript'>";
|
$return .= "<script type='text/javascript'>";
|
||||||
$return .= "//<![CDATA[\n";
|
$return .= "//<![CDATA[\n";
|
||||||
$return .= "pandoraFlotSlicebar('$graph_id', '$values', '$datacolor', '$labels', '$legend', '$acumulate_data', $intervaltick, false, $max, '$separator', '$separator2')";
|
$return .= "pandoraFlotSlicebar('$graph_id', '$values', '$datacolor', '$labels', '$legend', '$acumulate_data', $intervaltick, false, $max, '$separator', '$separator2', '', $id_agent)";
|
||||||
$return .= "\n//]]>";
|
$return .= "\n//]]>";
|
||||||
$return .= "</script>";
|
$return .= "</script>";
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Include/help/en
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
<h1>Reports - Label field macros</h1>
|
||||||
|
<p>
|
||||||
|
|
||||||
|
The following macros are also available: <br />
|
||||||
|
<ul>
|
||||||
|
<li><b>_agent_ </b>: Name of the agent that you selected in report item.<li />
|
||||||
|
<li><b>_agentdescription_ </b>: Description of the agent that you selected in report item.<li />
|
||||||
|
<li><b>_agentgroup_ </b>: Agent group name.<li />
|
||||||
|
<li><b>_address_</b> : Address of the agent that you selected in report item.<li />
|
||||||
|
<ul />
|
||||||
|
<br />
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
Only if in form you can select a agent module.<br />
|
||||||
|
<li><b>_module_ </b>: Module name that you selected in report item.<li />
|
||||||
|
<li><b>_moduledescription_</b> : Description of the module that you selected in report item.<li />
|
||||||
|
<ul />
|
||||||
|
Example: Agent: <b>_agent_</b> / module: <b>_module_</b><br />
|
||||||
|
|
||||||
|
</p>
|
|
@ -0,0 +1,25 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package include/help/es
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
<h1>Informes - Macros del campo etiqueta</h1>
|
||||||
|
<p>
|
||||||
|
|
||||||
|
Lista de las macros admitidas en este campo: <br />
|
||||||
|
<ul>
|
||||||
|
<li><b>_agent_ </b>: Nombre del agente que ha seleccionado en el elemento del informe.<li />
|
||||||
|
<li><b>_agentdescription_ </b>: Descripción del agente que ha seleccionado en el elemento del informe.<li />
|
||||||
|
<li><b>_agentgroup_ </b>: Grupo del agente que ha seleccionado en el elemento del informe<li />
|
||||||
|
<li><b>_address_</b> : Dirección del agente que ha seleccionado en el elemento del informe<li />
|
||||||
|
<ul />
|
||||||
|
<br />
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
Solamente si ha podido o puede seleccionar un módulo de agente en el elemento del informe.<br />
|
||||||
|
<li><b>_module_ </b>: Nombre del módulo de agente que ha seleccionado en el elemento del informe.<li />
|
||||||
|
<li><b>_moduledescription_</b> : Descripción del módulo de agente que ha seleccionado en el elemento del informe.<li />
|
||||||
|
<ul />
|
||||||
|
Ejemplo: Agente: <b>_agent_</b> / Módulo: <b>_module_</b><br />
|
||||||
|
|
||||||
|
</p>
|
Loading…
Reference in New Issue