diff --git a/extras/PandoraFMS_android_console/src/pandorafms/pandorafmsandroidconsole/PandoraWebView.java b/extras/PandoraFMS_android_console/src/pandorafms/pandorafmsandroidconsole/PandoraWebView.java index 13e28af1ea..4c566ff0f4 100644 --- a/extras/PandoraFMS_android_console/src/pandorafms/pandorafmsandroidconsole/PandoraWebView.java +++ b/extras/PandoraFMS_android_console/src/pandorafms/pandorafmsandroidconsole/PandoraWebView.java @@ -88,7 +88,7 @@ public class PandoraWebView extends Activity { //Check the first load the page for to hide a toast with the //connection message - //Close the CustomToast (I love this hack, fuck javalovers and yours patterns.). + //Close the CustomToast. if (ConnectionCustomToast.activity != null) ConnectionCustomToast.activity.finish(); } diff --git a/extras/cats.html b/extras/cats.html index 8da94e3e5e..ba399ca65e 100644 --- a/extras/cats.html +++ b/extras/cats.html @@ -1,428 +1,479 @@ - - gatete - - - - - + + + + -var svg = d3.select("#test svg"); - - -
- - - - - - - - - - - +
+ + + + + + - - - + + + - - - - - -
- - + svg + .append("g") + .attr("id", "circulo") + .attr("transform", function(d) { + return ( + "translate(" + + get_center_element("#cat1")[0] + + " " + + get_center_element("#cat1")[1] + + ")" + ); + }) + .append("circle") + .attr("style", "fill: rgb(0, 255, 0);") + .attr("cx", 0) + .attr("cy", 0) + .attr("r", 20); + + svg + .append("g") + .attr("transform", function(d) { + return ( + "translate(" + + get_pos_element("#cat1")[0] + + " " + + get_pos_element("#cat1")[1] + + ") scale(" + + get_scale_element("#cat1") + + ")" + ); + }) + .append("rect") + .attr("style", "fill:none; stroke:#ffff00;stroke-width:5") + .attr("width", function(d) { + return get_size_element("#cat1")[0]; + }) + .attr("height", function(d) { + return get_size_element("#cat1")[1]; + }); + + svg + .append("g") + .attr("transform", function(d) { + return ( + "translate(" + + get_center_element("#cat1")[0] + + " " + + get_center_element("#cat1")[1] + + ") scale(" + + get_scale_element("#cat1") + + ")" + ); + }) + .append("circle") + .attr("style", "fill: none; stroke-width: 5; stroke: rgb(0, 0, 255);") + .attr("cx", 0) + .attr("cy", 0) + .attr("r", get_radius_element("#cat1")); + + svg + .append("g") + .attr("id", "circulo") + .attr("transform", function(d) { + return ( + "translate(" + + get_center_element("#cat3")[0] + + " " + + get_center_element("#cat3")[1] + + ")" + ); + }) + .append("circle") + .attr("style", "fill: rgb(0, 255, 0);") + .attr("cx", 0) + .attr("cy", 0) + .attr("r", 20); + + svg + .append("g") + .attr("transform", function(d) { + return ( + "translate(" + + get_pos_element("#cat3")[0] + + " " + + get_pos_element("#cat3")[1] + + ") scale(" + + get_scale_element("#cat3") + + ")" + ); + }) + .append("rect") + .attr("style", "fill:none; stroke:#ffff00;stroke-width:5") + .attr("width", function(d) { + return get_size_element("#cat3")[0]; + }) + .attr("height", function(d) { + return get_size_element("#cat3")[1]; + }); + + svg + .append("g") + .attr("transform", function(d) { + return ( + "translate(" + + get_center_element("#cat3")[0] + + " " + + get_center_element("#cat3")[1] + + ") scale(" + + get_scale_element("#cat3") + + ")" + ); + }) + .append("circle") + .attr("style", "fill: none; stroke-width: 5; stroke: rgb(0, 0, 255);") + .attr("cx", 0) + .attr("cy", 0) + .attr("r", get_radius_element("#cat3")); + + arrow_by_pieces2("gatete_flecha", "cat1", "cat2"); + arrow_by_pieces2("gatete_flecha2", "cat1", "cat4"); + arrow_by_pieces2("gatete_flecha3", "cat3", "cat4"); + + //~ arrow_by_pieces("gatete_flecha", "cat1", "cat2"); + //~ arrow_by_pieces("gatete_flecha", "cat3", "cat4"); + + /** + * Function get_radius_element + * Return float + * This method get the element radius + */ + function get_radius_element(element) { + var size = get_size_element(element); + + return Math.sqrt(Math.pow(size[0] / 2, 2) + Math.pow(size[1] / 2, 2)); + } + + /** + * Function get_scale_element + * Return float + * This method get the element escale + */ + function get_scale_element(element) { + var element_t = d3.transform(d3.select(element).attr("transform")); + var element_t_scale = parseFloat(element_t["scale"]); + + return element_t_scale; + } + + /** + * Function get_size_element + * Return array[2] + * This method get the element size [width, height] + */ + function get_size_element(element) { + var element_b = d3 + .select(element) + .node() + .getBBox(); + + return [element_b["width"], element_b["height"]]; + } + + /** + * Function get_pos_element + * Return array[2] + * This method get the element position [x, y] + */ + function get_pos_element(element) { + var element_t = d3.transform(d3.select(element).attr("transform")); + var element_t_scale = parseFloat(element_t["scale"]); + var element_b = d3 + .select(element) + .node() + .getBBox(); + + var box_x = + parseFloat(element_t.translate[0]) + + parseFloat(element_b["x"]) * element_t_scale; + var box_y = + parseFloat(element_t.translate[1]) + + parseFloat(element_b["y"]) * element_t_scale; + + return [box_x, box_y]; + } + + /** + * Function get_center_element + * Return array[2] + * This method ge2t the element center point [x, y] + */ + function get_center_element(element) { + var element_t = d3.transform(d3.select(element).attr("transform")); + var element_t_scale = parseFloat(element_t["scale"]); + var element_b = d3 + .select(element) + .node() + .getBBox(); + + var box_x = + parseFloat(element_t.translate[0]) + + parseFloat(element_b["x"]) * element_t_scale; + var box_y = + parseFloat(element_t.translate[1]) + + parseFloat(element_b["y"]) * element_t_scale; + + var width = element_t_scale * element_b["width"]; + var height = element_t_scale * element_b["height"]; + + var c_x = box_x + width / 2; + var c_y = box_y + height / 2; + + return [c_x, c_y]; + } + + /** + * Function get_distance_between_point + * Return float + * This method get the distance betweeen two points + */ + function get_distance_between_point(point1, point2) { + delta_x = Math.abs(point1[0] - point2[0]); + delta_y = Math.abs(point1[1] - point1[1]); + + return Math.sqrt(Math.pow(delta_x, 2) + Math.pow(delta_y, 2)); + } + + /** + * Function get_angle_of_line + * Return float + * This method get the angle of line and x axe + */ + function get_angle_of_line(point1, point2) { + return ( + (Math.atan2(point2[1] - point1[1], point2[0] - point1[0]) * 180) / + Math.PI + ); + } + + function arrow_by_pieces2(id_arrow, element1, element2, step) { + if (typeof step === "undefined") step = 0; + + step++; + + switch (step) { + case 1: + wait_for_preload_symbols( + ["body_arrow.svg#body_arrow", "head_arrow.svg#head_arrow"], + function() { + arrow_by_pieces2(id_arrow, element1, element2, step); + } + ); + break; + case 2: + var arrow = svg + .append("g") + .attr("id", id_arrow) + .attr("style", "opacity: 0"); + + arrow + .append("g") + .attr("id", "body") + .append("use") + .attr("xlink:href", "body_arrow.svg#body_arrow"); + + arrow + .append("g") + .attr("id", "head") + .append("use") + .attr("xlink:href", "head_arrow.svg#head_arrow"); + + var c_elem1 = get_center_element("#" + element1); + var c_elem2 = get_center_element("#" + element2); + var distance = get_distance_between_point(c_elem1, c_elem2); + + var transform = d3.transform(); + + /*---------------------------------------------*/ + /*--- Position of layer arrow (body + head) ---*/ + /*---------------------------------------------*/ + var arrow = d3.select("#" + id_arrow); + + var arrow_body = d3.select("#" + id_arrow + " #body"); + var arrow_body_b = arrow_body.node().getBBox(); + + transform.translate[0] = c_elem1[0]; + transform.translate[1] = c_elem1[1] - arrow_body_b["height"] / 2; + transform.rotate = get_angle_of_line(c_elem1, c_elem2); + + arrow.attr("transform", transform.toString()); + + /*---------------------------------------------*/ + /*-------- Resize the body arrow width --------*/ + /*---------------------------------------------*/ + var arrow_body = d3.select("#" + id_arrow + " #body"); + var arrow_body_b = arrow_body.node().getBBox(); + var arrow_head = d3.select("#" + id_arrow + " #head"); + var arrow_head_b = arrow_head.node().getBBox(); + + var body_width = distance - arrow_head_b["width"]; + + transform = d3.transform(); + transform.scale[0] = body_width / arrow_body_b["width"]; + arrow_body.attr("transform", transform.toString()); + + /*---------------------------------------------*/ + /*---------- Position of head arrow -----------*/ + /*---------------------------------------------*/ + transform = d3.transform(); + + var arrow_body_t = d3.transform(arrow_body.attr("transform")); + + var scale = arrow_body_t.scale[0]; + var x = 0 + arrow_body_b["width"] * scale; + var y = + 0 + (arrow_body_b["height"] / 2 - arrow_head_b["height"] / 2); + + transform.translate[0] = x; + transform.translate[1] = y; + + arrow_head.attr("transform", transform.toString()); + + /*---------------------------------------------*/ + /*------- Show the result in one time ---------*/ + /*---------------------------------------------*/ + arrow.attr("style", "opacity: 1"); + break; + } + } + + function wait_for_preload_symbols(symbols, callback) { + var count_symbols = symbols.length; + + function wait(symbol, callback) { + switch (is_preload_symbol(symbol)) { + case -1: + preload_symbol(symbol); + + setTimeout(function() { + wait(symbol, callback); + }, 100); + break; + case 0: + // Wait + setTimeout(function() { + wait(symbol, callback); + }, 100); + break; + case 1: + count_symbols--; + break; + } + + if (count_symbols == 0) { + //~ setTimeout(function() { + //~ callback(); + //~ }, 1000); + callback(); + } + } + + for (var i in symbols) { + wait(symbols[i], callback); + } + } + + function preload_symbol(symbol, param_step) { + var step; + + if (typeof param_step == "undefined") { + step = 1; + param_step = 1; + } else { + step = param_step; + } + + step++; + + var base64symbol = btoa(symbol).replace(/=/g, ""); + + var callback = function(e) { + preload_symbol(symbol, step); + }; + + switch (param_step) { + case 1: + d3.select("svg") + .append("g") + .attr("id", base64symbol) + .attr("data-loaded", 0) + .style("opacity", 0) + .append("use") + .attr("xlink:href", symbol) + .on("load", callback); + break; + case 2: + d3.select("#" + base64symbol).attr("data-loaded", 1); + + break; + } + } + + function is_preload_symbol(symbol) { + var base64symbol = btoa(symbol).replace(/=/g, ""); + + if (d3.select("#" + base64symbol).node() === null) return -1; + + return parseInt(d3.select("#" + base64symbol).attr("data-loaded")); + } + + diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 0b1e75c18d..be3d8e10bf 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.758.1 +Version: 7.0NG.758.1-211129 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 64160f67cb..df4cf5f656 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.758.1" +pandora_version="7.0NG.758.1-211129" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index dd9a985b2a..2e17a6963c 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1015,7 +1015,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.758.1'; -use constant AGENT_BUILD => '211123'; +use constant AGENT_BUILD => '211129'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 1d6b37e224..fd31dbce17 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.758.1 -%define release 1 +%define release 211129 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 6af4554bf8..9dc24accc2 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.758.1 -%define release 1 +%define release 211129 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 4b9eb3b45f..3efc5fe83f 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.758.1" -PI_BUILD="211123" +PI_BUILD="211129" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 482887f788..c964c8f08b 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{211123} +{211129} ViewReadme {Yes} @@ -2387,7 +2387,7 @@ Windows,BuildSeparateArchives {No} Windows,Executable -{<%AppName%>-Setup<%Ext%>} +{<%AppName%>-<%Version%>-Setup<%Ext%>} Windows,FileDescription {<%AppName%> <%Version%> Setup} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 70b96f6105..b24568653b 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.758.1 Build 211123") +#define PANDORA_VERSION ("7.0NG.758.1 Build 211129") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 01329528c1..cc9fb09a37 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.758.1(Build 211123))" + VALUE "ProductVersion", "(7.0NG.758.1(Build 211129))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 819e869aca..2bd98bd3ac 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.758.1 +Version: 7.0NG.758.1-211129 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index f99c5db429..bcc3b66704 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.758.1" +pandora_version="7.0NG.758.1-211129" package_pear=0 package_pandora=1 diff --git a/pandora_console/extensions/files_repo/files_repo_list.php b/pandora_console/extensions/files_repo/files_repo_list.php index 1be6934eff..cc1584dc17 100644 --- a/pandora_console/extensions/files_repo/files_repo_list.php +++ b/pandora_console/extensions/files_repo/files_repo_list.php @@ -131,7 +131,7 @@ if (!empty($files)) { $config_url = ui_get_full_url( 'index.php?sec=godmode/extensions&sec2=extensions/files_repo&file_id='.$file_id ); - $data[4] .= ''; + $data[4] .= ""; $data[4] .= html_print_image( 'images/config.png', true, diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 7383ba4506..f73e4d5b5c 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -1078,8 +1078,11 @@ if ($update_agent) { // If IP is set for deletion, delete first. if ($action_delete_ip) { $delete_ip = get_parameter_post('address_list'); - - $direccion_agente = agents_delete_address($id_agente, $delete_ip); + if (empty($direccion_agente) === true) { + $direccideon_agente = agents_delete_address($id_agente, $delete_ip); + } else { + agents_delete_address($id_agente, $delete_ip); + } } $values = [ diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index f8bbc7802a..3708d98e80 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -144,7 +144,7 @@ if ($prediction_available) { $modules['predictionserver'] = __('Create a new prediction server module'); } -if ($web_available) { +if (is_metaconsole() === true || $web_available === '1') { $modules['webserver'] = __('Create a new web Server module'); } diff --git a/pandora_console/godmode/agentes/module_manager_editor_web.php b/pandora_console/godmode/agentes/module_manager_editor_web.php index 0d68f32edb..7812bf808d 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_web.php +++ b/pandora_console/godmode/agentes/module_manager_editor_web.php @@ -62,7 +62,9 @@ html_print_div( ] ); -require_once $config['homedir'].'/include/ajax/web_server_module_debug.php'; +if (is_int($id_agent_module) && $id_agent_module !== 0) { + include_once $config['homedir'].'/include/ajax/web_server_module_debug.php'; +} define('ID_NETWORK_COMPONENT_TYPE', 7); diff --git a/pandora_console/godmode/alerts/alert_list.list.php b/pandora_console/godmode/alerts/alert_list.list.php index 9149ef5f87..8e20aeaab7 100644 --- a/pandora_console/godmode/alerts/alert_list.list.php +++ b/pandora_console/godmode/alerts/alert_list.list.php @@ -34,6 +34,7 @@ require_once $config['homedir'].'/include/functions_modules.php'; require_once $config['homedir'].'/include/functions_users.php'; $pure = get_parameter('pure', 0); +$agent_id = get_parameter('agent_id', 0); if (defined('METACONSOLE')) { $sec = 'advanced'; @@ -74,6 +75,11 @@ $params['input_name'] = 'agent_name'; $params['value'] = $agentName; $params['size'] = 24; $params['metaconsole_enabled'] = false; +$params['use_hidden_input_idagent'] = true; +$params['print_hidden_input_idagent'] = true; +$params['hidden_input_idagent_id'] = 'hidden-autocomplete_id_agent'; +$params['hidden_input_idagent_name'] = 'agent_id'; +$params['hidden_input_idagent_value'] = $agent_id; $form_filter .= ui_print_agent_autocomplete_input($params); @@ -234,7 +240,7 @@ if ($searchFlag) { $id_agents = array_keys($agents); $total = agents_get_alerts_simple( - $id_agents, + (empty($agent_id) === false) ? ['0' => $agent_id] : $id_agents, false, false, $where, @@ -412,7 +418,7 @@ if ($id_agente) { $offset = (int) get_parameter('offset'); $simple_alerts = agents_get_alerts_simple( - $id_agents, + (empty($agent_id) === false) ? ['0' => $agent_id] : $id_agents, false, [ 'offset' => $offset, @@ -688,7 +694,7 @@ foreach ($simple_alerts as $alert) { $data[3] .= ''; } - $data[3] .= '