Working in the improves of agent view. Ticket: #1285

This commit is contained in:
mdtrooper 2014-12-03 11:52:09 +01:00
parent 4b159e1c12
commit ecb1811434
5 changed files with 64 additions and 16 deletions

View File

@ -36,6 +36,7 @@ $get_response_description = (bool) get_parameter ('get_response_description');
$get_event_name = (bool) get_parameter ('get_event_name');
$meta = get_parameter ('meta', 0);
$history = get_parameter ('history', 0);
$table_events = get_parameter('table_events', 0);
if ($get_event_name) {
$event_id = get_parameter ('event_id');
@ -297,7 +298,7 @@ if ($get_extended_event) {
$tabs .= "<li><a href='#extended_event_details_page' id='link_details'>".html_print_image('images/zoom.png',true).__('Details')."</a></li>";
$tabs .= "<li><a href='#extended_event_custom_fields_page' id='link_custom_fields'>".html_print_image('images/custom_field_col.png',true).__('Agent fields')."</a></li>";
$tabs .= "<li><a href='#extended_event_comments_page' id='link_comments'>".html_print_image('images/pencil.png',true).__('Comments')."</a></li>";
if (!$readonly &&
(tags_checks_event_acl($config["id_user"], $event["id_grupo"], "EM", $event['clean_tags'], $childrens_ids)) || (tags_checks_event_acl($config["id_user"], $event["id_grupo"], "EW", $event['clean_tags'],$childrens_ids))) {
$tabs .= "<li><a href='#extended_event_responses_page' id='link_responses'>".html_print_image('images/event_responses_col.png',true).__('Responses')."</a></li>";
@ -494,4 +495,20 @@ if ($get_events_details) {
echo $out;
}
if ($table_events) {
require_once ("include/functions_events.php");
require_once ("include/functions_graph.php");
$id_agente = (int)get_parameter('id_agente', 0);
// Fix: for tag functionality groups have to be all user_groups (propagate ACL funct!)
$groups = users_get_groups($config["id_user"]);
$tags_condition = tags_get_acl_tags($config['id_user'],
array_keys($groups), 'ER', 'event_condition', 'AND');
events_print_event_table ("estado <> 1 $tags_condition", 10, '100%',
false, $id_agente);
}
?>

View File

@ -7752,6 +7752,13 @@ function reporting_tiny_stats ($counts_info, $return = false, $type = 'agent', $
// Depend the type of object, the stats will refer agents, modules...
switch ($type) {
case 'modules':
$template_title['total_count'] = __('%d Total modules');
$template_title['normal_count'] = __('%d Normal modules');
$template_title['critical_count'] = __('%d Critical modules');
$template_title['warning_count'] = __('%d Warning modules');
$template_title['unknown_count'] = __('%d Unknown modules');
break;
case 'agent':
$template_title['total_count'] = __('%d Total modules');
$template_title['normal_count'] = __('%d Normal modules');
@ -7807,9 +7814,11 @@ function reporting_tiny_stats ($counts_info, $return = false, $type = 'agent', $
'title' => sprintf($template_title['not_init_count'], $not_init_count));
}
if (isset($counts_info['fired_count'])) {
$fired_count = $counts_info['fired_count'];
$stats[] = array('name' => 'fired_count', 'count' => $fired_count, 'title' => sprintf($template_title['fired_count'], $fired_count));
if (isset($template_title['fired_count'])) {
if (isset($counts_info['fired_count'])) {
$fired_count = $counts_info['fired_count'];
$stats[] = array('name' => 'fired_count', 'count' => $fired_count, 'title' => sprintf($template_title['fired_count'], $fired_count));
}
}
$uniq_id = uniqid();

View File

@ -69,7 +69,8 @@ $table_agent->styleTable = 'padding:0px;';
$table_agent->data = array();
$data = array();
$agent_name = ui_print_agent_name ($agent["id_agente"], true, 500, "font-size: medium;", true);
$agent_name = ui_print_agent_name ($agent["id_agente"], true, 500,
"font-size: medium;", true);
if ($agent['disabled']) {
$agent_name = "<em>" . $agent_name . "</em>" . ui_print_help_tip(__('Disabled'), true);
@ -209,7 +210,7 @@ $table_contact->data[] = $data;
$data[0] = '<b>' . __('Next contact') . '</b>';
$progress = agents_get_next_contact($id_agente);
$data[1] = progress_bar($progress, 200, 20);
$data[1] = progress_bar($progress, 200, 20, '', 1, false, "#666666");
if ($progress > 100) {
$data[1] .= clippy_context_help("agent_out_of_limits");

2
pandora_console/operation/agentes/estado_monitores.php Normal file → Executable file
View File

@ -724,7 +724,7 @@ foreach ($modules as $module) {
echo "<h4 style='padding-top:0px !important;'>";
ui_print_help_tip(__('For to view the list modules paginated, set in setup visuals.'));
echo __('Full list of monitors');
echo __('Full list of monitors') . '&nbsp;' . reporting_tiny_stats ($agent, true, 'modules');
$modules_not_init = agents_monitor_notinit($id_agente);
if (!empty($modules_not_init)) {
echo clippy_context_help("modules_not_init");

39
pandora_console/operation/agentes/status_events.php Normal file → Executable file
View File

@ -17,20 +17,41 @@
// Load global vars
check_login();
if (!isset($id_agente)){
if (!isset($id_agente)) {
require ("general/noaccess.php");
exit;
}
require_once ("include/functions_events.php");
echo "<h4 style='margin-top:0px !important;'>".__('Latest events for this agent')."</h4>";
// Fix: for tag functionality groups have to be all user_groups (propagate ACL funct!)
$groups = users_get_groups($config["id_user"]);
$tags_condition = tags_get_acl_tags($config['id_user'], array_keys($groups), 'ER', 'event_condition', 'AND');
events_print_event_table ("estado <> 1 $tags_condition", 10, '100%', false, $id_agente);
ui_toggle(
"<div id='event_list'>" .
html_print_image('images/spinner.gif', true) .
"</div>",
__('Latest events for this agent'),
__('Latest events for this agent'),
false);
?>
<script type="text/javascript">
$(document).ready(function() {
var parameters = {};
parameters["table_events"] = 1;
parameters["id_agente"] = <?php echo $id_agente; ?>;
parameters["page"] = "include/ajax/events";
jQuery.ajax ({
data: parameters,
type: 'POST',
url: "ajax.php",
timeout: 10000,
dataType: 'html',
async: false,
success: function (data) {
$("#event_list").empty();
$("#event_list").html(data);
}
});
});
</script>