From 72318258a6cf25c3268b1d3294346526ae26718f Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 27 Mar 2013 17:51:35 +0000 Subject: [PATCH] 2013-03-27 Miguel de Dios * 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 --- pandora_console/ChangeLog | 10 ++ pandora_console/mobile/images/datos_blue.png | Bin 0 -> 372 bytes pandora_console/mobile/images/datos_brown.png | Bin 0 -> 354 bytes pandora_console/mobile/images/datos_green.png | Bin 0 -> 351 bytes pandora_console/mobile/images/datos_grey.png | Bin 0 -> 337 bytes pandora_console/mobile/images/datos_pink.png | Bin 0 -> 351 bytes pandora_console/mobile/images/datos_red.png | Bin 0 -> 354 bytes .../mobile/images/datos_yellow.png | Bin 0 -> 369 bytes pandora_console/mobile/include/style/main.css | 16 +- pandora_console/mobile/include/ui.class.php | 43 +++-- pandora_console/mobile/operation/events.php | 147 +++++++++++------- pandora_console/mobile/operation/tactical.php | 2 +- 12 files changed, 149 insertions(+), 69 deletions(-) create mode 100644 pandora_console/mobile/images/datos_blue.png create mode 100644 pandora_console/mobile/images/datos_brown.png create mode 100644 pandora_console/mobile/images/datos_green.png create mode 100644 pandora_console/mobile/images/datos_grey.png create mode 100644 pandora_console/mobile/images/datos_pink.png create mode 100644 pandora_console/mobile/images/datos_red.png create mode 100644 pandora_console/mobile/images/datos_yellow.png diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 70d24d2957..2a9caccb65 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,13 @@ +2013-03-27 Miguel de Dios + + * 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 * include/help/es/help_network_map_enterprise.php, diff --git a/pandora_console/mobile/images/datos_blue.png b/pandora_console/mobile/images/datos_blue.png new file mode 100644 index 0000000000000000000000000000000000000000..ecb9a90818d6733e6ac4d5d081d8eac0399985bb GIT binary patch literal 372 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vf2?p zUk71ECym(^Ktah8*NBqf{Irtt#G+J&^73-M%)IR4q9;tt3R>&A zl3bQF9MW1p?|Zu2Zspr^g6rNLx2telu|bnTCClpisV(c;etz2%SKHulI@Wl42qSad z@~yG!+{(|h&1dTS^e;52$nj6(+1puD{CW8rlArHCd0*Ri+U_*I1?v&=N>#6ND zYx@1+;AR%dgn|un%>fe?m<4_){#x#Ja9KylPm@-cxmw;=9G^dF;M?17w6@XgV7~EB z)m4f6w#MGex~;c5ao^wh>vKK;&Ck`}vCl8N`r_$=vR>Qm^FE7b>oo_ee4bbc^gM&7 LtDnm{r-UW|6DO4~ literal 0 HcmV?d00001 diff --git a/pandora_console/mobile/images/datos_brown.png b/pandora_console/mobile/images/datos_brown.png new file mode 100644 index 0000000000000000000000000000000000000000..6d8fbb2e68fc87c89e623a392cd81c60414266f1 GIT binary patch literal 354 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vf2?p zUk71ECym(^Ktah8*NBqf{Irtt#G+J&^73-M%)IR4mOOmq?}S)%gRx%HZkh=d#Wzp$PyVACKt( literal 0 HcmV?d00001 diff --git a/pandora_console/mobile/images/datos_green.png b/pandora_console/mobile/images/datos_green.png new file mode 100644 index 0000000000000000000000000000000000000000..f2061d61d1a9890993e18b372e844f9225502fbc GIT binary patch literal 351 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vf2?p zUk71ECym(^Ktah8*NBqf{Irtt#G+J&^73-M%)IR4YQdeTG> zm$1sOd+c{_w%&Ah(ytX;&%IIAa%NR{kz2*Se2$IIYg2ZPmG3eH^bd6Hmo&_+dv?`l zQI7woiTr1tHT{tOI8!(}ncd;;#Xr$(2D5i9X1wsOck7w&Q!N7pJS77>-O!-&z?NAi@$lp sa^q2%9d&aBi)W-p2?p zUk71ECym(^Ktah8*NBqf{Irtt#G+J&^73-M%)IR40?RKJ_^_UuFctD|0= zk~Lyrm3a4|J!!Y4!zK5LB~R{5TI#bc-h1xbeTobEJ1+n4F?tYXQSjSRxZuaMhu_VZ dPGA4Yed$RmL$omaA)wC~JYD@<);T3K0RYHahmHUM literal 0 HcmV?d00001 diff --git a/pandora_console/mobile/images/datos_pink.png b/pandora_console/mobile/images/datos_pink.png new file mode 100644 index 0000000000000000000000000000000000000000..37875ef8564bbc8cbccbe039a5facd52f9e4ab31 GIT binary patch literal 351 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vf2?p zUk71ECym(^Ktah8*NBqf{Irtt#G+J&^73-M%)IR4i;s;_JTEo;`DJmWtnxACjB;g*ONVb2hADG!@yGbnAZU`e^k75nDuWNMCqt!x&;L zy@&Y~o5bm|-kcIgo1e-^K%qgo_FMq1`=!p+Mwa?|i-;Nz5MT; s<7yr+_F2Vy=Q7Nae>&ys`S*Xg&uV69s4Q#T1@tF_r>mdKI;Vst0Go`B-~a#s literal 0 HcmV?d00001 diff --git a/pandora_console/mobile/images/datos_red.png b/pandora_console/mobile/images/datos_red.png new file mode 100644 index 0000000000000000000000000000000000000000..8966fffd57a3161e8412390156c80e46bbf46285 GIT binary patch literal 354 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vf2?p zUk71ECym(^Ktah8*NBqf{Irtt#G+J&^73-M%)IR4hFIopwM|UsrL_u&yU%BtC!T> zHR`BsP2?p zUk71ECym(^Ktah8*NBqf{Irtt#G+J&^73-M%)IR4EN3*EpuZQ|Ld>93P;zi%Du}dxnEdS ze^X5{|K1(^6XJHCRQ~p*rK0DH$*Jqc8<-v5ton7{sKK^3HkA3r+e)K*CvO`cw{!Jb zv-*PljiW{m+b$pXWth(V#CFx8@8P_kG!K7xXS+~-QsWG@hBo#Gz8+_UI+)+gu&`;_ z60voX`1D(o#DSLoPoHv7?&<59Pb{CW7gjyLKgHtKv3cIte+mmLlul#&Ez}G2IfJLG KpUXO@geCyEGniZe literal 0 HcmV?d00001 diff --git a/pandora_console/mobile/include/style/main.css b/pandora_console/mobile/include/style/main.css index 5a4fb140e3..1220b376f0 100644 --- a/pandora_console/mobile/include/style/main.css +++ b/pandora_console/mobile/include/style/main.css @@ -8,14 +8,23 @@ body { direction: ltr; display: block; font-family: Arial,Helvetica,sans-serif; - font-size: 11px; + font-size: 12px !important; margin: 0; text-align: left; 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-----------------------------------------*/ .group_view tr { @@ -145,6 +154,8 @@ table#list_events th { } /*END-----------Events styles-----------------------------------------*/ + + /*INIT-----------Agents styles----------------------------------------*/ .red, .redb, .redi, .error { color: #CC0000; @@ -160,6 +171,8 @@ table#list_events th { } /*END-----------Agents styles-----------------------------------------*/ + + /*INIT---------Fix the square border in search input------------------*/ .ui-input-search { 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--------------*/ .ui-loader-background { width:100% !important; diff --git a/pandora_console/mobile/include/ui.class.php b/pandora_console/mobile/include/ui.class.php index 93c3389af3..b7cf6f6018 100755 --- a/pandora_console/mobile/include/ui.class.php +++ b/pandora_console/mobile/include/ui.class.php @@ -17,6 +17,7 @@ class Ui { private static $instance; private $title; + private $page_name; private $endHeader = false; 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)) { $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->endHeader = false; @@ -193,7 +204,7 @@ class Ui { $return .= 'href="#" '; } - $return .= '>'; + $return .= ' data-ajax="false">'; if (isset($options['text'])) { $return .= $options['text']; @@ -265,8 +276,13 @@ class Ui { $this->grid['cells'] = array(); } - public function contentGridAddCell($html) { - $this->grid['cells'][] = $html; + public function contentGridAddCell($html, $key = false) { + $k = uniqid('cell_'); + if ($key !== false) { + $k = $key; + } + + $this->grid['cells'][$k] = $html; } public function contentEndGrid() { @@ -278,10 +294,11 @@ class Ui { $convert_cells_jquery_grid = array('a', 'b', 'c', 'd', 'e'); $html = "
\n"; + $convert_columns_jquery_grid[count($this->grid['cells'])] . + " ui-responsive'>\n"; reset($convert_cells_jquery_grid); - foreach ($this->grid['cells'] as $cell) { + foreach ($this->grid['cells'] as $key => $cell) { switch ($this->grid['mode']) { default: case 'responsive': @@ -290,7 +307,7 @@ class Ui { break; } next($convert_cells_jquery_grid); - $html .= "
\n"; + $html .= "
\n"; $html .= $cell; $html .= "
\n"; @@ -352,7 +369,7 @@ class Ui { public function getEndForm() { $this->endForm = true; - $html = "
form['action'] . "' " . "method='" . $this->form['method'] . "'>\n"; foreach ($this->form['fields'] as $field) { $html .= $field . "\n"; @@ -618,7 +635,7 @@ class Ui { } } } - echo "
\n"; + echo "
\n"; echo "
\n"; echo "

" . $this->header['title'] . "

\n"; echo " " . $this->header['button_left'] . "\n"; @@ -647,6 +664,14 @@ class Ui { } } } + echo ""; echo " \n"; echo ""; ob_end_flush(); diff --git a/pandora_console/mobile/operation/events.php b/pandora_console/mobile/operation/events.php index a63240f6e1..81b7426fb1 100644 --- a/pandora_console/mobile/operation/events.php +++ b/pandora_console/mobile/operation/events.php @@ -59,7 +59,8 @@ class Events { foreach ($events_db as $event) { $end = 0; $row = array(); - $row[] = $event['evento']; + $row[] = '' . + io_safe_output($event['evento']) . ''; /* switch ($event['estado']) { case 0: @@ -82,11 +83,19 @@ class Events { "title" => $title_st, "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) { $img_st = "images/tick.png"; $title_st = __('Event validated'); - $row[] = html_print_image ($img_st, true, + $status .= html_print_image ($img_st, true, array ("class" => "image_status", "width" => 16, "height" => 16, @@ -94,10 +103,10 @@ class Events { "id" => 'status_img_' . $event["id_evento"])); } 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; @@ -578,12 +587,13 @@ class Events { $events = array(); $field_event_name = __('Event Name'); - $field_status = __('Validated'); $field_timestamp = __('Timestamp'); $field_agent = __('Agent'); + $field_status = __('Status'); $row_class = array(); 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[$field_event_name] = '' . @@ -604,11 +614,20 @@ class Events { break; } */ + + $row[$field_timestamp] = ui_print_timestamp ($event['timestamp_rep'], true); + $row[$field_agent] = '' . + (string) agents_get_name($event["id_agente"]) . ''; + + $row[$field_status] = + html_print_image ("mobile/images/" . + get_priority_class($event['criticity']) . ".png", true); + $row[$field_status] .= " "; if ($event['estado'] == 1) { $img_st = "images/tick.png"; $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", "width" => 16, "height" => 16, @@ -616,11 +635,9 @@ class Events { "id" => 'status_img_' . $event["id_evento"])); } else { - $row[$field_status] = ''; + $row[$field_status] .= ''; } - $row[$field_timestamp] = ui_print_timestamp ($event['timestamp_rep'], true); - $row[$field_agent] = '' . - (string) agents_get_name($event["id_agente"]) . ''; + $events[$event['id_evento']] = $row; @@ -784,53 +801,69 @@ class Events { $ui->contentAddHtml("