From fd58e941e68bfb5c5446bc5340283da7e1566f50 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Tue, 2 Apr 2013 16:15:59 +0000 Subject: [PATCH] 2013-04-02 Miguel de Dios * mobile/operation/agents.php, mobile/include/style/main.css: improved the view of list of agents. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7913 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 ++ pandora_console/mobile/include/style/main.css | 23 +++++++++ pandora_console/mobile/operation/agents.php | 51 ++++++++++++++----- 3 files changed, 65 insertions(+), 14 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 9af6ce2b78..f5ff6f2508 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2013-04-02 Miguel de Dios + + * mobile/operation/agents.php, mobile/include/style/main.css: + improved the view of list of agents. + 2013-04-02 Miguel de Dios * mobile/operation/groups.php, mobile/include/style/main.css, diff --git a/pandora_console/mobile/include/style/main.css b/pandora_console/mobile/include/style/main.css index 4a08a4fa7c..4da90de3cf 100644 --- a/pandora_console/mobile/include/style/main.css +++ b/pandora_console/mobile/include/style/main.css @@ -405,6 +405,29 @@ table#list_events th { color: #808080; font-weight: bold; } + +@media screen and (max-width: 35em) { + #list_agents .cell_2 .ui-table-cell-label, + #list_agents .cell_3 .ui-table-cell-label, + #list_agents .cell_6 .ui-table-cell-label, + #list_agents .cell_7 .ui-table-cell-label { + min-width: auto !important; + } + + #list_agents .cell_3 .ui-table-cell-label, + #list_agents .cell_6 .ui-table-cell-label, + #list_agents .cell_7 .ui-table-cell-label { + padding-left: 10px; + } + + #list_agents .cell_2, + #list_agents .cell_3, + #list_agents .cell_6, + #list_agents .cell_7 { + display: inline !important; + float: none !important; + } +} /*END-----------Agents styles-----------------------------------------*/ diff --git a/pandora_console/mobile/operation/agents.php b/pandora_console/mobile/operation/agents.php index 2b83222619..68d9d68199 100644 --- a/pandora_console/mobile/operation/agents.php +++ b/pandora_console/mobile/operation/agents.php @@ -61,7 +61,30 @@ class Agents { if (!empty($listAgents['agents'])) { $end = 0; - $agents = $listAgents['agents']; + + $agents = array(); + foreach ($listAgents['agents'] as $key => $agent) { + $agent[0] = '' . + __('Agent') . '' . $agent[0]; + $agent[1] = '' . + __('Description') . '' . $agent[1]; + $agent[2] = '' . + __('OS') . '' . $agent[2]; + $agent[3] = '' . + __('Group') . '' . $agent[3]; + $agent[4] = '' . + __('Interval') . '' . $agent[4]; + $agent[5] = '' . + __('Modules') . '' . $agent[5]; + $agent[6] = '' . + __('Status') . '' . $agent[6]; + $agent[7] = '' . + __('Alerts') . '' . $agent[7]; + $agent[8] = '' . + __('Last contact') . '' . $agent[8]; + } + + $agents[$key] = $agent; } echo json_encode(array('end' => $end, 'agents' => $agents)); @@ -232,8 +255,8 @@ class Agents { $row[0] = $row[__('Agent')] = io_safe_output($agent['nombre']); $row[1] = $row[__('Description')] = ui_print_truncate_text($agent["description"], 'description', false, true); $row[2] = $row[__('OS')] = ui_print_os_icon ($agent["id_os"], false, true); - $row[3] = $row[__('Interval')] = human_time_description_raw($agent["intervalo"]); - $row[4] = $row[__('Group')] = ui_print_group_icon ($agent["id_grupo"], true); + $row[3] = $row[__('Group')] = ui_print_group_icon ($agent["id_grupo"], true); + $row[4] = $row[__('Interval')] = human_time_description_raw($agent["intervalo"]); $row[5] = $row[__('Modules')] = reporting_tiny_stats($agent, true); $row[6] = $row[__('Status')] = agents_tree_view_status_img ($agent["critical_count"], $agent["warning_count"], $agent["unknown_count"]); @@ -327,17 +350,17 @@ class Agents { else { $.each(data.agents, function(key, agent) { $(\"table#list_agents tbody\") - .append(\"\" + - \"\" + - \"\" + agent[0] + \"\" + - \"\" + agent[1] + \"\" + - \"\" + agent[2] + \"\" + - \"\" + agent[3] + \"\" + - \"\" + agent[4] + \"\" + - \"\" + agent[5] + \"\" + - \"\" + agent[6] + \"\" + - \"\" + agent[7] + \"\" + - \"\" + agent[8] + \"\" + + .append(\"\" + + \"\" + + \"\" + agent[0] + \"\" + + \"\" + agent[1] + \"\" + + \"\" + agent[2] + \"\" + + \"\" + agent[3] + \"\" + + \"\" + agent[4] + \"\" + + \"\" + agent[5] + \"\" + + \"\" + agent[6] + \"\" + + \"\" + agent[7] + \"\" + + \"\" + agent[8] + \"\" + \"\"); });