2012-12-12 Miguel de Dios <miguel.dedios@artica.es>

* include/functions_visual_map_editor.php: increased the size of
	agent autocomplete widget.
	
	* include/functions_visual_map.php: in the function
	"visual_map_print_visual_map" changed for to print corretly the
	urls in public view in metaconsole.
	
	* include/ajax/agent.php: restore the search for any string in
	the autocomplete agent.
	
	* operation/reporting/reporting_xml.php,
	operation/search_results.php,
	operation/visual_console/public_console.php,
	godmode/setup/setup_auth.php, godmode/servers/modificar_server.php:
	cleaned source code style.
	
	* godmode/reporting/visual_console_builder.editor.js: fixed when
	finish a resize action or put the grid, before these actions
	was make a corrupt data of items.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7269 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2012-12-12 13:51:45 +00:00
parent e0bd5f334f
commit 3d8c0cd2a8
10 changed files with 134 additions and 96 deletions

View File

@ -1,3 +1,25 @@
2012-12-12 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_visual_map_editor.php: increased the size of
agent autocomplete widget.
* include/functions_visual_map.php: in the function
"visual_map_print_visual_map" changed for to print corretly the
urls in public view in metaconsole.
* include/ajax/agent.php: restore the search for any string in
the autocomplete agent.
* operation/reporting/reporting_xml.php,
operation/search_results.php,
operation/visual_console/public_console.php,
godmode/setup/setup_auth.php, godmode/servers/modificar_server.php:
cleaned source code style.
* godmode/reporting/visual_console_builder.editor.js: fixed when
finish a resize action or put the grid, before these actions
was make a corrupt data of items.
2012-12-12 Ramon Novoa <rnovoa@artica.es>
* pandoradb_data.sql,

View File

@ -1199,7 +1199,8 @@ function updateDB_visual(type, idElement , values, event, top, left) {
case 'module_graph':
$("#image_" + idElement).attr("src", getModuleGraph(idElement));
case 'static_graph':
if (event != 'dragstop') {
if ((event != 'resizestop') && (event != 'show_grid')
&& (event != 'dragstop')) {
var element_status= null;
var parameter = Array();
parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"});
@ -1336,6 +1337,7 @@ function updateDB(type, idElement , values, event) {
//Check if the event parameter in function is passed in the call.
if (event != null) {
switch (event) {
case 'show_grid':
case 'resizestop':
//Force to move action when resize a background, for to avoid
//lost the label.
@ -1626,7 +1628,7 @@ function eventsBackground() {
values['width'] = $('#background').css('width').replace('px', '');
values['height'] = $('#background').css('height').replace('px', '');
updateDB('background', 0, values);
updateDB('background', 0, values, 'resizestop');
width = ui.size['width'];
height = ui.size['height'];
@ -1687,7 +1689,7 @@ function move_elements_resize(original_width, original_height, width, height) {
values['absolute_left'] = new_width;
values['absolute_top'] = new_height;
updateDB(classItem, idItem, values);
updateDB(classItem, idItem, values, "resizestop");
});
}
@ -1928,7 +1930,7 @@ function showGrid() {
values['absolute_left'] = pos_x;
values['absolute_top'] = pos_y;
updateDB(classItem, idItem, values);
updateDB(classItem, idItem, values, 'show_grid');
});
eventsItems([SIZE_GRID, SIZE_GRID]);

View File

@ -196,5 +196,4 @@ else {
echo '<td><span class="prediction">'.__('Prediction server').'</span></td>';
echo "</tr></table>";
}
?>

View File

@ -241,10 +241,10 @@ elseif ($search_agents_2 && ($config['metaconsole'] == 1) && defined('METACONSOL
switch ($config["dbtype"]) {
case "mysql":
case "postgresql":
$filter[] = '(nombre COLLATE utf8_general_ci LIKE "'.$string.'%" OR direccion LIKE "'.$string.'%")';
$filter[] = '(nombre COLLATE utf8_general_ci LIKE "%'.$string.'%" OR direccion LIKE "%'.$string.'%")';
break;
case "oracle":
$filter[] = '(UPPER(nombre) LIKE UPPER(\''.$string.'%\') OR UPPER(direccion) LIKE UPPER(\''.$string.'%\'))';
$filter[] = '(UPPER(nombre) LIKE UPPER(\'%'.$string.'%\') OR UPPER(direccion) LIKE UPPER(\'%'.$string.'%\'))';
break;
}

View File

@ -868,6 +868,8 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
$metaconsole_hack = '../../';
}
enterprise_include_once("meta/include/functions_ui_meta.php");
$layout = db_get_row ('tlayout', 'id', $id_layout);
$resizedMap = false;
@ -1037,7 +1039,7 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
$id_service . '&offset=0">';
}
else {
if (!defined('METACONSOLE')) {
if (empty($layout_data['id_metaconsole'])) {
$url = $config['homeurl'] . 'index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente=' . $layout_data['id_agent'];
}
else {
@ -1052,7 +1054,7 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
}
elseif ($layout_data['id_layout_linked'] > 0) {
// Link to a map
if (!defined('METACONSOLE')) {
if (empty($layout_data['id_metaconsole'])) {
echo '<a href="index.php?sec=reporting&amp;sec2=operation/visual_console/render_view&amp;pure='.$config["pure"].'&amp;id='.$layout_data["id_layout_linked"].'">';
}
else {
@ -1170,7 +1172,7 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
if ($show_links) {
if ($layout_data['id_layout_linked'] > 0) {
// Link to a map
if (!defined('METACONSOLE')) {
if (empty($layout_data['id_metaconsole'])) {
echo '<a href="index.php?sec=reporting&amp;sec2=operation/visual_console/render_view&amp;pure='.$config["pure"].'&amp;id='.$layout_data["id_layout_linked"].'">';
}
else {
@ -1282,7 +1284,7 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
}
elseif ($layout_data['id_layout_linked'] > 0) {
// Link to a map
if (!defined('METACONSOLE')) {
if (empty($layout_data['id_metaconsole'])) {
echo '<a href="index.php?sec=reporting&amp;sec2=operation/visual_console/render_view&amp;pure='.$config["pure"].'&amp;id='.$layout_data["id_layout_linked"].'">';
}
else {
@ -1499,7 +1501,7 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
}
else {
// Link to an agent
if (!defined('METACONSOLE')) {
if (empty($layout_data['id_metaconsole'])) {
$url = $config['homeurl'] .
'index.php?' .
'sec=estado&amp;' .
@ -1518,7 +1520,7 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
elseif ($layout_data['id_layout_linked'] > 0) {
// Link to a map
if (!defined('METACONSOLE')) {
if (empty($layout_data['id_metaconsole'])) {
echo '<a href="index.php?sec=reporting&amp;sec2=operation/visual_console/render_view&amp;pure='.$config["pure"].'&amp;id='.$layout_data["id_layout_linked"].'">';
}
else {
@ -1604,7 +1606,7 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
$id_service . '&offset=0">';
}
else {
if (!defined('METACONSOLE')) {
if (empty($layout_data['id_metaconsole'])) {
$url = $config['homeurl'] .
'index.php?' .
'sec=estado&amp;'.
@ -1621,7 +1623,7 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
}
else {
// Link to a map
if (!defined('METACONSOLE')) {
if (empty($layout_data['id_metaconsole'])) {
echo '<a href="index.php?sec=reporting&amp;sec2=operation/visual_console/render_view&amp;pure='.$config["pure"].'&amp;id='.$layout_data["id_layout_linked"].'">';
}
else {

View File

@ -46,7 +46,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
echo '<div id="properties_panel" style="display: none; position: absolute; border: 2px solid #114105; padding: 5px; background: white; z-index: 90;">';
//----------------------------Hiden Form----------------------------
?>
<table class="databox" border="0" cellpadding="4" cellspacing="4" width="300">
<table class="databox" border="0" cellpadding="4" cellspacing="4" width="350">
<caption>
<?php
$titles = array(
@ -110,7 +110,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
$params['return'] = true;
$params['show_helptip'] = true;
$params['input_name'] = 'agent';
$params['size'] = 20;
$params['size'] = 30;
$params['selectbox_id'] = 'module';
$params['javascript_is_function_select'] = true;
if (defined('METACONSOLE')) {

View File

@ -215,13 +215,15 @@ foreach ($contents as $content) {
// Disable remote connections for netflow report items
if ($content['type'] != 'netflow_area' &&
$content['type'] != 'netflow_pie' &&
$content['type'] != 'netflow_data' &&
$content['type'] != 'netflow_statistics' &&
$content['type'] != 'netflow_summary') {
$remote_connection = 1;
} else {
$remote_connection = 0;
$content['type'] != 'netflow_pie' &&
$content['type'] != 'netflow_data' &&
$content['type'] != 'netflow_statistics' &&
$content['type'] != 'netflow_summary') {
$remote_connection = 1;
}
else {
$remote_connection = 0;
}
if (($config ['metaconsole'] == 1) && ($server_name != '') && defined('METACONSOLE') && $remote_connection == 1) {
@ -253,7 +255,9 @@ foreach ($contents as $content) {
$limit = 1000;
$offset = 0;
$sql_count = "SELECT COUNT(id_agente_modulo) FROM tagente_datos WHERE id_agente_modulo=".$content['id_agent_module']."
$sql_count = "SELECT COUNT(id_agente_modulo)
FROM tagente_datos
WHERE id_agente_modulo=".$content['id_agent_module']."
AND (utimestamp>=$date_init AND utimestamp<=$date_end)";
$data_count = db_get_value_sql($sql_count);
@ -261,13 +265,16 @@ foreach ($contents as $content) {
$content_report = " <simple_graph/>\n";
$result = fwrite($file, $content_report);
fclose($file);
} else if ($data_count <= $limit) {
}
else if ($data_count <= $limit) {
$content_report = " <simple_graph>\n";
$result = fwrite($file, $content_report);
fclose($file);
$sql = "SELECT * FROM tagente_datos WHERE id_agente_modulo=".$content['id_agent_module']."
AND (utimestamp>=$date_init AND utimestamp<=$date_end)";
$sql = "SELECT *
FROM tagente_datos
WHERE id_agente_modulo=".$content['id_agent_module']."
AND (utimestamp>=$date_init AND utimestamp<=$date_end)";
$data_module = db_get_all_rows_sql($sql);
xml_file_graph ($data_module, $temp_file);
@ -275,9 +282,8 @@ foreach ($contents as $content) {
$file = fopen ($temp_file, 'a+');
$content_report = " </simple_graph>\n";
$result = fwrite($file, $content_report);
} else {
}
else {
$content_report = " <simple_graph>\n";
$result = fwrite($file, $content_report);
fclose($file);
@ -285,8 +291,10 @@ foreach ($contents as $content) {
$position = 0;
while ($offset < $data_count) {
$sql = "SELECT * FROM tagente_datos WHERE id_agente_modulo=".$content['id_agent_module']."
AND (utimestamp>=$date_init AND utimestamp<=$date_end) LIMIT $offset,$limit";
$sql = "SELECT *
FROM tagente_datos
WHERE id_agente_modulo=".$content['id_agent_module']."
AND (utimestamp>=$date_init AND utimestamp<=$date_end) LIMIT $offset,$limit";
$data_module = db_get_all_rows_sql($sql);
$position = xml_file_graph ($data_module, $temp_file, $position);
@ -298,7 +306,6 @@ foreach ($contents as $content) {
$result = fwrite($file, $content_report);
fclose($file);
}
///
break;
case 'simple_baseline_graph':
@ -309,7 +316,7 @@ foreach ($contents as $content) {
$date_end = time();
$date_init = $date_end - $content['period'];
///
$temp_file = $config['attachment_store'] . '/simple_baseline_graph_' . $time.'_'.$content['id_rc'] . '.tmp';
$file = fopen ($temp_file, 'a+');
@ -319,20 +326,25 @@ foreach ($contents as $content) {
$limit = 1000;
$offset = 0;
$sql_count = "SELECT COUNT(id_agente_modulo) FROM tagente_datos WHERE id_agente_modulo=".$content['id_agent_module']."
$sql_count = "SELECT COUNT(id_agente_modulo)
FROM tagente_datos
WHERE id_agente_modulo=".$content['id_agent_module']."
AND (utimestamp>=$date_init AND utimestamp<=$date_end)";
$data_count = db_get_value_sql($sql_count);
if ($data_count == false) {
$content_report = " <simple_baseline_graph/>\n";
$result = fwrite($file, $content_report);
} else if ($data_count <= $limit) {
}
else if ($data_count <= $limit) {
$content_report = " <simple_baseline_graph>\n";
$result = fwrite($file, $content_report);
fclose($file);
$sql = "SELECT * FROM tagente_datos WHERE id_agente_modulo=".$content['id_agent_module']."
AND (utimestamp>=$date_init AND utimestamp<=$date_end)";
$sql = "SELECT *
FROM tagente_datos
WHERE id_agente_modulo=".$content['id_agent_module']."
AND (utimestamp>=$date_init AND utimestamp<=$date_end)";
$data_module = db_get_all_rows_sql($sql);
xml_file_graph ($data_module, $temp_file);
@ -342,7 +354,8 @@ foreach ($contents as $content) {
$result = fwrite($file, $content_report);
fclose($file);
} else {
}
else {
$content_report = " <simple_baseline_graph>\n";
$result = fwrite($file, $content_report);
fclose($file);

View File

@ -56,7 +56,7 @@ $selected = 'border: 1px solid black;';
if ($searchAgents) {
$agents_tab = array('text' => "<a href='index.php?search_category=agents&keywords=".$config['search_keywords']."&head_search_keywords=Search'>"
. html_print_image ("images/bricks.png", true, array ("title" => __('Agents'))) . "</a>", 'active' => $searchTab == "agents");
. html_print_image ("images/bricks.png", true, array ("title" => __('Agents'))) . "</a>", 'active' => $searchTab == "agents");
}
else {
$agents_tab = '';
@ -64,7 +64,7 @@ else {
if ($searchUsers) {
$users_tab = array('text' => "<a href='index.php?search_category=users&keywords=".$config['search_keywords']."&head_search_keywords=Search'>"
. html_print_image ("images/group.png", true, array ("title" => __('Users'))) . "</a>", 'active' => $searchTab == "users");
. html_print_image ("images/group.png", true, array ("title" => __('Users'))) . "</a>", 'active' => $searchTab == "users");
}
else {
$users_tab = '';
@ -72,7 +72,7 @@ else {
if ($searchAlerts) {
$alerts_tab = array('text' => "<a href='index.php?search_category=alerts&keywords=".$config['search_keywords']."&head_search_keywords=Search'>"
. html_print_image ("images/god2.png", true, array ("title" => __('Alerts'))) . "</a>", 'active' => $searchTab == "alerts");
. html_print_image ("images/god2.png", true, array ("title" => __('Alerts'))) . "</a>", 'active' => $searchTab == "alerts");
}
else {
$alerts_tab = '';
@ -80,7 +80,7 @@ else {
if ($searchGraphs) {
$graphs_tab = array('text' => "<a href='index.php?search_category=graphs&keywords=".$config['search_keywords']."&head_search_keywords=Search'>"
. html_print_image ("images/chart_curve.png", true, array ("title" => __('Graphs'))) . "</a>", 'active' => $searchTab == "graphs");
. html_print_image ("images/chart_curve.png", true, array ("title" => __('Graphs'))) . "</a>", 'active' => $searchTab == "graphs");
}
else {
$graphs_tab = '';
@ -88,7 +88,7 @@ else {
if ($searchReports) {
$reports_tab = array('text' => "<a href='index.php?search_category=reports&keywords=".$config['search_keywords']."&head_search_keywords=Search'>"
. html_print_image ("images/reporting.png", true, array ("title" => __('Reports'))) . "</a>", 'active' => $searchTab == "reports");
. html_print_image ("images/reporting.png", true, array ("title" => __('Reports'))) . "</a>", 'active' => $searchTab == "reports");
}
else {
$reports_tab = '';
@ -96,7 +96,7 @@ else {
if ($searchMaps) {
$maps_tab = array('text' => "<a href='index.php?search_category=maps&keywords=".$config['search_keywords']."&head_search_keywords=Search'>"
. html_print_image ("images/camera.png", true, array ("title" => __('Maps'))) . "</a>", 'active' => $searchTab == "maps");
. html_print_image ("images/camera.png", true, array ("title" => __('Maps'))) . "</a>", 'active' => $searchTab == "maps");
}
else {
$maps_tab = '';
@ -104,16 +104,16 @@ else {
if ($searchModules) {
$modules_tab = array('text' => "<a href='index.php?search_category=modules&keywords=".$config['search_keywords']."&head_search_keywords=Search'>"
. html_print_image ("images/lightbulb.png", true, array ("title" => __('Modules'))) . "</a>", 'active' => $searchTab == "modules");
. html_print_image ("images/lightbulb.png", true, array ("title" => __('Modules'))) . "</a>", 'active' => $searchTab == "modules");
}
else {
$modules_tab = '';
}
$onheader = array('agents' => $agents_tab, 'users' => $users_tab,
'alerts' => $alerts_tab, 'graphs' => $graphs_tab,
'reports' => $reports_tab, 'maps' => $maps_tab,
'modules' => $modules_tab);
'alerts' => $alerts_tab, 'graphs' => $graphs_tab,
'reports' => $reports_tab, 'maps' => $maps_tab,
'modules' => $modules_tab);
ui_print_page_header (__("Search").": \"".$config['search_keywords']."\"", "images/zoom.png", false, "", false, $onheader);

View File

@ -46,7 +46,7 @@ $config["id_user"] = get_parameter ('id_user');
$myhash = md5($config["dbpass"].$id_layout. $config["id_user"]);
// Check input hash
if ( $myhash != $hash){
if ( $myhash != $hash) {
exit;
}