2013-03-27 Miguel de Dios <miguel.dedios@artica.es>
* mobile/operation/events.php, mobile/operation/tactical.php, mobile/include/ui.class.php, mobile/include/style/main.css, mobile/images/datos_blue.png, mobile/images/datos_brown.png, mobile/images/datos_green.png, mobile/images/datos_pink.png, mobile/images/datos_grey.png, mobile/images/datos_red.png, mobile/images/datos_yellow.png: some fixes and changes in the Pandora mobile. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7895 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
@ -1,3 +1,13 @@
|
|||||||
|
2013-03-27 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* mobile/operation/events.php, mobile/operation/tactical.php,
|
||||||
|
mobile/include/ui.class.php, mobile/include/style/main.css,
|
||||||
|
mobile/images/datos_blue.png, mobile/images/datos_brown.png,
|
||||||
|
mobile/images/datos_green.png, mobile/images/datos_pink.png,
|
||||||
|
mobile/images/datos_grey.png, mobile/images/datos_red.png,
|
||||||
|
mobile/images/datos_yellow.png: some fixes and changes in the
|
||||||
|
Pandora mobile.
|
||||||
|
|
||||||
2013-03-27 Mario Pulido <mario.pulido@artica.es>
|
2013-03-27 Mario Pulido <mario.pulido@artica.es>
|
||||||
|
|
||||||
* include/help/es/help_network_map_enterprise.php,
|
* include/help/es/help_network_map_enterprise.php,
|
||||||
|
BIN
pandora_console/mobile/images/datos_blue.png
Normal file
After Width: | Height: | Size: 372 B |
BIN
pandora_console/mobile/images/datos_brown.png
Normal file
After Width: | Height: | Size: 354 B |
BIN
pandora_console/mobile/images/datos_green.png
Normal file
After Width: | Height: | Size: 351 B |
BIN
pandora_console/mobile/images/datos_grey.png
Normal file
After Width: | Height: | Size: 337 B |
BIN
pandora_console/mobile/images/datos_pink.png
Normal file
After Width: | Height: | Size: 351 B |
BIN
pandora_console/mobile/images/datos_red.png
Normal file
After Width: | Height: | Size: 354 B |
BIN
pandora_console/mobile/images/datos_yellow.png
Normal file
After Width: | Height: | Size: 369 B |
@ -8,14 +8,23 @@ body {
|
|||||||
direction: ltr;
|
direction: ltr;
|
||||||
display: block;
|
display: block;
|
||||||
font-family: Arial,Helvetica,sans-serif;
|
font-family: Arial,Helvetica,sans-serif;
|
||||||
font-size: 11px;
|
font-size: 12px !important;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ui-header .ui-title {
|
||||||
|
font-size: 14px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
label, input, .ui-btn-inner {
|
||||||
|
font-size: 12px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#tactical * {
|
||||||
|
font-size: 14px !important;
|
||||||
|
}
|
||||||
|
|
||||||
/*INIT----------Groups styles-----------------------------------------*/
|
/*INIT----------Groups styles-----------------------------------------*/
|
||||||
.group_view tr {
|
.group_view tr {
|
||||||
@ -145,6 +154,8 @@ table#list_events th {
|
|||||||
}
|
}
|
||||||
/*END-----------Events styles-----------------------------------------*/
|
/*END-----------Events styles-----------------------------------------*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*INIT-----------Agents styles----------------------------------------*/
|
/*INIT-----------Agents styles----------------------------------------*/
|
||||||
.red, .redb, .redi, .error {
|
.red, .redb, .redi, .error {
|
||||||
color: #CC0000;
|
color: #CC0000;
|
||||||
@ -160,6 +171,8 @@ table#list_events th {
|
|||||||
}
|
}
|
||||||
/*END-----------Agents styles-----------------------------------------*/
|
/*END-----------Agents styles-----------------------------------------*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*INIT---------Fix the square border in search input------------------*/
|
/*INIT---------Fix the square border in search input------------------*/
|
||||||
.ui-input-search {
|
.ui-input-search {
|
||||||
border-radius: 0.6em 0.6em 0.6em 0.6em !important;
|
border-radius: 0.6em 0.6em 0.6em 0.6em !important;
|
||||||
@ -172,7 +185,6 @@ table#list_events th {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*INIT---------Fix to avoid clicks under loading message--------------*/
|
/*INIT---------Fix to avoid clicks under loading message--------------*/
|
||||||
.ui-loader-background {
|
.ui-loader-background {
|
||||||
width:100% !important;
|
width:100% !important;
|
||||||
|
@ -17,6 +17,7 @@ class Ui {
|
|||||||
private static $instance;
|
private static $instance;
|
||||||
|
|
||||||
private $title;
|
private $title;
|
||||||
|
private $page_name;
|
||||||
|
|
||||||
private $endHeader = false;
|
private $endHeader = false;
|
||||||
private $header = array();
|
private $header = array();
|
||||||
@ -81,10 +82,20 @@ class Ui {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function createPage($title = null) {
|
public function createPage($title = null, $page_name = null) {
|
||||||
if (!isset($title)) {
|
if (!isset($title)) {
|
||||||
$this->title = __('Pandora FMS mobile');
|
$this->title = __('Pandora FMS mobile');
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
$this->title = $title;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isset($page_name)) {
|
||||||
|
$this->page_name = 'main_page';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$this->page_name = $page_name;
|
||||||
|
}
|
||||||
|
|
||||||
$this->html = '';
|
$this->html = '';
|
||||||
$this->endHeader = false;
|
$this->endHeader = false;
|
||||||
@ -193,7 +204,7 @@ class Ui {
|
|||||||
$return .= 'href="#" ';
|
$return .= 'href="#" ';
|
||||||
}
|
}
|
||||||
|
|
||||||
$return .= '>';
|
$return .= ' data-ajax="false">';
|
||||||
|
|
||||||
if (isset($options['text'])) {
|
if (isset($options['text'])) {
|
||||||
$return .= $options['text'];
|
$return .= $options['text'];
|
||||||
@ -265,8 +276,13 @@ class Ui {
|
|||||||
$this->grid['cells'] = array();
|
$this->grid['cells'] = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function contentGridAddCell($html) {
|
public function contentGridAddCell($html, $key = false) {
|
||||||
$this->grid['cells'][] = $html;
|
$k = uniqid('cell_');
|
||||||
|
if ($key !== false) {
|
||||||
|
$k = $key;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->grid['cells'][$k] = $html;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function contentEndGrid() {
|
public function contentEndGrid() {
|
||||||
@ -278,10 +294,11 @@ class Ui {
|
|||||||
$convert_cells_jquery_grid = array('a', 'b', 'c', 'd', 'e');
|
$convert_cells_jquery_grid = array('a', 'b', 'c', 'd', 'e');
|
||||||
|
|
||||||
$html = "<div class='ui-grid-" .
|
$html = "<div class='ui-grid-" .
|
||||||
$convert_columns_jquery_grid[count($this->grid['cells'])] . " ui-responsive'>\n";
|
$convert_columns_jquery_grid[count($this->grid['cells'])] .
|
||||||
|
" ui-responsive'>\n";
|
||||||
|
|
||||||
reset($convert_cells_jquery_grid);
|
reset($convert_cells_jquery_grid);
|
||||||
foreach ($this->grid['cells'] as $cell) {
|
foreach ($this->grid['cells'] as $key => $cell) {
|
||||||
switch ($this->grid['mode']) {
|
switch ($this->grid['mode']) {
|
||||||
default:
|
default:
|
||||||
case 'responsive':
|
case 'responsive':
|
||||||
@ -290,7 +307,7 @@ class Ui {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
next($convert_cells_jquery_grid);
|
next($convert_cells_jquery_grid);
|
||||||
$html .= "<div class='ui-body ui-body-d'>\n";
|
$html .= "<div id='" . $key . "' class='ui-body ui-body-d'>\n";
|
||||||
$html .= $cell;
|
$html .= $cell;
|
||||||
$html .= "</div>\n";
|
$html .= "</div>\n";
|
||||||
|
|
||||||
@ -352,7 +369,7 @@ class Ui {
|
|||||||
public function getEndForm() {
|
public function getEndForm() {
|
||||||
$this->endForm = true;
|
$this->endForm = true;
|
||||||
|
|
||||||
$html = "<form action='" . $this->form['action'] . "' " .
|
$html = "<form data-ajax='false' action='" . $this->form['action'] . "' " .
|
||||||
"method='" . $this->form['method'] . "'>\n";
|
"method='" . $this->form['method'] . "'>\n";
|
||||||
foreach ($this->form['fields'] as $field) {
|
foreach ($this->form['fields'] as $field) {
|
||||||
$html .= $field . "\n";
|
$html .= $field . "\n";
|
||||||
@ -618,7 +635,7 @@ class Ui {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo " <div data-role='page' id='main_page'>\n";
|
echo " <div data-dom-cache='false' data-role='page' id='" . $this->page_name . "'>\n";
|
||||||
echo " <div data-role='header' data-position='fixed' >\n";
|
echo " <div data-role='header' data-position='fixed' >\n";
|
||||||
echo " <h1>" . $this->header['title'] . "</h1>\n";
|
echo " <h1>" . $this->header['title'] . "</h1>\n";
|
||||||
echo " " . $this->header['button_left'] . "\n";
|
echo " " . $this->header['button_left'] . "\n";
|
||||||
@ -647,6 +664,14 @@ class Ui {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
echo "<script type='text/javascript'>
|
||||||
|
$(document).bind('mobileinit', function(){
|
||||||
|
//Disable ajax link
|
||||||
|
$('.disable-ajax').click(function(event){
|
||||||
|
$.mobile.ajaxFormsEnabled = false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>";
|
||||||
echo " </body>\n";
|
echo " </body>\n";
|
||||||
echo "</html>";
|
echo "</html>";
|
||||||
ob_end_flush();
|
ob_end_flush();
|
||||||
|
@ -59,7 +59,8 @@ class Events {
|
|||||||
foreach ($events_db as $event) {
|
foreach ($events_db as $event) {
|
||||||
$end = 0;
|
$end = 0;
|
||||||
$row = array();
|
$row = array();
|
||||||
$row[] = $event['evento'];
|
$row[] = '<a href="javascript: openDetails(' . $event['id_evento'] . ')">' .
|
||||||
|
io_safe_output($event['evento']) . '</a>';
|
||||||
/*
|
/*
|
||||||
switch ($event['estado']) {
|
switch ($event['estado']) {
|
||||||
case 0:
|
case 0:
|
||||||
@ -82,11 +83,19 @@ class Events {
|
|||||||
"title" => $title_st,
|
"title" => $title_st,
|
||||||
"id" => 'status_img_' . $event["id_evento"]));
|
"id" => 'status_img_' . $event["id_evento"]));
|
||||||
*/
|
*/
|
||||||
|
$row[] = ui_print_timestamp ($event['timestamp_rep'], true);
|
||||||
|
|
||||||
|
$row[] = ui_print_agent_name ($event["id_agente"], true);
|
||||||
|
|
||||||
|
$status =
|
||||||
|
html_print_image ("mobile/images/" .
|
||||||
|
get_priority_class($event['criticity']) . ".png", true);
|
||||||
|
$status .= " ";
|
||||||
if ($event['estado'] == 1) {
|
if ($event['estado'] == 1) {
|
||||||
$img_st = "images/tick.png";
|
$img_st = "images/tick.png";
|
||||||
$title_st = __('Event validated');
|
$title_st = __('Event validated');
|
||||||
|
|
||||||
$row[] = html_print_image ($img_st, true,
|
$status .= html_print_image ($img_st, true,
|
||||||
array ("class" => "image_status",
|
array ("class" => "image_status",
|
||||||
"width" => 16,
|
"width" => 16,
|
||||||
"height" => 16,
|
"height" => 16,
|
||||||
@ -94,10 +103,10 @@ class Events {
|
|||||||
"id" => 'status_img_' . $event["id_evento"]));
|
"id" => 'status_img_' . $event["id_evento"]));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$row[] = '';
|
$status .= '';
|
||||||
}
|
}
|
||||||
$row[] = ui_print_timestamp ($event['timestamp_rep'], true);
|
|
||||||
$row[] = ui_print_agent_name ($event["id_agente"], true);
|
$row[] = $status;
|
||||||
|
|
||||||
|
|
||||||
$events[$event['id_evento']] = $row;
|
$events[$event['id_evento']] = $row;
|
||||||
@ -578,12 +587,13 @@ class Events {
|
|||||||
|
|
||||||
$events = array();
|
$events = array();
|
||||||
$field_event_name = __('Event Name');
|
$field_event_name = __('Event Name');
|
||||||
$field_status = __('Validated');
|
|
||||||
$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 " . get_priority_class($event['criticity']);
|
$row_class[$event['id_evento']] = "events";
|
||||||
|
// . get_priority_class($event['criticity']);
|
||||||
|
|
||||||
$row = array();
|
$row = array();
|
||||||
$row[$field_event_name] = '<a href="javascript: openDetails(' . $event['id_evento'] . ')">' .
|
$row[$field_event_name] = '<a href="javascript: openDetails(' . $event['id_evento'] . ')">' .
|
||||||
@ -604,11 +614,20 @@ class Events {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$row[$field_timestamp] = ui_print_timestamp ($event['timestamp_rep'], true);
|
||||||
|
$row[$field_agent] = '<a href="index.php?page=agent&id_agent=' . $event["id_agente"] . '">' .
|
||||||
|
(string) agents_get_name($event["id_agente"]) . '</a>';
|
||||||
|
|
||||||
|
$row[$field_status] =
|
||||||
|
html_print_image ("mobile/images/" .
|
||||||
|
get_priority_class($event['criticity']) . ".png", true);
|
||||||
|
$row[$field_status] .= " ";
|
||||||
if ($event['estado'] == 1) {
|
if ($event['estado'] == 1) {
|
||||||
$img_st = "images/tick.png";
|
$img_st = "images/tick.png";
|
||||||
$title_st = __('Event validated');
|
$title_st = __('Event validated');
|
||||||
|
|
||||||
$row[$field_status] = html_print_image ($img_st, true,
|
$row[$field_status] .= html_print_image ($img_st, true,
|
||||||
array ("class" => "image_status",
|
array ("class" => "image_status",
|
||||||
"width" => 16,
|
"width" => 16,
|
||||||
"height" => 16,
|
"height" => 16,
|
||||||
@ -616,11 +635,9 @@ class Events {
|
|||||||
"id" => 'status_img_' . $event["id_evento"]));
|
"id" => 'status_img_' . $event["id_evento"]));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$row[$field_status] = '';
|
$row[$field_status] .= '';
|
||||||
}
|
}
|
||||||
$row[$field_timestamp] = ui_print_timestamp ($event['timestamp_rep'], true);
|
|
||||||
$row[$field_agent] = '<a href="index.php?page=agent&id_agent=' . $event["id_agente"] . '">' .
|
|
||||||
(string) agents_get_name($event["id_agente"]) . '</a>';
|
|
||||||
|
|
||||||
|
|
||||||
$events[$event['id_evento']] = $row;
|
$events[$event['id_evento']] = $row;
|
||||||
@ -784,53 +801,69 @@ class Events {
|
|||||||
$ui->contentAddHtml("<script type=\"text/javascript\">
|
$ui->contentAddHtml("<script type=\"text/javascript\">
|
||||||
var load_more_rows = 1;
|
var load_more_rows = 1;
|
||||||
var page = 1;
|
var page = 1;
|
||||||
|
|
||||||
|
function add_rows(data) {
|
||||||
|
if (data.end) {
|
||||||
|
$(\"#loading_rows\").hide();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$.each(data.events, function(key, event) {
|
||||||
|
$(\"table#list_events tbody\").append(\"<tr class='events'>\" +
|
||||||
|
\"<th></th>\" +
|
||||||
|
\"<td>\" + event[0] + \"</td>\" +
|
||||||
|
\"<td>\" + event[1] + \"</td>\" +
|
||||||
|
\"<td>\" + event[2] + \"</td>\" +
|
||||||
|
\"<td>\" + event[3] + \"</td>\" +
|
||||||
|
\"</tr>\");
|
||||||
|
});
|
||||||
|
|
||||||
|
//$.mobile.changePage();
|
||||||
|
//$(document).page();
|
||||||
|
//$(\"table#list_events\").table().table('refresh');
|
||||||
|
|
||||||
|
load_more_rows = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function ajax_load_rows() {
|
||||||
|
if (load_more_rows) {
|
||||||
|
|
||||||
|
load_more_rows = 0;
|
||||||
|
|
||||||
|
postvars = {};
|
||||||
|
postvars[\"action\"] = \"ajax\";
|
||||||
|
postvars[\"parameter1\"] = \"events\";
|
||||||
|
postvars[\"parameter2\"] = \"get_events\";
|
||||||
|
postvars[\"filter\"] = $(\"select[name='filter']\").val();
|
||||||
|
postvars[\"group\"] = $(\"select[name='group']\").val();
|
||||||
|
postvars[\"status\"] = $(\"select[name='status']\").val();
|
||||||
|
postvars[\"type\"] = $(\"select[name='type']\").val();
|
||||||
|
postvars[\"severity\"] = $(\"select[name='severity']\").val();
|
||||||
|
postvars[\"free_search\"] = $(\"input[name='free_search']\").val();
|
||||||
|
postvars[\"hours_old\"] = $(\"input[name='hours_old']\").val();
|
||||||
|
postvars[\"page\"] = page;
|
||||||
|
page++;
|
||||||
|
|
||||||
|
$.post(\"index.php\",
|
||||||
|
postvars,
|
||||||
|
function (data) {
|
||||||
|
add_rows(data);
|
||||||
|
|
||||||
|
//For large screens load the new events
|
||||||
|
if (document.documentElement.scrollHeight == document.documentElement.clientHeight) {
|
||||||
|
ajax_load_rows();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
\"json\");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$(window).bind(\"scroll\", function () {
|
$(window).bind(\"scroll\", function () {
|
||||||
|
if ($(this).scrollTop() + $(this).height()
|
||||||
if (load_more_rows) {
|
>= ($(document).height() - 100)) {
|
||||||
if ($(this).scrollTop() + $(this).height()
|
|
||||||
>= ($(document).height() - 100)) {
|
ajax_load_rows();
|
||||||
|
|
||||||
load_more_rows = 0;
|
|
||||||
|
|
||||||
postvars = {};
|
|
||||||
postvars[\"action\"] = \"ajax\";
|
|
||||||
postvars[\"parameter1\"] = \"events\";
|
|
||||||
postvars[\"parameter2\"] = \"get_events\";
|
|
||||||
postvars[\"filter\"] = $(\"select[name='filter']\").val();
|
|
||||||
postvars[\"group\"] = $(\"select[name='group']\").val();
|
|
||||||
postvars[\"status\"] = $(\"select[name='status']\").val();
|
|
||||||
postvars[\"type\"] = $(\"select[name='type']\").val();
|
|
||||||
postvars[\"severity\"] = $(\"select[name='severity']\").val();
|
|
||||||
postvars[\"free_search\"] = $(\"input[name='free_search']\").val();
|
|
||||||
postvars[\"hours_old\"] = $(\"input[name='hours_old']\").val();
|
|
||||||
postvars[\"page\"] = page;
|
|
||||||
page++;
|
|
||||||
|
|
||||||
$.post(\"index.php\",
|
|
||||||
postvars,
|
|
||||||
function (data) {
|
|
||||||
if (data.end) {
|
|
||||||
$(\"#loading_rows\").hide();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$.each(data.events, function(key, event) {
|
|
||||||
$(\"table#list_events tbody\").append(\"<tr>\" +
|
|
||||||
\"<th></th>\" +
|
|
||||||
\"<td>\" + event[0] + \"</td>\" +
|
|
||||||
\"<td>\" + event[1] + \"</td>\" +
|
|
||||||
\"<td>\" + event[2] + \"</td>\" +
|
|
||||||
\"<td>\" + event[3] + \"</td>\" +
|
|
||||||
\"</tr>\");
|
|
||||||
});
|
|
||||||
|
|
||||||
load_more_rows = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
\"json\");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -97,7 +97,7 @@ class Tactical {
|
|||||||
reporting_get_stats_agents_monitors($data);
|
reporting_get_stats_agents_monitors($data);
|
||||||
$graph_js = ob_get_clean();
|
$graph_js = ob_get_clean();
|
||||||
$formatted_data = $graph_js . $formatted_data;
|
$formatted_data = $graph_js . $formatted_data;
|
||||||
$ui->contentGridAddCell($formatted_data);
|
$ui->contentGridAddCell($formatted_data, 'tactical');
|
||||||
$ui->contentEndGrid();
|
$ui->contentEndGrid();
|
||||||
|
|
||||||
$this->getLastActivity();
|
$this->getLastActivity();
|
||||||
|