2013-11-22 Sergio Martin <sergio.martin@artica.es>

* mobile/operation/events.php
	mobile/include/style/main.css
	mobile/include/ui.class.php: Improve events view
	of mobile console



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9115 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2013-11-22 13:24:28 +00:00
parent 858a46936b
commit 7ffc15ddb6
4 changed files with 91 additions and 40 deletions

View File

@ -1,3 +1,10 @@
2013-11-22 Sergio Martin <sergio.martin@artica.es>
* mobile/operation/events.php
mobile/include/style/main.css
mobile/include/ui.class.php: Improve events view
of mobile console
2013-11-22 Miguel de Dios <miguel.dedios@artica.es> 2013-11-22 Miguel de Dios <miguel.dedios@artica.es>
* operation/gis_maps/ajax.php: fixed the get size of icons for * operation/gis_maps/ajax.php: fixed the get size of icons for

View File

@ -414,10 +414,6 @@ table#list_events th {
} }
*/ */
#list_events a {
color: #333333 !important;
}
@media screen and (max-width: 35em) { @media screen and (max-width: 35em) {
/* Hide the title of event name */ /* Hide the title of event name */
#list_events tbody tr.events td.cell_0 b.ui-table-cell-label { #list_events tbody tr.events td.cell_0 b.ui-table-cell-label {
@ -445,10 +441,6 @@ table#list_events th {
font-weight: bold; font-weight: bold;
} }
.cell_0 a {
color: #000000 !important;
}
@media screen and (max-width: 25em) { @media screen and (max-width: 25em) {
#list_agents .cell_2 .ui-table-cell-label, #list_agents .cell_2 .ui-table-cell-label,
#list_agents .cell_3 .ui-table-cell-label, #list_agents .cell_3 .ui-table-cell-label,
@ -697,7 +689,8 @@ li.ui-btn {
@media screen and (max-width: 25em) { @media screen and (max-width: 25em) {
.ui-table th, .ui-table td { .ui-table th, .ui-table td {
padding: 0px !important; padding: 3px !important;
padding-left: 3px;
} }
} }
/*END----------Fix the tons of air between the rows in small table----*/ /*END----------Fix the tons of air between the rows in small table----*/
@ -722,4 +715,21 @@ li.ui-btn {
.ui-loading .ui-loader-background { .ui-loading .ui-loader-background {
display:block !important; display:block !important;
} }
/*END----------Fix to avoid clicks under loading message--------------*/ /*END----------Fix to avoid clicks under loading message--------------*/
.button_layer {
position: relative;
float: right;
padding-right: 60px;
height: 30px;
}
.ui-icon-big {
width: 28px !important;
height: 28px !important;
}
.ui-icon-arrow-r-big {
background-position: -103px 4px !important;
}

View File

@ -773,6 +773,25 @@ class Table {
} }
} }
public function importFromHashEvents($data) {
foreach ($data as $id => $row) {
$table_row = array();
foreach ($row as $key => $value) {
if (!in_array($key, $this->head)) {
//$this->head[] = $key;
}
//$cell_key = array_search($key, $this->head);
//$table_row[$cell_key] = $value;
$table_row[$key] = $value;
}
$this->rows[$id] = $table_row;
}
}
public function setClass($class = '') { public function setClass($class = '') {
$this->class_table = $class; $this->class_table = $class;
} }
@ -833,7 +852,7 @@ class Table {
$html .= "<th class='head_vertical'>" . $key . "</th>\n"; $html .= "<th class='head_vertical'>" . $key . "</th>\n";
} }
else { else {
$html .= "<th class='head_vertical'></th>\n"; $html .= "<th class='head_vertical' style='font-size: 0px'></th>\n";
} }
foreach ($row as $key_cell => $cell) { foreach ($row as $key_cell => $cell) {
$html .= "<td class='cell_" . $key_cell . "'>" . $cell . "</td>\n"; $html .= "<td class='cell_" . $key_cell . "'>" . $cell . "</td>\n";

View File

@ -70,7 +70,7 @@ class Events {
$events = array(); $events = array();
$end = 1; $end = 1;
foreach ($events_db as $event) { foreach ($events_db as $event) {
$end = 0; $end = 0;
$row = array(); $row = array();
$row[] = ' $row[] = '
@ -111,6 +111,7 @@ class Events {
$row[] = '<b class="ui-table-cell-label">' . __('Agent') . '</b>' . $row[] = '<b class="ui-table-cell-label">' . __('Agent') . '</b>' .
$agent_name; $agent_name;
/*
$status = $status =
html_print_image ("mobile/images/" . html_print_image ("mobile/images/" .
get_priority_class($event['criticity']) . ".png", true); get_priority_class($event['criticity']) . ".png", true);
@ -133,7 +134,16 @@ class Events {
$row[] = '<b class="ui-table-cell-label">' . __('Status') . '</b>' . $row[] = '<b class="ui-table-cell-label">' . __('Status') . '</b>' .
$status; $status;
*/
if (!$this->readOnly) {
$row[] = '<a href="javascript: openDetails(' . $event['id_evento'] . ')">' .
'<span style="position: relative; float: right; margin-right: 30px;">
<span class="ui-icon ui-icon-big ui-icon-arrow-r ui-icon-arrow-r-big ui-icon-shadow" style="position: absolute; left: 50%;">&nbsp;</span>
</span>' .
'</a>';
}
$row[] = get_priority_class ($event["criticity"]);
$events[$event['id_evento']] = $row; $events[$event['id_evento']] = $row;
} }
@ -736,11 +746,12 @@ class Events {
$field_event_name = __('Event Name'); $field_event_name = __('Event Name');
$field_timestamp = __('Timestamp'); $field_timestamp = __('Timestamp');
$field_agent = __('Agent'); $field_agent = __('Agent');
$field_status = __('Status');
$row_class = array(); $row_class = array();
foreach ($events_db as $event) { foreach ($events_db as $event) {
$row_class[$event['id_evento']] = "events"; $myclass = get_priority_class ($event["criticity"]);
// . get_priority_class($event['criticity']);
$row_class[$event['id_evento']] = "events $myclass";
$row = array(); $row = array();
if ($this->readOnly) { if ($this->readOnly) {
@ -774,26 +785,15 @@ class Events {
(string) agents_get_name($event["id_agente"]) . '</a>'; (string) agents_get_name($event["id_agente"]) . '</a>';
} }
$row[$field_status] =
html_print_image ("mobile/images/" . if (!$this->readOnly) {
get_priority_class($event['criticity']) . ".png", true); $row[' '] = '<a href="javascript: openDetails(' . $event['id_evento'] . ')">' .
$row[$field_status] .= "&nbsp;"; '<span class="button_layer">
if ($event['estado'] == 1) { <span class="ui-icon ui-icon-big ui-icon-arrow-r ui-icon-arrow-r-big ui-icon-shadow" style="position: absolute; left: 50%;">&nbsp;</span>
$img_st = "images/tick.png"; </span>' .
$title_st = __('Event validated'); '</a>';
$row_class[' '] = "button_row";
$row[$field_status] .= html_print_image ($img_st, true,
array ("class" => "image_status",
"width" => 16,
"height" => 16,
"title" => $title_st,
"id" => 'status_img_' . $event["id_evento"]));
} }
else {
$row[$field_status] .= '';
}
$events[$event['id_evento']] = $row; $events[$event['id_evento']] = $row;
} }
@ -812,6 +812,7 @@ class Events {
$table->id = 'list_events'; $table->id = 'list_events';
$table->setRowClass($row_class); $table->setRowClass($row_class);
$table->importFromHash($events); $table->importFromHash($events);
if (!$return) { if (!$return) {
$ui->contentAddHtml($table->getHTML()); $ui->contentAddHtml($table->getHTML());
@ -981,14 +982,14 @@ class Events {
else { else {
$.each(data.events, function(key, event) { $.each(data.events, function(key, event) {
$(\"table#list_events tbody\").append( $(\"table#list_events tbody\").append(
\"<tr class='events'>\" + \"<tr class='events \" + event[4] + \"'>\" +
\"<th class='head_vertical'></th>\" + \"<th class='head_vertical'></th>\" +
\"<td class='cell_0'>\" + \"<td class='cell_0'>\" +
event[0] + event[0] +
\"</td>\" + \"</td>\" +
\"<td>\" + event[1] + \"</td>\" + \"<td>\" + event[1] + \"</td>\" +
\"<td>\" + event[2] + \"</td>\" + \"<td>\" + event[2] + \"</td>\" +
\"<td>\" + event[3] + \"</td>\" + \"<td class='button_row'>\" + event[3] + \"</td>\" +
\"</tr>\"); \"</tr>\");
}); });
@ -1057,11 +1058,17 @@ class Events {
} }
else { else {
$filters_to_serialize = array(); $filters_to_serialize = array();
if($this->severity == -1) {
$severity = __('All');
}
else {
$severity = get_priorities($this->severity);
}
if (!$this->default_filters['severity']) { if (!$this->default_filters['severity']) {
$filters_to_serialize[] = sprintf(__("Severity: %s"), $filters_to_serialize[] = sprintf(__("Severity: %s"),
get_priorities($this->severity)); $severity);
} }
if (!$this->default_filters['group']) { if (!$this->default_filters['group']) {
$groups = users_get_groups_for_select( $groups = users_get_groups_for_select(
@ -1070,9 +1077,17 @@ class Events {
$filters_to_serialize[] = sprintf(__("Group: %s"), $filters_to_serialize[] = sprintf(__("Group: %s"),
$groups[$this->group]); $groups[$this->group]);
} }
if($this->type == 'all') {
$type = __('All');
}
else {
$type = get_event_types($this->type);
}
if (!$this->default_filters['type']) { if (!$this->default_filters['type']) {
$filters_to_serialize[] = sprintf(__("Type: %s"), $filters_to_serialize[] = sprintf(__("Type: %s"),
get_event_types($this->type)); $type);
} }
if (!$this->default_filters['status']) { if (!$this->default_filters['status']) {
$filters_to_serialize[] = sprintf(__("Status: %s"), $filters_to_serialize[] = sprintf(__("Status: %s"),