From a27d2305cd4f70d125a5ca6e0f285ef84f8070cd Mon Sep 17 00:00:00 2001 From: slerena Date: Tue, 8 May 2012 15:43:45 +0000 Subject: [PATCH] 2012-05-08 Sancho Lerena * operation/agentes/datos_agente.php: Fixed search, was not working due html encoding in the SQL. Alter some layout issues (centering data in columns) * extensions/ssh_gateway*: New extension to connect SSH/Telnet servers from the console, using external anytermd daemon running in the pandora server. * pandora.css: Fix title height. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6271 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 12 +++ pandora_console/extensions/ssh_gateway.php | 80 ++++++++++++++++++ .../extensions/ssh_gateway/secure_console.png | Bin 0 -> 818 bytes pandora_console/include/styles/pandora.css | 8 +- .../operation/agentes/datos_agente.php | 29 ++++--- 5 files changed, 113 insertions(+), 16 deletions(-) create mode 100644 pandora_console/extensions/ssh_gateway.php create mode 100644 pandora_console/extensions/ssh_gateway/secure_console.png diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 47ee853cc8..991b574c80 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,15 @@ +2012-05-08 Sancho Lerena + + * operation/agentes/datos_agente.php: Fixed search, was + not working due html encoding in the SQL. Alter some layout + issues (centering data in columns) + + * extensions/ssh_gateway*: New extension to connect SSH/Telnet + servers from the console, using external anytermd daemon running + in the pandora server. + + * pandora.css: Fix title height. + 2012-05-08 Juan Manuel Ramon * images/header_f2b.png: Changed image size to 3000px width. diff --git a/pandora_console/extensions/ssh_gateway.php b/pandora_console/extensions/ssh_gateway.php new file mode 100644 index 0000000000..e8d99c9f07 --- /dev/null +++ b/pandora_console/extensions/ssh_gateway.php @@ -0,0 +1,80 @@ +"; + + $id_agente = get_parameter ("id_agente"); + $ip = db_get_sql ("SELECT direccion FROM tagente WHERE id_agente = $id_agente"); + + if ($HOST == "") + $HOST = $ip; + + if (($HOST == "") OR ($USER == "")){ + + if ($COMMIT == 1){ + echo "

".__("You need to specify a user and a host address")."

"; + + } + + echo "
"; + echo ""; + echo ""; + echo "
".__("Host address").""; + echo "
".__("User").""; + echo "
"; + echo __("Connect mode").""; + + echo "   "; + echo ""; + echo "
"; + } + + else { + if ($MODE == "ssh") + echo ""; + } + +} + +?> diff --git a/pandora_console/extensions/ssh_gateway/secure_console.png b/pandora_console/extensions/ssh_gateway/secure_console.png new file mode 100644 index 0000000000000000000000000000000000000000..33f343b3b3946fa8326c8edc956ea53d83f12a11 GIT binary patch literal 818 zcmV-21I_%2P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iye& z4>mD9G`OJv00Oc}L_t(I%cYaMZyaS5#ed&p9=kg;?8@Nqim>811v{}!g;<#)g$oxT zQmjcsfh;QpvMl}xA{VxVXhM|&1W0M}7Z{TUSq9|DE6W`(d)ZxrAIUPTz4OiYQAD;B zrOcI1bB}cHInufCoFf{I#`~+Qt6z+cj#i7JI47KQ0K{?p)Xq7FQi|Q(-Q)TB`H$4{ z^77ZSv$JnzSr$f76jmyguv{*mLrNJcrOqLQ2!#+~nx@rmw;Sndwd!>`9X`8ti>aw8 zjt&nAf&eMyvv!4GFc{G5^;lV1Aq>M%JLjwb(#c8Qy>^WUTU%^zZSh~0JtN|r!&=M8 z$Ow6!V~nv{N{R3Ltgo%{>cxwEI5)@s{ywekZNe}FKuSryUMEdcthKb;ZTkH_MNy!Y zQVa$IUK<<3ImhDSB0p_xkYyQC2*Of{dcDrf%nX0-?E}zgH0bquD5a26O5!Bp-rc** zUBAv(ckYnXYBX=$;Js!Or8Pn(HG?~alDkd6h?%(b!7Ew_fe?a9r9z(P#Bod*hIpR$L^#$&wHLUMPVnRA zLuxg{>!lNZ`}G7lKu943)>@1)SZk3|qP52JJc1xVYY#|3T;lfUJAC_12S2FcoT4Zk zS}CP{-)CWAf#Gm?e*G+3tR4anKpm03b%FYL1!FRVuqY*@Znau}OixcwE-fuRRTyIo z#uy%TTAcoVABLNJd{Ysa40q5cJB{f6efUTuNpiW_Yz&r%WSo?_QS>}&-=~%4-tzXP*^j-(f|Me07*qoM6N<$f>}p#&;S4c literal 0 HcmV?d00001 diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 1d8f1ceec2..c46d003c85 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -576,7 +576,7 @@ tr.rowOdd:hover { font-style: italic; } .tit { - padding: 5px 1px; + padding: 3px 1px; } .tit, .titb { font-weight: bold; @@ -1611,7 +1611,7 @@ td.datos_greyf9, td.datos_bluef9, td.datos_greenf9, td.datos_redf9, td.datos_yel } .menu li.selected { - background-color: #B1B1B1 !important; + background-color: #B1B1B1 !important; } .menu li { @@ -1619,7 +1619,7 @@ td.datos_greyf9, td.datos_bluef9, td.datos_greenf9, td.datos_redf9, td.datos_yel } .submenu li a{ - background-color: #E4E4E4 !important; + background-color: #E4E4E4 !important; } .menu li a:hover, @@ -1632,7 +1632,7 @@ td.datos_greyf9, td.datos_bluef9, td.datos_greenf9, td.datos_redf9, td.datos_yel } .is_submenu2 { - background-color: #222222 !important; + background-color: #222222 !important; } .menu li.submenu_selected a { diff --git a/pandora_console/operation/agentes/datos_agente.php b/pandora_console/operation/agentes/datos_agente.php index ae13298b72..088dbb2239 100644 --- a/pandora_console/operation/agentes/datos_agente.php +++ b/pandora_console/operation/agentes/datos_agente.php @@ -27,6 +27,7 @@ $period = get_parameter ("period", 86400); $group = agents_get_agentmodule_group ($module_id); $agentId = get_parameter("id_agente"); $freestring = get_parameter ("freestring"); + $selection_mode = get_parameter('selection_mode', 'fromnow'); $date_from = (string) get_parameter ('date_from', date ('Y-m-j')); $time_from = (string) get_parameter ('time_from', date ('h:iA')); @@ -79,7 +80,7 @@ if ($moduletype_name == "log4x") { } else { $sql_body = sprintf ("FROM tagente_datos_log4x WHERE id_agente_modulo = %d AND message like '%s' AND utimestamp >= %d AND utimestamp <= %d ORDER BY utimestamp DESC", $module_id, $sql_freestring, $datetime_from, $datetime_to); } - + $columns = array( "Timestamp" => array("utimestamp", "modules_format_timestamp", "align" => "center" ), @@ -95,10 +96,10 @@ if ($moduletype_name == "log4x") { } else { $sql_body = sprintf (" FROM tagente_datos_string WHERE id_agente_modulo = %d AND datos like '%s' AND utimestamp >= %d AND utimestamp <= %d ORDER BY utimestamp DESC", $module_id, $sql_freestring, $datetime_from, $datetime_to); } - + $columns = array( - "Timestamp" => array("utimestamp", "modules_format_timestamp", "align" => "center"), - "Data" => array("datos", "modules_format_data", "align" => "center"), + "Timestamp" => array("utimestamp", "modules_format_timestamp", "align" => "left"), + "Data" => array("datos", "modules_format_data", "align" => "left"), "Time" => array("utimestamp", "modules_format_time", "align" => "center") ); } else { @@ -107,14 +108,17 @@ if ($moduletype_name == "log4x") { } else { $sql_body = sprintf (" FROM tagente_datos WHERE id_agente_modulo = %d AND utimestamp >= %d AND utimestamp <= %d ORDER BY utimestamp DESC", $module_id, $datetime_from, $datetime_to); } - + $columns = array( - "Timestamp" => array("utimestamp", "modules_format_timestamp", "align" => "center"), - "Data" => array("datos", "modules_format_data", "align" => "center"), + "Timestamp" => array("utimestamp", "modules_format_timestamp", "align" => "left"), + "Data" => array("datos", "modules_format_data", "align" => "left"), "Time" => array("utimestamp", "modules_format_time", "align" => "center") ); } +$sql_body = io_safe_output($sql_body); +// Clean all codification characters + $sql = "SELECT * " . $sql_body; $sql_count = "SELECT count(*) " . $sql_body; @@ -231,11 +235,12 @@ ui_require_jquery_file ('timeentry');