2013-05-29 Miguel de Dios <miguel.dedios@artica.es>
* operation/events/events.build_table.php, operation/agentes/estado_generalagente.php, include/functions_events.php: fixed the views with huge large names for agents or and modules. Fixes: #2242 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8226 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
40faf8719e
commit
31e201e05b
|
@ -1,3 +1,12 @@
|
|||
2013-05-29 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* operation/events/events.build_table.php,
|
||||
operation/agentes/estado_generalagente.php,
|
||||
include/functions_events.php: fixed the views with huge large names
|
||||
for agents or and modules.
|
||||
|
||||
Fixes: #2242
|
||||
|
||||
2013-05-29 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/functions_snmp_browser.php: fixed PHP warning with to
|
||||
|
|
|
@ -785,7 +785,7 @@ function events_print_event_table ($filter = "", $limit = 10, $width = 440, $ret
|
|||
$agent_condition = '';
|
||||
}
|
||||
else {
|
||||
$agent_condition = "id_agente = $agent_id AND";
|
||||
$agent_condition = " id_agente = $agent_id AND ";
|
||||
}
|
||||
|
||||
if ($filter == '') {
|
||||
|
@ -795,17 +795,23 @@ function events_print_event_table ($filter = "", $limit = 10, $width = 440, $ret
|
|||
switch ($config["dbtype"]) {
|
||||
case "mysql":
|
||||
case "postgresql":
|
||||
$sql = sprintf ("SELECT * FROM tevento WHERE %s %s ORDER BY timestamp DESC LIMIT %d", $agent_condition, $filter, $limit);
|
||||
$sql = sprintf ("SELECT *
|
||||
FROM tevento
|
||||
WHERE %s %s
|
||||
ORDER BY timestamp DESC LIMIT %d", $agent_condition, $filter, $limit);
|
||||
break;
|
||||
case "oracle":
|
||||
$sql = sprintf ("SELECT * FROM tevento WHERE %s %s AND rownum <= %d ORDER BY timestamp DESC", $agent_condition, $filter, $limit);
|
||||
$sql = sprintf ("SELECT *
|
||||
FROM tevento
|
||||
WHERE %s %s AND rownum <= %d
|
||||
ORDER BY timestamp DESC", $agent_condition, $filter, $limit);
|
||||
break;
|
||||
}
|
||||
|
||||
$result = db_get_all_rows_sql ($sql);
|
||||
|
||||
if ($result === false) {
|
||||
echo '<div class="nf">'.__('No events').'</div>';
|
||||
echo '<div class="nf">' . __('No events') . '</div>';
|
||||
}
|
||||
else {
|
||||
$table->id = 'latest_events_table';
|
||||
|
@ -823,7 +829,10 @@ function events_print_event_table ($filter = "", $limit = 10, $width = 440, $ret
|
|||
$table->data = array ();
|
||||
$table->align = array ();
|
||||
$table->style[0] = $table->style[1] = $table->style[2] = 'width:25px; background: #E8E8E8;';
|
||||
$table->style[4] = 'width:120px';
|
||||
if ($agent_id == 0) {
|
||||
$table->style[3] = 'width:120px; word-break: break-all;';
|
||||
}
|
||||
$table->style[4] = 'width:120px; word-break: break-all;';
|
||||
|
||||
$table->head[0] = "<span title='" . __('Validated') . "'>" . __('V.') . "</span>";
|
||||
$table->align[0] = 'center';
|
||||
|
@ -837,7 +846,7 @@ function events_print_event_table ($filter = "", $limit = 10, $width = 440, $ret
|
|||
|
||||
$table->head[3] = __('Event name');
|
||||
|
||||
if($agent_id == 0) {
|
||||
if ($agent_id == 0) {
|
||||
$table->head[4] = __('Agent name');
|
||||
}
|
||||
|
||||
|
|
|
@ -68,18 +68,23 @@ if ($agent['disabled']) {
|
|||
$agent_name = "<em>" . $agent_name . "</em>" . ui_print_help_tip(__('Disabled'), true);
|
||||
}
|
||||
else if ($agent['quiet']) {
|
||||
$agent_name = "<em>" . $agent_name . " " . html_print_image("images/dot_green.disabled.png", true, array("border" => '0', "title" => __('Quiet'), "alt" => "")) . "</em>";
|
||||
$agent_name = "<em'>" . $agent_name . " " . html_print_image("images/dot_green.disabled.png", true, array("border" => '0', "title" => __('Quiet'), "alt" => "")) . "</em>";
|
||||
}
|
||||
else {
|
||||
$agent_name = $agent_name;
|
||||
}
|
||||
|
||||
$data[0] = ui_print_group_icon ($agent["id_grupo"], true);
|
||||
$table_agent->cellstyle[count($table_agent->data)][0] = 'width: 16px; text-align:center; padding: 0px; vertical-align: top;';
|
||||
$table_agent->cellstyle[count($table_agent->data)][0] =
|
||||
'width: 16px; text-align:center; padding: 0px;';
|
||||
|
||||
$data[2] = $agent_name;
|
||||
$table_agent->colspan[count($table_agent->data)][2] = 3;
|
||||
|
||||
$table_agent->cellstyle[count($table_agent->data)][2] =
|
||||
'width: 100px; word-break: break-all;';
|
||||
|
||||
|
||||
$status_img = agents_detail_view_status_img ($agent["critical_count"],
|
||||
$agent["warning_count"], $agent["unknown_count"], $agent["total_count"],
|
||||
$agent["notinit_count"]);
|
||||
|
@ -104,7 +109,8 @@ $table_agent->cellstyle[count($table_agent->data)][0] = 'width: 150px; text-alig
|
|||
|
||||
|
||||
$data[2] = ui_print_os_icon ($agent["id_os"], false, true, true, false, false, false, array('title' => __('OS') . ': ' . get_os_name ($agent["id_os"])));
|
||||
$table_agent->cellstyle[count($table_agent->data)][2] = 'width: 16px; text-align:center; padding: 0px; vertical-align: top;';
|
||||
$table_agent->cellstyle[count($table_agent->data)][2] =
|
||||
'width: 16px; text-align: right; padding: 0px; vertical-align: top;';
|
||||
$data[3] = empty($agent["os_version"]) ? get_os_name ((int) $agent["id_os"]) : $agent["os_version"];
|
||||
$table_agent->colspan[count($table_agent->data)][3] = 2;
|
||||
|
||||
|
@ -119,10 +125,11 @@ foreach ($addresses as $k => $add) {
|
|||
}
|
||||
}
|
||||
|
||||
if(!empty($address)) {
|
||||
if (!empty($address)) {
|
||||
$data = array();
|
||||
$data[2] = html_print_image('images/world.png', true, array('title' => __('IP address')));
|
||||
$table_agent->cellstyle[count($table_agent->data)][2] = 'width: 16px; text-align:center; padding: 0px; vertical-align: top;';
|
||||
$table_agent->cellstyle[count($table_agent->data)][2] =
|
||||
'width: 16px; text-align: right; padding: 0px; vertical-align: top;';
|
||||
$data[3] = '<span style="vertical-align:top; display: inline-block;">';
|
||||
$data[3] .= empty($address) ? '<em>' . __('N/A') . '</em>' : $address;
|
||||
$data[3] .= '</span>';
|
||||
|
@ -133,7 +140,8 @@ if(!empty($address)) {
|
|||
|
||||
$data = array();
|
||||
$data[2] = html_print_image('images/version.png', true, array('title' => __('Agent Version')));
|
||||
$table_agent->cellstyle[count($table_agent->data)][2] = 'width: 16px; text-align:center; padding: 0px; vertical-align: top;';
|
||||
$table_agent->cellstyle[count($table_agent->data)][2] =
|
||||
'width: 16px; text-align: right; padding: 0px; vertical-align: top;';
|
||||
$data[3] = '<span style="vertical-align:top; display: inline-block;">';
|
||||
$data[3] .= empty($agent["agent_version"]) ? '<i>' . __('N/A') . '</i>' : $agent["agent_version"];
|
||||
$data[3] .= '</span>';
|
||||
|
@ -143,7 +151,8 @@ $table_agent->rowclass[] = '';
|
|||
|
||||
$data = array();
|
||||
$data[2] = html_print_image('images/default_list.png', true, array('title' => __('Description')));
|
||||
$table_agent->cellstyle[count($table_agent->data)][2] = 'width: 16px; text-align:center; padding: 0px; vertical-align: top;';
|
||||
$table_agent->cellstyle[count($table_agent->data)][2] =
|
||||
'width: 16px; text-align: right; padding: 0px; vertical-align: top;';
|
||||
$data[3] = '<span style="vertical-align:top; display: inline-block;">';
|
||||
$data[3] .= empty($agent["comentarios"]) ? '<em>' . __('N/A') . '</em>' : $agent["comentarios"];
|
||||
$data[3] .= '</span>';
|
||||
|
|
|
@ -55,11 +55,13 @@ if (in_array('id_evento', $show_fields)) {
|
|||
if (in_array('evento', $show_fields)) {
|
||||
$table->head[$i] = __('Event Name');
|
||||
$table->align[$i] = 'left';
|
||||
$table->style[$i] = 'max-width: 350px; word-break: break-all;';
|
||||
$i++;
|
||||
}
|
||||
if (in_array('id_agente', $show_fields)) {
|
||||
$table->head[$i] = __('Agent name');
|
||||
$table->align[$i] = 'center';
|
||||
$table->style[$i] = 'max-width: 350px; word-break: break-all;';
|
||||
$i++;
|
||||
}
|
||||
if (in_array('timestamp', $show_fields)) {
|
||||
|
|
Loading…
Reference in New Issue