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'); $get_event_name = (bool) get_parameter ('get_event_name');
$meta = get_parameter ('meta', 0); $meta = get_parameter ('meta', 0);
$history = get_parameter ('history', 0); $history = get_parameter ('history', 0);
$table_events = get_parameter('table_events', 0);
if ($get_event_name) { if ($get_event_name) {
$event_id = get_parameter ('event_id'); $event_id = get_parameter ('event_id');
@ -494,4 +495,20 @@ if ($get_events_details) {
echo $out; 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... // Depend the type of object, the stats will refer agents, modules...
switch ($type) { 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': case 'agent':
$template_title['total_count'] = __('%d Total modules'); $template_title['total_count'] = __('%d Total modules');
$template_title['normal_count'] = __('%d Normal modules'); $template_title['normal_count'] = __('%d Normal modules');
@ -7807,10 +7814,12 @@ function reporting_tiny_stats ($counts_info, $return = false, $type = 'agent', $
'title' => sprintf($template_title['not_init_count'], $not_init_count)); 'title' => sprintf($template_title['not_init_count'], $not_init_count));
} }
if (isset($template_title['fired_count'])) {
if (isset($counts_info['fired_count'])) { if (isset($counts_info['fired_count'])) {
$fired_count = $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)); $stats[] = array('name' => 'fired_count', 'count' => $fired_count, 'title' => sprintf($template_title['fired_count'], $fired_count));
} }
}
$uniq_id = uniqid(); $uniq_id = uniqid();

View File

@ -69,7 +69,8 @@ $table_agent->styleTable = 'padding:0px;';
$table_agent->data = array(); $table_agent->data = array();
$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']) { if ($agent['disabled']) {
$agent_name = "<em>" . $agent_name . "</em>" . ui_print_help_tip(__('Disabled'), true); $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>'; $data[0] = '<b>' . __('Next contact') . '</b>';
$progress = agents_get_next_contact($id_agente); $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) { if ($progress > 100) {
$data[1] .= clippy_context_help("agent_out_of_limits"); $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;'>"; echo "<h4 style='padding-top:0px !important;'>";
ui_print_help_tip(__('For to view the list modules paginated, set in setup visuals.')); 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); $modules_not_init = agents_monitor_notinit($id_agente);
if (!empty($modules_not_init)) { if (!empty($modules_not_init)) {
echo clippy_context_help("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 // Load global vars
check_login(); check_login();
if (!isset($id_agente)){ if (!isset($id_agente)) {
require ("general/noaccess.php"); require ("general/noaccess.php");
exit; exit;
} }
require_once ("include/functions_events.php"); require_once ("include/functions_events.php");
echo "<h4 style='margin-top:0px !important;'>".__('Latest events for this agent')."</h4>"; ui_toggle(
"<div id='event_list'>" .
// Fix: for tag functionality groups have to be all user_groups (propagate ACL funct!) html_print_image('images/spinner.gif', true) .
$groups = users_get_groups($config["id_user"]); "</div>",
__('Latest events for this agent'),
$tags_condition = tags_get_acl_tags($config['id_user'], array_keys($groups), 'ER', 'event_condition', 'AND'); __('Latest events for this agent'),
false);
events_print_event_table ("estado <> 1 $tags_condition", 10, '100%', false, $id_agente);
?> ?>
<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>