2013-12-13 Sergio Martin <sergio.martin@artica.es>

* mobile/operation/events.php, mobile/operation/modules.php,
	mobile/operation/agents.php: fixed the scroll of list for old
	browser in android mobiles devices.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9223 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-12-13 11:50:20 +00:00
parent 6a0212c5d4
commit 182b594c1c
4 changed files with 93 additions and 60 deletions

View File

@ -1,3 +1,9 @@
2013-12-13 Sergio Martin <sergio.martin@artica.es>
* mobile/operation/events.php, mobile/operation/modules.php,
mobile/operation/agents.php: fixed the scroll of list for old
browser in android mobiles devices.
2013-12-13 Sergio Martin <sergio.martin@artica.es>
* include/graphs/flot/pandora.flot.js: Fixed wrong

View File

@ -354,9 +354,9 @@ class Agents {
$ui->contentAddHtml("<script type=\"text/javascript\">
var load_more_rows = 1;
var page = 1;
$(document).ready(function() {
$(window).bind(\"scroll\", function () {
function custom_scroll() {
if (load_more_rows) {
if ($(this).scrollTop() + $(this).height()
>= ($(document).height() - 100)) {
@ -404,6 +404,15 @@ class Agents {
\"json\");
}
}
}
$(document).ready(function() {
$(window).bind(\"scroll\", function () {
custom_scroll();
});
$(window).on(\"touchmove\", function(event) {
custom_scroll();
});
});
</script>");

View File

@ -70,7 +70,7 @@ class Events {
$events = array();
$end = 1;
foreach ($events_db as $event) {
foreach ($events_db as $event) {
$end = 0;
switch ($event['estado']) {
@ -88,27 +88,27 @@ class Events {
if($event['criticity'] == EVENT_CRIT_WARNING) {
$img_st = str_replace("white.png", "dark.png", $img_st);
}
$status_icon = html_print_image($img_st, true);
$open_link = '';
$close_link = '';
if (!$this->readOnly) {
if (!$this->readOnly) {
$open_link = '<a href="javascript: openDetails(' . $event['id_evento'] . ')"><div style="height:100%;width:100%">';
$close_link = '</div></a>';
$close_link = '</div></a>';
}
$row = array();
$row[] = $open_link . '<b class="ui-table-cell-label">' . __('Event Name') . '</b>' . io_safe_output($event['evento']) . $close_link;
if ($event["id_agente"] == 0) {
$agent_name = __('System');
}
else {
$agent_name = '<span class="nobold">' . ui_print_agent_name ($event["id_agente"], true, 'agent_small', '', false, '', '', false, false) . '</span>';
}
$row_1 = $open_link;
$row_1 .= '<span class="events_agent"><b class="ui-table-cell-label">' . __('Agent') . '</b>' . $agent_name . '</span>';
$row_1 .= '<span class="events_timestamp">' . $status_icon . '<br>' . ui_print_timestamp ($event['timestamp_rep'], true) . '</span>';
@ -912,7 +912,7 @@ class Events {
function ajax_load_rows() {
if (load_more_rows) {
load_more_rows = 0;
postvars = {};
@ -933,7 +933,7 @@ class Events {
postvars,
function (data) {
add_rows(data);
//For large screens load the new events
if (document.documentElement.scrollHeight == document.documentElement.clientHeight) {
ajax_load_rows();
@ -944,14 +944,24 @@ class Events {
}
$(document).ready(function() {
ajax_load_rows();
$(window).bind(\"scroll\", function () {
if ($(this).scrollTop() + $(this).height()
custom_scroll();
});
$(window).on(\"touchmove\", function(event) {
custom_scroll();
});
});
function custom_scroll() {
if ($(this).scrollTop() + $(this).height()
>= ($(document).height() - 100)) {
ajax_load_rows();
}
});
});
}
</script>");
}

View File

@ -593,54 +593,62 @@ class Modules {
$ui->contentAddHtml("<script type=\"text/javascript\">
var load_more_rows = 1;
var page = 1;
function custom_scroll() {
if (load_more_rows) {
if ($(this).scrollTop() + $(this).height()
>= ($(document).height() - 100)) {
load_more_rows = 0;
postvars = {};
postvars[\"action\"] = \"ajax\";
postvars[\"parameter1\"] = \"modules\";
postvars[\"parameter2\"] = \"get_modules\";
postvars[\"group\"] = $(\"select[name='group']\").val();
postvars[\"status\"] = $(\"select[name='status']\").val();
postvars[\"type\"] = $(\"select[name='module_group']\").val();
postvars[\"tag\"] = $(\"select[name='tag']\").val();
postvars[\"free_search\"] = $(\"input[name='free_search']\").val();
postvars[\"page\"] = page;
page++;
$.post(\"index.php\",
postvars,
function (data) {
if (data.end) {
$(\"#loading_rows\").hide();
}
else {
$.each(data.modules, function(key, module) {
$(\"table#list_Modules tbody\").append(\"<tr>\" +
\"<th class='head_vertical'></th>\" +
\"<td class='cell_1'><b class='ui-table-cell-label'>" . __('Module name') . "</b>\" + module[0] + \"</td>\" +
\"<td class='cell_0'><b class='ui-table-cell-label'>" . __('Agent name') . "</b>\" + module[2] + \"</td>\" +
\"<td class='cell_2'><b class='ui-table-cell-label'>" . __('Status') . "</b>\" + module[5] + \"</td>\" +
\"<td class='cell_3'><b class='ui-table-cell-label'>" . __('Interval') . "</b>\" + module[4] + \"</td>\" +
\"<td class='cell_4'><b class='ui-table-cell-label'>" . __('Timestamp') . "</b>\" + module[6] + \"</td>\" +
\"<td class='cell_5'><b class='ui-table-cell-label'>" . __('Data') . "</b>\" + module[7] + \"</td>\" +
\"</tr>\");
});
load_more_rows = 1;
}
},
\"json\");
}
}
}
$(document).ready(function() {
$(window).bind(\"scroll\", function () {
if (load_more_rows) {
if ($(this).scrollTop() + $(this).height()
>= ($(document).height() - 100)) {
load_more_rows = 0;
postvars = {};
postvars[\"action\"] = \"ajax\";
postvars[\"parameter1\"] = \"modules\";
postvars[\"parameter2\"] = \"get_modules\";
postvars[\"group\"] = $(\"select[name='group']\").val();
postvars[\"status\"] = $(\"select[name='status']\").val();
postvars[\"type\"] = $(\"select[name='module_group']\").val();
postvars[\"tag\"] = $(\"select[name='tag']\").val();
postvars[\"free_search\"] = $(\"input[name='free_search']\").val();
postvars[\"page\"] = page;
page++;
$.post(\"index.php\",
postvars,
function (data) {
if (data.end) {
$(\"#loading_rows\").hide();
}
else {
$.each(data.modules, function(key, module) {
$(\"table#list_Modules tbody\").append(\"<tr>\" +
\"<th class='head_vertical'></th>\" +
\"<td class='cell_1'><b class='ui-table-cell-label'>" . __('Module name') . "</b>\" + module[0] + \"</td>\" +
\"<td class='cell_0'><b class='ui-table-cell-label'>" . __('Agent name') . "</b>\" + module[2] + \"</td>\" +
\"<td class='cell_2'><b class='ui-table-cell-label'>" . __('Status') . "</b>\" + module[5] + \"</td>\" +
\"<td class='cell_3'><b class='ui-table-cell-label'>" . __('Interval') . "</b>\" + module[4] + \"</td>\" +
\"<td class='cell_4'><b class='ui-table-cell-label'>" . __('Timestamp') . "</b>\" + module[6] + \"</td>\" +
\"<td class='cell_5'><b class='ui-table-cell-label'>" . __('Data') . "</b>\" + module[7] + \"</td>\" +
\"</tr>\");
});
load_more_rows = 1;
}
},
\"json\");
}
}
custom_scroll();
});
$(window).on(\"touchmove\", function(event) {
custom_scroll();
});
});
</script>");