Added hooks to the enterprise services SLA reports
* include/ajax/reporting.ajax.php godmode/reporting/reporting_builder.item_editor.php: Added hooks to the enterprise services SLA reports.
This commit is contained in:
parent
1108416ee3
commit
6412dc7e17
|
@ -1,3 +1,9 @@
|
||||||
|
2014-09-05 Alejandro Gallardo <alejandro.gallardo@artica.es>
|
||||||
|
|
||||||
|
* include/ajax/reporting.ajax.php
|
||||||
|
godmode/reporting/reporting_builder.item_editor.php:
|
||||||
|
Added hooks to the enterprise services SLA reports.
|
||||||
|
|
||||||
2014-09-04 Vanessa Gil <vanessa.gil@artica.es>
|
2014-09-04 Vanessa Gil <vanessa.gil@artica.es>
|
||||||
|
|
||||||
* include/languages/ru.mo
|
* include/languages/ru.mo
|
||||||
|
|
|
@ -1120,16 +1120,18 @@ function print_SLA_list($width, $action, $idItem = null) {
|
||||||
global $config;
|
global $config;
|
||||||
global $meta;
|
global $meta;
|
||||||
|
|
||||||
|
$report_item_type = db_get_value ('type', 'treport_content', 'id_rc', $idItem);
|
||||||
?>
|
?>
|
||||||
<table class="databox" id="sla_list" border="0" cellpadding="4" cellspacing="4" width="98%">
|
<table class="databox" id="sla_list" border="0" cellpadding="4" cellspacing="4" width="98%">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="header" scope="col"><?php echo __('Agent');?></th>
|
<th class="header sla_list_agent_col" scope="col"><?php echo __('Agent');?></th>
|
||||||
<th class="header" scope="col"><?php echo __('Module');?></th>
|
<th class="header sla_list_module_col" scope="col"><?php echo __('Module');?></th>
|
||||||
<th class="header" scope="col"><?php echo __('SLA Min. (value)');?></th>
|
<th class="header sla_list_service_col" scope="col"><?php echo __('Service');?></th>
|
||||||
<th class="header" scope="col"><?php echo __('SLA Max. (value)');?></th>
|
<th class="header sla_list_sla_min_col" scope="col"><?php echo __('SLA Min. (value)');?></th>
|
||||||
<th class="header" scope="col"><?php echo __('SLA Limit (%)');?></th>
|
<th class="header sla_list_sla_max_col" scope="col"><?php echo __('SLA Max. (value)');?></th>
|
||||||
<th class="header" scope="col"><?php echo __('Action');?></th>
|
<th class="header sla_list_sla_limit_col" scope="col"><?php echo __('SLA Limit (%)');?></th>
|
||||||
|
<th class="header sla_list_action_col" scope="col"><?php echo __('Action');?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<?php
|
<?php
|
||||||
|
@ -1170,17 +1172,24 @@ function print_SLA_list($width, $action, $idItem = null) {
|
||||||
$server_name_element = '';
|
$server_name_element = '';
|
||||||
if ($meta && $server_name != '')
|
if ($meta && $server_name != '')
|
||||||
$server_name_element .= ' (' . $server_name . ')';
|
$server_name_element .= ' (' . $server_name . ')';
|
||||||
|
|
||||||
echo '<tr id="sla_' . $item['id'] . '" style="" class="datos">
|
echo '<tr id="sla_' . $item['id'] . '" style="" class="datos">';
|
||||||
<td>' . printSmallFont($nameAgent) . $server_name_element . '</td>
|
echo '<td class="sla_list_agent_col">' . printSmallFont($nameAgent) . $server_name_element . '</td>';
|
||||||
<td>' . printSmallFont($nameModule) . '</td>
|
echo '<td class="sla_list_module_col">' . printSmallFont($nameModule) . '</td>';
|
||||||
<td>' . $item['sla_min'] . '</td>
|
|
||||||
<td>' . $item['sla_max'] . '</td>
|
if (enterprise_installed() && $report_item_type == 'SLA_services') {
|
||||||
<td>' . $item['sla_limit'] . '</td>
|
enterprise_include_once("include/functions_services.php");
|
||||||
<td style="text-align: center;">
|
$nameService = enterprise_hook('services_get_name', array($item['id_agent_module']));
|
||||||
|
echo '<td class="sla_list_service_col">' . printSmallFont($nameService) . '</th>';
|
||||||
|
}
|
||||||
|
|
||||||
|
echo '<td class="sla_list_sla_min_col">' . $item['sla_min'] . '</td>';
|
||||||
|
echo '<td class="sla_list_sla_max_col">' . $item['sla_max'] . '</td>';
|
||||||
|
echo '<td class="sla_list_sla_limit_col">' . $item['sla_limit'] . '</td>';
|
||||||
|
echo '<td class="sla_list_action_col" style="text-align: center;">
|
||||||
<a href="javascript: deleteSLARow(' . $item['id'] . ');">' . html_print_image("images/cross.png", true) . '</a>
|
<a href="javascript: deleteSLARow(' . $item['id'] . ');">' . html_print_image("images/cross.png", true) . '</a>
|
||||||
</td>
|
</td>';
|
||||||
</tr>';
|
echo '</tr>';
|
||||||
if ($meta) {
|
if ($meta) {
|
||||||
//Restore db connection
|
//Restore db connection
|
||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
|
@ -1190,17 +1199,24 @@ function print_SLA_list($width, $action, $idItem = null) {
|
||||||
?>
|
?>
|
||||||
<tbody id="sla_template">
|
<tbody id="sla_template">
|
||||||
<tr id="row" style="display: none;" class="datos">
|
<tr id="row" style="display: none;" class="datos">
|
||||||
<td class="agent_name"></td>
|
<td class="sla_list_agent_col agent_name"></td>
|
||||||
<td class="module_name"></td>
|
<td class="sla_list_module_col module_name"></td>
|
||||||
<td class="sla_min"></td>
|
<?php
|
||||||
<td class="sla_max"></td>
|
if (enterprise_installed() && $report_item_type == 'SLA_services') {
|
||||||
<td class="sla_limit"></td>
|
echo "<td class=\"sla_list_service_col service_name\"></td>";
|
||||||
<td style="text-align: center;"><a class="delete_button" href="javascript: deleteSLARow(0);"><?php html_print_image("images/cross.png", false); ?></a></td>
|
}
|
||||||
|
?>
|
||||||
|
<td class="sla_list_sla_min_col sla_min"></td>
|
||||||
|
<td class="sla_list_sla_max_col sla_max"></td>
|
||||||
|
<td class="sla_list_sla_limit_col sla_limit"></td>
|
||||||
|
<td class="sla_list_action_col" style="text-align: center;">
|
||||||
|
<a class="delete_button" href="javascript: deleteSLARow(0);"><?php html_print_image("images/cross.png", false); ?></a>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr id="sla_form" style="" class="datos">
|
<tr id="sla_form" style="" class="datos">
|
||||||
<td>
|
<td class="sla_list_agent_col">
|
||||||
<input id="hidden-id_agent_sla" name="id_agent_sla" value="" type="hidden">
|
<input id="hidden-id_agent_sla" name="id_agent_sla" value="" type="hidden">
|
||||||
<input id="hidden-server_name" name="server_name" value="" type="hidden">
|
<input id="hidden-server_name" name="server_name" value="" type="hidden">
|
||||||
<?php
|
<?php
|
||||||
|
@ -1220,11 +1236,29 @@ function print_SLA_list($width, $action, $idItem = null) {
|
||||||
}
|
}
|
||||||
ui_print_agent_autocomplete_input($params);
|
ui_print_agent_autocomplete_input($params);
|
||||||
?>
|
?>
|
||||||
<td><select id="id_agent_module_sla" name="id_agente_modulo_sla" disabled="disabled" style="max-width: 180px"><option value="0"><?php echo __('Select an Agent first'); ?></option></select></td>
|
<td class="sla_list_module_col"><select id="id_agent_module_sla" name="id_agente_modulo_sla" disabled="disabled" style="max-width: 180px"><option value="0"><?php echo __('Select an Agent first'); ?></option></select></td>
|
||||||
<td><input name="sla_min" id="text-sla_min" size="10" maxlength="10" type="text"></td>
|
<?php
|
||||||
<td><input name="sla_max" id="text-sla_max" size="10" maxlength="10" type="text"></td>
|
if (enterprise_installed() && $report_item_type == 'SLA_services') {
|
||||||
<td><input name="sla_limit" id="text-sla_limit" size="10" maxlength="10" type="text"></td>
|
enterprise_include_once("include/functions_services.php");
|
||||||
<td style="text-align: center;"><a href="javascript: addSLARow();"><?php html_print_image("images/disk.png", false); ?></a></td>
|
// Services list
|
||||||
|
$services = array();
|
||||||
|
$services_tmp = enterprise_hook('services_get_services', array(false, array('id', 'name', 'sla_id_module', 'sla_value_id_module')));
|
||||||
|
if (!empty($services_tmp) && $services_tmp != ENTERPRISE_NOT_HOOK) {
|
||||||
|
foreach ($services_tmp as $service) {
|
||||||
|
$check_module_sla = modules_check_agentmodule_exists($service['sla_id_module']);
|
||||||
|
$check_module_sla_value = modules_check_agentmodule_exists($service['sla_value_id_module']);
|
||||||
|
if ($check_module_sla && $check_module_sla_value) {
|
||||||
|
$services[$service['id']] = $service['name'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
echo "<td class=\"sla_list_service_col\">".html_print_select($services, 'id_service', false, '', '', '', true, false, false)."</td>";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<td class="sla_list_sla_min_col"><input name="sla_min" id="text-sla_min" size="10" maxlength="10" type="text"></td>
|
||||||
|
<td class="sla_list_sla_max_col"><input name="sla_max" id="text-sla_max" size="10" maxlength="10" type="text"></td>
|
||||||
|
<td class="sla_list_sla_limit_col"><input name="sla_limit" id="text-sla_limit" size="10" maxlength="10" type="text"></td>
|
||||||
|
<td class="sla_list_action_col" style="text-align: center;"><a href="javascript: addSLARow();"><?php html_print_image("images/disk.png", false); ?></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
<?php
|
<?php
|
||||||
|
@ -1611,39 +1645,46 @@ function addSLARow() {
|
||||||
var slaMin = $("input[name=sla_min]").val();
|
var slaMin = $("input[name=sla_min]").val();
|
||||||
var slaMax = $("input[name=sla_max]").val();
|
var slaMax = $("input[name=sla_max]").val();
|
||||||
var slaLimit = $("input[name=sla_limit]").val();
|
var slaLimit = $("input[name=sla_limit]").val();
|
||||||
|
|
||||||
|
var serviceId = $("select#id_service>option:selected").val();
|
||||||
|
var serviceName = $("select#id_service>option:selected").text();
|
||||||
|
|
||||||
if ((idAgent != '') && (slaMin != '') && (slaMax != '')
|
if (((idAgent != '') && (slaMin != '') && (slaMax != '')
|
||||||
&& (slaLimit != '')) {
|
&& (slaLimit != '')) || serviceId != '') {
|
||||||
//Truncate nameAgent
|
|
||||||
var params = [];
|
if (nameAgent != '') {
|
||||||
params.push("truncate_text=1");
|
//Truncate nameAgent
|
||||||
params.push("text=" + nameAgent);
|
var params = [];
|
||||||
params.push("page=include/ajax/reporting.ajax");
|
params.push("truncate_text=1");
|
||||||
jQuery.ajax ({
|
params.push("text=" + nameAgent);
|
||||||
data: params.join ("&"),
|
params.push("page=include/ajax/reporting.ajax");
|
||||||
type: 'POST',
|
jQuery.ajax ({
|
||||||
url: action= <?php echo '"' . ui_get_full_url(false, false, false, false) . '"'; ?> + "/ajax.php",
|
data: params.join ("&"),
|
||||||
async: false,
|
type: 'POST',
|
||||||
timeout: 10000,
|
url: action= <?php echo '"' . ui_get_full_url(false, false, false, false) . '"'; ?> + "/ajax.php",
|
||||||
success: function (data) {
|
async: false,
|
||||||
nameAgent = data;
|
timeout: 10000,
|
||||||
}
|
success: function (data) {
|
||||||
});
|
nameAgent = data;
|
||||||
//Truncate nameModule
|
}
|
||||||
var params = [];
|
});
|
||||||
params.push("truncate_text=1");
|
|
||||||
params.push("text=" + nameModule);
|
//Truncate nameModule
|
||||||
params.push("page=include/ajax/reporting.ajax");
|
var params = [];
|
||||||
jQuery.ajax ({
|
params.push("truncate_text=1");
|
||||||
data: params.join ("&"),
|
params.push("text=" + nameModule);
|
||||||
type: 'POST',
|
params.push("page=include/ajax/reporting.ajax");
|
||||||
url: action= <?php echo '"' . ui_get_full_url(false, false, false, false) . '"'; ?> + "/ajax.php",
|
jQuery.ajax ({
|
||||||
async: false,
|
data: params.join ("&"),
|
||||||
timeout: 10000,
|
type: 'POST',
|
||||||
success: function (data) {
|
url: action= <?php echo '"' . ui_get_full_url(false, false, false, false) . '"'; ?> + "/ajax.php",
|
||||||
nameModule = data;
|
async: false,
|
||||||
}
|
timeout: 10000,
|
||||||
});
|
success: function (data) {
|
||||||
|
nameModule = data;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
var params = [];
|
var params = [];
|
||||||
params.push("add_sla=1");
|
params.push("add_sla=1");
|
||||||
|
@ -1653,6 +1694,10 @@ function addSLARow() {
|
||||||
params.push("sla_max=" + slaMax);
|
params.push("sla_max=" + slaMax);
|
||||||
params.push("sla_limit=" + slaLimit);
|
params.push("sla_limit=" + slaLimit);
|
||||||
params.push("server_id=" + serverId);
|
params.push("server_id=" + serverId);
|
||||||
|
|
||||||
|
if (serviceId != '') {
|
||||||
|
params.push("id_service=" + serviceId);
|
||||||
|
}
|
||||||
|
|
||||||
params.push("page=include/ajax/reporting.ajax");
|
params.push("page=include/ajax/reporting.ajax");
|
||||||
jQuery.ajax ({
|
jQuery.ajax ({
|
||||||
|
@ -1669,6 +1714,7 @@ function addSLARow() {
|
||||||
$("#row", row).attr('id', 'sla_' + data['id']);
|
$("#row", row).attr('id', 'sla_' + data['id']);
|
||||||
$(".agent_name", row).html(nameAgent);
|
$(".agent_name", row).html(nameAgent);
|
||||||
$(".module_name", row).html(nameModule);
|
$(".module_name", row).html(nameModule);
|
||||||
|
$(".service_name", row).html(serviceName);
|
||||||
$(".sla_min", row).html(slaMin);
|
$(".sla_min", row).html(slaMin);
|
||||||
$(".sla_max", row).html(slaMax);
|
$(".sla_max", row).html(slaMax);
|
||||||
$(".sla_limit", row).html(slaLimit);
|
$(".sla_limit", row).html(slaLimit);
|
||||||
|
@ -1809,7 +1855,6 @@ function chooseType() {
|
||||||
$("#row_url").hide();
|
$("#row_url").hide();
|
||||||
$("#row_field_separator").hide();
|
$("#row_field_separator").hide();
|
||||||
$("#row_line_separator").hide();
|
$("#row_line_separator").hide();
|
||||||
$("#sla_list").hide();
|
|
||||||
$("#row_custom_example").hide();
|
$("#row_custom_example").hide();
|
||||||
$("#row_group").hide();
|
$("#row_group").hide();
|
||||||
$("#row_working_time").hide();
|
$("#row_working_time").hide();
|
||||||
|
@ -1839,6 +1884,16 @@ function chooseType() {
|
||||||
$("#row_netflow_filter").hide();
|
$("#row_netflow_filter").hide();
|
||||||
$("#row_max_values").hide();
|
$("#row_max_values").hide();
|
||||||
$("#row_resolution").hide();
|
$("#row_resolution").hide();
|
||||||
|
|
||||||
|
// SLA list default state
|
||||||
|
$("#sla_list").hide();
|
||||||
|
$(".sla_list_agent_col").show();
|
||||||
|
$(".sla_list_module_col").show();
|
||||||
|
$(".sla_list_service_col").hide();
|
||||||
|
$(".sla_list_sla_min_col").show();
|
||||||
|
$(".sla_list_sla_max_col").show();
|
||||||
|
$(".sla_list_sla_limit_col").show();
|
||||||
|
$(".sla_list_action_col").show();
|
||||||
|
|
||||||
//$('#agent_autocomplete').show();
|
//$('#agent_autocomplete').show();
|
||||||
$('#agent_autocomplete_events').show();
|
$('#agent_autocomplete_events').show();
|
||||||
|
@ -1910,6 +1965,14 @@ function chooseType() {
|
||||||
$("#row_only_display_wrong").show();
|
$("#row_only_display_wrong").show();
|
||||||
$("#row_working_time").show();
|
$("#row_working_time").show();
|
||||||
$("#row_sort").show();
|
$("#row_sort").show();
|
||||||
|
|
||||||
|
$(".sla_list_agent_col").hide();
|
||||||
|
$(".sla_list_module_col").hide();
|
||||||
|
$(".sla_list_service_col").show();
|
||||||
|
$(".sla_list_sla_min_col").hide();
|
||||||
|
$(".sla_list_sla_max_col").hide();
|
||||||
|
$(".sla_list_sla_limit_col").hide();
|
||||||
|
$("#sla_list").show();
|
||||||
break;
|
break;
|
||||||
case 'monitor_report':
|
case 'monitor_report':
|
||||||
$("#row_description").show();
|
$("#row_description").show();
|
||||||
|
|
|
@ -66,6 +66,11 @@ if ($add_sla) {
|
||||||
$sla_max = get_parameter('sla_max', 0);
|
$sla_max = get_parameter('sla_max', 0);
|
||||||
$sla_min = get_parameter('sla_min', 0);
|
$sla_min = get_parameter('sla_min', 0);
|
||||||
$server_id = (int)get_parameter('server_id', 0);
|
$server_id = (int)get_parameter('server_id', 0);
|
||||||
|
|
||||||
|
$id_service = (int) get_parameter("id_service");
|
||||||
|
if (empty($id_module) && !empty($id_service)) {
|
||||||
|
$id_module = $id_service;
|
||||||
|
}
|
||||||
|
|
||||||
$include_enterprise = enterprise_include("include/functions_metaconsole.php");
|
$include_enterprise = enterprise_include("include/functions_metaconsole.php");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue