From 6cf8fdad39d409bf65bb66d745d609f37483304d Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Tue, 16 Aug 2022 14:07:25 +0200 Subject: [PATCH] #9348 improved usability --- .../include/class/NetworkMap.class.php | 4 +-- .../functions_pandora_networkmap.js | 32 +++++++++++++------ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/pandora_console/include/class/NetworkMap.class.php b/pandora_console/include/class/NetworkMap.class.php index 6e63326c5f..051d5d603a 100644 --- a/pandora_console/include/class/NetworkMap.class.php +++ b/pandora_console/include/class/NetworkMap.class.php @@ -3066,8 +3066,8 @@ class NetworkMap $table->data['template_row']['node_target'] = ''; $table->data['template_row']['edit'] = ''; - $table->data['template_row']['edit'] .= ''.html_print_image('images/config.png', true, ['class' => 'invert_filter']).''; - + $table->data['template_row']['edit'] .= ''; + // '.html_print_image('images/config.png', true, ['class' => 'invert_filter']).''; $table->data['template_row']['edit'] .= ''.html_print_image('images/delete.png', true, ['class' => 'invert_filter']).''; $table->colspan['no_relations']['0'] = 5; diff --git a/pandora_console/include/javascript/functions_pandora_networkmap.js b/pandora_console/include/javascript/functions_pandora_networkmap.js index 46fd944bb0..a4927e0499 100644 --- a/pandora_console/include/javascript/functions_pandora_networkmap.js +++ b/pandora_console/include/javascript/functions_pandora_networkmap.js @@ -597,6 +597,8 @@ function update_link(row_index, id_link) { $(".edit_icon_progress_" + row_index).css("display", ""); $(".edit_icon_" + row_index).css("display", "none"); + $(".edit_icon_" + row_index).css("display", "none"); + var params = []; params.push("update_link=1"); params.push("networkmap_id=" + networkmap_id); @@ -978,6 +980,7 @@ function get_interface_data_to_table(node_selected, selected_links) { function load_interfaces(selected_links) { //Clean $("#relations_table .relation_link_row").remove(); + $("#update_relations_button").remove(); //Show the no relations $("#relations_table-loading").css("display", "none"); $("#relations_table-no_relations").css("display", ""); @@ -1011,11 +1014,6 @@ function load_interfaces(selected_links) { "class", "edit_icon_fail_" + i ); - $(".edit_icon_link", template_relation_row) - .attr("class", "edit_icon_link_" + i) - .click(function() { - update_link(i, link_each.id_db); - }); var params3 = []; params3.push("get_intefaces=1"); @@ -1115,6 +1113,11 @@ function load_interfaces(selected_links) { "align", "center" ); + $("#relations_table-template_row-edit", template_relation_row).css({ + display: "flex", + "align-items": "center", + "justify-content": "center" + }); $( "#relations_table-template_row-edit .delete_icon", template_relation_row @@ -1143,6 +1146,20 @@ function load_interfaces(selected_links) { template_relation_row = null; }); + + $("#relations_table") + .parent() + .append( + `
+ +
` + ); + + $("#update_relations_button").click(function() { + jQuery.each(selected_links, function(i, link_each) { + update_link(i, link_each.id_db); + }); + }); } function add_node() { @@ -1327,11 +1344,6 @@ function function_close_minimap() { function delete_nodes() { var selection = d3.selectAll(".node_selected"); selection.each(function(d) { - //Avoid to delete pandora node center - if (d.id_agent == 0) { - return; - } - var params = []; params.push("id=" + d.id_db); params.push("delete_node=1");