diff --git a/pandora_console/godmode/agentes/pandora_networkmap_empty.editor.php b/pandora_console/godmode/agentes/pandora_networkmap_empty.editor.php index 6fa81baca7..f2a8b8df64 100644 --- a/pandora_console/godmode/agentes/pandora_networkmap_empty.editor.php +++ b/pandora_console/godmode/agentes/pandora_networkmap_empty.editor.php @@ -117,79 +117,91 @@ if ($not_found) { $table = new StdClass(); $table->id = 'form_editor'; - $table->width = '98%'; - $table->class = 'databox_color'; - - $table->head = []; - - $table->size = []; - $table->size[0] = '30%'; + $table->width = '100%'; + $table->class = 'databox filter-table-adv'; $table->style = []; - $table->style[0] = 'font-weight: bold; width: 150px;'; + $table->style[0] = 'width: 50%'; $table->data = []; - $table->data[0][0] = __('Name'); - $table->data[0][1] = html_print_input_text( - 'name', - $name, - '', - 30, - 100, - true - ); - $table->data[1][0] = __('Group'); - $table->data[1][1] = '
'.html_print_select_groups( - false, - 'AR', - true, - 'id_group', - $id_group, - '', - '', - 0, - true - ).'
'; - - $table->data[2][0] = __('Node radius'); - $table->data[2][1] = html_print_input_text( - 'node_radius', - $node_radius, - '', - 2, - 10, - true + $table->data[0][] = html_print_label_input_block( + __('Name'), + html_print_input_text( + 'name', + $name, + '', + 30, + 100, + true + ), + [ 'div_class' => 'w50p' ] ); - $table->data[3][0] = __('Description'); - $table->data[3][1] = html_print_textarea('description', 7, 25, $description, '', true); + $table->data[1][] = html_print_label_input_block( + __('Group'), + html_print_select_groups( + false, + 'AR', + true, + 'id_group', + $id_group, + '', + '', + 0, + true + ), + [ 'div_class' => 'w50p' ] + ); + + $table->data[2][] = html_print_label_input_block( + __('Node radius'), + html_print_input_text( + 'node_radius', + $node_radius, + '', + 2, + 10, + true + ), + [ 'div_class' => 'w50p' ] + ); + + $table->data[3][] = html_print_label_input_block( + __('Description'), + html_print_textarea( + 'description', + 7, + 25, + $description, + '', + true + ) + ); echo '
'; html_print_table($table); - echo "
"; if ($new_empty_networkmap) { html_print_input_hidden('save_empty_networkmap', 1); - html_print_submit_button( - __('Save networkmap'), - 'crt', - false, - 'class="sub next"' - ); + $titleButton = __('Save networkmap'); } if ($edit_networkmap) { html_print_input_hidden('id_networkmap', $id); html_print_input_hidden('update_empty_networkmap', 1); - html_print_submit_button( - __('Update networkmap'), - 'crt', - false, - 'class="sub upd"' - ); + $titleButton = __('Update networkmap'); } + html_print_action_buttons( + html_print_submit_button( + $titleButton, + 'crt', + false, + ['icon' => 'next'], + true + ) + ); + echo ''; - echo '
'; } diff --git a/pandora_console/include/class/NetworkMap.class.php b/pandora_console/include/class/NetworkMap.class.php index bdbbc8c7e8..b513c5e4b1 100644 --- a/pandora_console/include/class/NetworkMap.class.php +++ b/pandora_console/include/class/NetworkMap.class.php @@ -3047,17 +3047,6 @@ class NetworkMap html_print_div(['id' => 'content_node_details-3-1'], true) ); - /* - $table->data[0][0] = ''.__('Agent').''; - $table->data[0][1] = ''; - $table->data[1][0] = ''.__('Adresses').''; - $table->data[1][1] = ''; - $table->data[2][0] = ''.__('OS type').''; - $table->data[2][1] = ''; - $table->data[3][0] = ''.__('Group').''; - $table->data[3][1] = ''; - */ - $output .= ui_toggle( html_print_table($table, true), __('Node Details'), @@ -3153,12 +3142,13 @@ class NetworkMap ) ); - $table->data['fictional_node_networkmap_link'][] = html_print_button( + $buttons = []; + $buttons[] = html_print_button( __('Update fictional node'), - '', + 'upd_fictional_node', false, - 'add_fictional_node();', - ['mode' => 'link'], + '', + ['icon' => 'next'], true ); /* @@ -3184,18 +3174,20 @@ class NetworkMap ); */ + $buttons[] = html_print_button( + __('Update node'), + 'upd_only_node', + false, + 'update_node_name()', + ['icon' => 'next'], + true + ); + $nodeUpdateTable = html_print_table($table, true); $nodeUpdateTable .= html_print_div( [ 'class' => 'action-buttons w100p float-right', - 'content' => html_print_button( - __('Update node'), - '', - false, - 'update_node_name()', - ['icon' => 'next'], - true - ), + 'content' => implode('', $buttons), ], true ); diff --git a/pandora_console/include/javascript/functions_pandora_networkmap.js b/pandora_console/include/javascript/functions_pandora_networkmap.js index 5e83af0fcb..a89527e55d 100644 --- a/pandora_console/include/javascript/functions_pandora_networkmap.js +++ b/pandora_console/include/javascript/functions_pandora_networkmap.js @@ -839,6 +839,11 @@ function edit_node(data_node, dblClick) { "onclick", "update_fictional_node(" + node_selected.id_db + ");" ); + console.log("cimborrio"); + $("#button-upd_fictional_node").attr( + "onclick", + "update_fictional_node(" + node_selected.id_db + ");" + ); $("#node_options-node_name-2 input").attr( "onclick", @@ -934,18 +939,22 @@ function edit_node(data_node, dblClick) { //Fictional node $("#node_options-fictional_node_name").css("display", ""); $("input[name='edit_name_fictional_node']").val(node_selected.text); // It doesn't eval the possible XSS so it's ok - $("#node_options-fictional_node_networkmap_link").css("display", ""); + $("#node_options-fictional_node_networkmap_link-0").css("display", ""); $("#edit_networkmap_to_link").val(node_selected.networkmap_id); $("#edit_networkmap_to_link").trigger("change"); - $("#node_options-fictional_node_update_button").css("display", ""); + $("#button-upd_fictional_node").css("display", ""); $("#node_options-node_name").css("display", "none"); - $("#node_options-node_update_button").css("display", "none"); + $("#button-upd_only_node").css("display", "none"); } else { $("input[name='edit_name_node']").val(node_selected.text); // It doesn't eval the possible XSS so it's ok $("#node_options-fictional_node_name").css("display", "none"); - $("#node_options-fictional_node_networkmap_link").css("display", "none"); - $("#node_options-fictional_node_update_button").css("display", "none"); + $("#node_options-fictional_node_networkmap_link-0").css( + "display", + "none" + ); $("#node_options-node_name").css("display", ""); + $("#button-upd_fictional_node").css("display", "none"); + $("#button-upd_only_node").css("display", ""); } //Clean