Events meta

This commit is contained in:
Pablo Aragon 2023-02-28 17:49:22 +01:00
commit c0ab435f4f
13 changed files with 1003 additions and 627 deletions

View File

@ -117,29 +117,29 @@ if ($not_found) {
$table = new StdClass(); $table = new StdClass();
$table->id = 'form_editor'; $table->id = 'form_editor';
$table->width = '98%'; $table->width = '100%';
$table->class = 'databox_color'; $table->class = 'databox filter-table-adv';
$table->head = [];
$table->size = [];
$table->size[0] = '30%';
$table->style = []; $table->style = [];
$table->style[0] = 'font-weight: bold; width: 150px;'; $table->style[0] = 'width: 50%';
$table->data = []; $table->data = [];
$table->data[0][0] = __('Name'); $table->data[0][] = html_print_label_input_block(
$table->data[0][1] = html_print_input_text( __('Name'),
html_print_input_text(
'name', 'name',
$name, $name,
'', '',
30, 30,
100, 100,
true true
),
[ 'div_class' => 'w50p' ]
); );
$table->data[1][0] = __('Group');
$table->data[1][1] = '<div class="w250px">'.html_print_select_groups( $table->data[1][] = html_print_label_input_block(
__('Group'),
html_print_select_groups(
false, false,
'AR', 'AR',
true, true,
@ -149,47 +149,59 @@ if ($not_found) {
'', '',
0, 0,
true true
).'</div>'; ),
[ 'div_class' => 'w50p' ]
);
$table->data[2][0] = __('Node radius'); $table->data[2][] = html_print_label_input_block(
$table->data[2][1] = html_print_input_text( __('Node radius'),
html_print_input_text(
'node_radius', 'node_radius',
$node_radius, $node_radius,
'', '',
2, 2,
10, 10,
true true
),
[ 'div_class' => 'w50p' ]
); );
$table->data[3][0] = __('Description'); $table->data[3][] = html_print_label_input_block(
$table->data[3][1] = html_print_textarea('description', 7, 25, $description, '', true); __('Description'),
html_print_textarea(
'description',
7,
25,
$description,
'',
true
)
);
echo '<form method="post" action="index.php?sec=network&amp;sec2=operation/agentes/pandora_networkmap">'; echo '<form method="post" action="index.php?sec=network&amp;sec2=operation/agentes/pandora_networkmap">';
html_print_table($table); html_print_table($table);
echo "<div style='width: ".$table->width."; text-align: right; margin-top:20px;'>";
if ($new_empty_networkmap) { if ($new_empty_networkmap) {
html_print_input_hidden('save_empty_networkmap', 1); html_print_input_hidden('save_empty_networkmap', 1);
html_print_submit_button( $titleButton = __('Save networkmap');
__('Save networkmap'),
'crt',
false,
'class="sub next"'
);
} }
if ($edit_networkmap) { if ($edit_networkmap) {
html_print_input_hidden('id_networkmap', $id); html_print_input_hidden('id_networkmap', $id);
html_print_input_hidden('update_empty_networkmap', 1); html_print_input_hidden('update_empty_networkmap', 1);
html_print_submit_button( $titleButton = __('Update networkmap');
__('Update networkmap'),
'crt',
false,
'class="sub upd"'
);
} }
html_print_action_buttons(
html_print_submit_button(
$titleButton,
'crt',
false,
['icon' => 'next'],
true
)
);
echo '</form>'; echo '</form>';
echo '</div>';
} }

View File

@ -42,7 +42,7 @@ switch ($action) {
default: default:
case 'new': case 'new':
$actionButtons = html_print_submit_button( $actionButtons = html_print_submit_button(
__('Save'), __('Create'),
'add', 'add',
false, false,
[ 'icon' => 'next' ], [ 'icon' => 'next' ],
@ -66,39 +66,26 @@ switch ($action) {
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->id = 'add_alert_table'; $table->id = 'add_alert_table';
$table->class = 'databox filters';
$table->head = []; $table->head = [];
$table->data = [];
$table->size = [];
if (is_metaconsole() === true) { if (is_metaconsole() === true) {
$table->class = 'databox filters';
$table->head[0] = __('Main data'); $table->head[0] = __('Main data');
$table->head_colspan[0] = 4; $table->head_colspan[0] = 4;
$table->headstyle[0] = 'text-align: center'; $table->headstyle[0] = 'text-align: center';
} $table->size[0] = '15%';
$table->size[1] = '90%';
$table->data = [];
$table->size = [];
$table->size = [];
$table->size[0] = '15%';
$table->size[1] = '90%';
if (is_metaconsole() === false) {
$table->style[0] = 'font-weight: bold; vertical-align: top;'; $table->style[0] = 'font-weight: bold; vertical-align: top;';
} else { } else {
$table->style[0] = 'font-weight: bold;'; $table->class = 'filter-table-adv databox';
$table->size[0] = '50%';
$table->size[1] = '50%';
$table->size[2] = '50%';
$table->size[3] = '50%';
} }
$table->data['name'][0] = __('Name');
$table->data['name'][1] = html_print_input_text(
'name',
$reportName,
__('Name'),
80,
100,
true,
false,
true
);
$table->data['group'][0] = __('Group');
$write_groups = users_get_groups_for_select( $write_groups = users_get_groups_for_select(
false, false,
'AR', 'AR',
@ -108,6 +95,36 @@ $write_groups = users_get_groups_for_select(
'id_grupo' 'id_grupo'
); );
if (is_metaconsole() === true) {
$table->data['name'][0] = __('Name');
$table->data['name'][1] = html_print_input_text(
'name',
$reportName,
__('Name'),
80,
100,
true,
false,
true
);
$table->data['group'][0] = __('Group');
} else {
$table->data[0][0] = html_print_label_input_block(
__('Name'),
html_print_input_text(
'name',
$reportName,
__('Name'),
false,
100,
true,
false,
true
)
);
}
// If the report group is not among the // If the report group is not among the
// RW groups (special permission) we add it. // RW groups (special permission) we add it.
if (isset($write_groups[$idGroupReport]) === false && $idGroupReport) { if (isset($write_groups[$idGroupReport]) === false && $idGroupReport) {
@ -120,8 +137,9 @@ if (users_can_manage_group_all('RW') === true) {
$return_all_group = true; $return_all_group = true;
} }
$table->data['group'][1] = '<div class="w290px inline">'; if (is_metaconsole() === true) {
$table->data['group'][1] .= html_print_input( $table->data['group'][1] = '<div class="w290px inline">';
$table->data['group'][1] .= html_print_input(
[ [
'type' => 'select_groups', 'type' => 'select_groups',
'id_user' => $config['id_user'], 'id_user' => $config['id_user'],
@ -135,8 +153,28 @@ $table->data['group'][1] .= html_print_input(
'return' => true, 'return' => true,
'required' => true, 'required' => true,
] ]
); );
$table->data['group'][1] .= '</div>'; $table->data['group'][1] .= '</div>';
} else {
$table->data[0][1] = html_print_label_input_block(
__('Group'),
html_print_input(
[
'type' => 'select_groups',
'id_user' => $config['id_user'],
'privilege' => 'AR',
'returnAllGroup' => $return_all_group,
'name' => 'id_group',
'selected' => $idGroupReport,
'script' => '',
'nothing' => '',
'nothing_value' => '',
'return' => true,
'required' => true,
]
)
);
}
if ($report_id_user == $config['id_user'] if ($report_id_user == $config['id_user']
|| is_user_admin($config['id_user']) || is_user_admin($config['id_user'])
@ -147,6 +185,7 @@ if ($report_id_user == $config['id_user']
'group_edit' => __('The next group can edit the report'), 'group_edit' => __('The next group can edit the report'),
'user_edit' => __('Only the user and admin user can edit the report'), 'user_edit' => __('Only the user and admin user can edit the report'),
]; ];
if (is_metaconsole() === true) {
$table->data['access'][0] = __('Write Access'); $table->data['access'][0] = __('Write Access');
$table->data['access'][0] .= ui_print_help_tip( $table->data['access'][0] .= ui_print_help_tip(
__('For example, you want a report that the people of "All" groups can see but you want to edit only for you or your group.'), __('For example, you want a report that the people of "All" groups can see but you want to edit only for you or your group.'),
@ -162,12 +201,12 @@ if ($report_id_user == $config['id_user']
true true
); );
$style = 'display: none;'; $class = ' invisible_important ';
if ($type_access_selected == 'group_edit') { if ($type_access_selected == 'group_edit') {
$style = ''; $class = '';
} }
$table->data['access'][1] .= '<span style="'.$style.'" class="access_subform" id="group_edit">'; $table->data['access'][1] .= '<span class="access_subform'.$class.'" id="group_edit">';
$table->data['access'][1] .= '<div class="w290px inline">'; $table->data['access'][1] .= '<div class="w290px inline">';
$table->data['access'][1] .= html_print_select_groups( $table->data['access'][1] .= html_print_select_groups(
false, false,
@ -182,6 +221,45 @@ if ($report_id_user == $config['id_user']
); );
$table->data['access'][1] .= '</div>'; $table->data['access'][1] .= '</div>';
$table->data['access'][1] .= '</span>'; $table->data['access'][1] .= '</span>';
} else {
$table->data[1][0] = html_print_label_input_block(
__('Write Access').ui_print_help_tip(
__('For example, you want a report that the people of "All" groups can see but you want to edit only for you or your group.'),
true
),
html_print_select(
$type_access,
'type_access',
$type_access_selected,
'change_type_access(this)',
'',
0,
true
)
);
$options['div_class'] = 'invisible_important';
$options['div_id'] = 'group_edit';
if ($type_access_selected == 'group_edit') {
$options['div_class'] = '';
}
$table->data[1][1] = html_print_label_input_block(
__('Group'),
html_print_select_groups(
false,
'RW',
false,
'id_group_edit',
$id_group_edit,
false,
'',
'',
true
),
$options
);
}
} }
if ($enterpriseEnable) { if ($enterpriseEnable) {
@ -190,6 +268,7 @@ if ($enterpriseEnable) {
$non_interactive_check = $non_interactive; $non_interactive_check = $non_interactive;
} }
if (is_metaconsole() === true) {
$table->data['interactive_report'][0] = __('Non interactive report'); $table->data['interactive_report'][0] = __('Non interactive report');
$table->data['interactive_report'][1] .= html_print_checkbox_switch( $table->data['interactive_report'][1] .= html_print_checkbox_switch(
'non_interactive', 'non_interactive',
@ -197,19 +276,45 @@ if ($enterpriseEnable) {
$non_interactive_check, $non_interactive_check,
true true
); );
} else {
$table->data[2][0] = html_print_label_input_block(
__('Non interactive report'),
html_print_checkbox_switch(
'non_interactive',
1,
$non_interactive_check,
true
)
);
}
} }
$table->data['description'][0] = __('Description'); if (is_metaconsole() === true) {
$table->data['description'][1] = html_print_textarea( $table->data['description'][0] = __('Description');
$table->data['description'][1] = html_print_textarea(
'description', 'description',
2, 2,
80, 80,
$description, $description,
'', '',
true true
); );
} else {
$table->data[2][1] = html_print_label_input_block(
__('Description'),
html_print_textarea(
'description',
2,
1,
$description,
'',
true
)
);
}
if (enterprise_installed() === true) { if (enterprise_installed() === true) {
if (is_metaconsole() === true) {
$table->data['cover'][0] = __('Generate cover page in PDF render'); $table->data['cover'][0] = __('Generate cover page in PDF render');
$table->data['cover'][1] = html_print_checkbox_switch( $table->data['cover'][1] = html_print_checkbox_switch(
'cover_page_render', 'cover_page_render',
@ -225,6 +330,27 @@ if (enterprise_installed() === true) {
$index_render, $index_render,
true true
); );
} else {
$table->data[3][0] = html_print_label_input_block(
__('Generate cover page in PDF render'),
html_print_checkbox_switch(
'cover_page_render',
1,
$cover_page_render,
true
)
);
$table->data[3][1] = html_print_label_input_block(
__('Generate index in PDF render'),
html_print_checkbox_switch(
'index_render',
1,
$index_render,
true
)
);
}
} }
echo '<form class="" method="post">'; echo '<form class="" method="post">';
@ -238,11 +364,10 @@ echo '</div></form>';
?> ?>
<script type="text/javascript"> <script type="text/javascript">
function change_type_access(select_item) { function change_type_access(select_item) {
$(".access_subform").hide();
if ($(select_item).val() == "group_edit") { if ($(select_item).val() == "group_edit") {
$("#group_edit").show() $("#group_edit").removeClass('invisible_important');
} else { } else {
$("#group_edit").hide() $("#group_edit").addClass('invisible_important');
} }
} }

View File

@ -46,35 +46,14 @@ function dialog_message(message_id) {
}); });
}); });
$('[id^=checkbox-massive_report_check]').change(function(){
if($(this).parent().parent().parent().hasClass('checkselected')){
$(this).parent().parent().parent().removeClass('checkselected');
}
else{
$(this).parent().parent().parent().addClass('checkselected');
}
});
$('[id^=checkbox-all_delete]').change(function(){ $('[id^=checkbox-all_delete]').change(function(){
if ($("#checkbox-all_delete").prop("checked")) { if ($("#checkbox-all_delete").prop("checked")) {
$('[id^=checkbox-massive_report_check]')
.parent()
.parent()
.parent()
.addClass('checkselected');
$(".check_delete").prop("checked", true); $(".check_delete").prop("checked", true);
console.log($('.check_delete'));
$('.check_delete').each(function(){ $('.check_delete').each(function(){
$('#hidden-id_report_'+$(this).val()).prop("disabled", false); $('#hidden-id_report_'+$(this).val()).prop("disabled", false);
}); });
} }
else{ else{
$('[id^=checkbox-massive_report_check]')
.parent()
.parent()
.parent()
.removeClass('checkselected');
console.log($('.check_delete'));
$(".check_delete").prop("checked", false); $(".check_delete").prop("checked", false);
} }
}); });
@ -752,9 +731,8 @@ switch ($action) {
$table_aux = new stdClass(); $table_aux = new stdClass();
$table_aux->width = '100%'; $table_aux->width = '100%';
if (is_metaconsole()) {
$table_aux->class = 'databox filters'; $table_aux->class = 'databox filters';
$table_aux->cellpadding = 0;
$table_aux->cellspacing = 0;
$table_aux->colspan[0][0] = 4; $table_aux->colspan[0][0] = 4;
$table_aux->data[0][0] = '<b>'.__('Group').'</b>'; $table_aux->data[0][0] = '<b>'.__('Group').'</b>';
@ -786,14 +764,59 @@ switch ($action) {
); );
$table_aux->data[0][2] .= '</b>'; $table_aux->data[0][2] .= '</b>';
$table_aux->data[0][3] = html_print_input_text( $table_aux->data[0][3] = html_print_input_text(
'search', __('search'),
$search, $search,
'', '',
30, 30,
'', '',
true true
); );
} else {
$table_aux->class = 'filter-table-adv';
$table_aux->size[0] = '30%';
$table_aux->size[1] = '30%';
$table_aux->size[2] = '30%';
$table_aux->data[0][0] = html_print_label_input_block(
__('Group'),
html_print_select_groups(
false,
$access,
true,
'id_group',
$id_group,
'',
'',
'',
true,
false,
true,
'',
false,
'',
false,
false,
'id_grupo'
)
);
$table_aux->data[0][1] = html_print_label_input_block(
__('Free text for search: ').ui_print_help_tip(
__('Search by report name or description, list matches.'),
true
),
html_print_input_text(
__('search'),
$search,
'',
30,
'',
true
)
);
}
if (is_metaconsole()) {
$table_aux->data[0][6] = html_print_submit_button( $table_aux->data[0][6] = html_print_submit_button(
__('Search'), __('Search'),
'search_submit', 'search_submit',
@ -801,6 +824,7 @@ switch ($action) {
'class="sub upd"', 'class="sub upd"',
true true
); );
}
$url_rb = 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder'; $url_rb = 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder';
if (is_metaconsole()) { if (is_metaconsole()) {
@ -809,9 +833,37 @@ switch ($action) {
$filter .= '</form>'; $filter .= '</form>';
ui_toggle($filter, __('Show Option')); ui_toggle($filter, __('Show Option'));
} else { } else {
echo '<form action="'.$url_rb.'&id_group='.$id_group.'&pure='.$pure.'" method="post">'; $searchForm = '<form action="'.$url_rb.'&id_group='.$id_group.'&pure='.$pure.'" method="post">';
html_print_table($table_aux); $searchForm .= html_print_table($table_aux, true);
echo '</form>'; $searchForm .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Search'),
'search_submit',
false,
[
'mode' => 'mini',
'icon' => 'search',
],
true
),
],
true
);
$searchForm .= '</form>';
ui_toggle(
$searchForm,
'<span class="subsection_header_title">'.__('Filters').'</span>',
'filter_form',
'',
false,
false,
'',
'white-box-content',
'box-flat white_table_graph fixed_filter_bar'
);
} }
ui_require_jquery_file('pandora.controls'); ui_require_jquery_file('pandora.controls');
@ -1116,7 +1168,13 @@ switch ($action) {
$data[$next] = ui_print_group_icon( $data[$next] = ui_print_group_icon(
$report['id_group'], $report['id_group'],
true true,
'',
'',
true,
false,
false,
'invert_filter'
); );
$next++; $next++;
} }

View File

@ -3022,17 +3022,30 @@ class NetworkMap
$table = new StdClass(); $table = new StdClass();
$table->id = 'node_details'; $table->id = 'node_details';
$table->class = 'filter-table-adv';
$table->width = '100%'; $table->width = '100%';
$table->data = []; $table->data = [];
$table->data[0][0] = '<strong>'.__('Agent').'</strong>';
$table->data[0][1] = ''; $table->data[0][] = html_print_label_input_block(
$table->data[1][0] = '<strong>'.__('Adresses').'</strong>'; __('Agent'),
$table->data[1][1] = ''; html_print_div(['id' => 'content_node_details-0-1'], true)
$table->data[2][0] = '<strong>'.__('OS type').'</strong>'; );
$table->data[2][1] = '';
$table->data[3][0] = '<strong>'.__('Group').'</strong>'; $table->data[0][] = html_print_label_input_block(
$table->data[3][1] = ''; __('Adresses'),
html_print_div(['id' => 'content_node_details-1-1'], true)
);
$table->data[1][] = html_print_label_input_block(
__('OS type'),
html_print_div(['id' => 'content_node_details-2-1'], true)
);
$table->data[1][] = html_print_label_input_block(
__('Group'),
html_print_div(['id' => 'content_node_details-3-1'], true)
);
$output .= ui_toggle( $output .= ui_toggle(
html_print_table($table, true), html_print_table($table, true),
@ -3071,11 +3084,13 @@ class NetworkMap
$table = new StdClass(); $table = new StdClass();
$table->id = 'node_options'; $table->id = 'node_options';
$table->class = 'filter-table-adv';
$table->width = '100%'; $table->width = '100%';
$table->data = []; $table->data = [];
$table->data[0][0] = __('Shape'); $table->data[0][] = html_print_label_input_block(
$table->data[0][1] = html_print_select( __('Shape'),
html_print_select(
[ [
'circle' => __('Circle'), 'circle' => __('Circle'),
'square' => __('Square'), 'square' => __('Square'),
@ -3087,34 +3102,56 @@ class NetworkMap
'', '',
0, 0,
true true
).'&nbsp;<span id="shape_icon_in_progress" class="invisible">'.html_print_image('images/spinner.gif', true).'</span><span id="shape_icon_correct" class="invisible">'.html_print_image('images/success.png', true, ['width' => '18px']).'</span><span id="shape_icon_fail" class="invisible">'.html_print_image('images/icono-bad.png', true, ['width' => '18px']).'</span>'; )
$table->data['node_name'][0] = __('Name'); );
$table->data['node_name'][1] = html_print_input_text(
$table->data['node_name'][] = html_print_label_input_block(
__('Name'),
html_print_input_text(
'edit_name_node', 'edit_name_node',
'', '',
__('name node'), __('name node'),
'20', '20',
'50', '50',
true true
); )
$table->data['node_name'][2] = html_print_button(
__('Update node'),
'',
false,
'',
'class="sub next"',
true
); );
$table->data['fictional_node_name'][0] = __('Name'); $table->data['fictional_node_name'][] = html_print_label_input_block(
$table->data['fictional_node_name'][1] = html_print_input_text( __('Name'),
html_print_input_text(
'edit_name_fictional_node', 'edit_name_fictional_node',
'', '',
__('name fictional node'), __('name fictional node'),
'20', '20',
'50', '50',
true true
)
); );
$table->data['fictional_node_networkmap_link'][] = html_print_label_input_block(
__('Networkmap to link'),
html_print_select(
$list_networkmaps,
'edit_networkmap_to_link',
'',
'',
'',
0,
true
)
);
$buttons = [];
$buttons[] = html_print_button(
__('Update fictional node'),
'upd_fictional_node',
false,
'',
['icon' => 'next'],
true
);
/*
$table->data['fictional_node_networkmap_link'][0] = __('Networkmap to link'); $table->data['fictional_node_networkmap_link'][0] = __('Networkmap to link');
$table->data['fictional_node_networkmap_link'][1] = html_print_select( $table->data['fictional_node_networkmap_link'][1] = html_print_select(
$list_networkmaps, $list_networkmaps,
@ -3125,18 +3162,38 @@ class NetworkMap
0, 0,
true true
); );
$table->data['fictional_node_update_button'][0] = ''; $table->data['fictional_node_update_button'][0] = '';
$table->data['fictional_node_update_button'][1] = html_print_button( $table->data['fictional_node_update_button'][1] = html_print_button(
__('Update fictional node'), __('Update fictional node'),
'', '',
false, false,
'add_fictional_node();', 'add_fictional_node();',
'class="sub next"', ['icon' => 'next'],
true
);
*/
$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' => implode('', $buttons),
],
true true
); );
$output .= ui_toggle( $output .= ui_toggle(
html_print_table($table, true), $nodeUpdateTable,
__('Node options'), __('Node options'),
__('Node options'), __('Node options'),
'', '',
@ -3210,9 +3267,9 @@ class NetworkMap
$table->data['template_row']['node_target'] = ''; $table->data['template_row']['node_target'] = '';
$table->data['template_row']['edit'] = ''; $table->data['template_row']['edit'] = '';
$table->data['template_row']['edit'] .= '<span class="edit_icon_correct" style="display: none">'.html_print_image('images/dot_green.png', true).'</span><span class="edit_icon_fail" style="display: none" >'.html_print_image('images/dot_red.png', true).'</span><span class="edit_icon_progress" style="display: none">'.html_print_image('images/spinner.gif', true).'</span>'; $table->data['template_row']['edit'] .= '<span class="edit_icon_correct" style="display: none">'.html_print_image('images/pixel_green.png', true, ['class' => 'main_menu_icon']).'</span><span class="edit_icon_fail" style="display: none" >'.html_print_image('images/dot_red.png', true).'</span><span class="edit_icon_progress" style="display: none">'.html_print_image('images/spinner.gif', true).'</span>';
// <span class="edit_icon"><a class="edit_icon_link" title="'.__('Update').'" href="#">'.html_print_image('images/config.png', true, ['class' => 'invert_filter']).'</a></span>'; // <span class="edit_icon"><a class="edit_icon_link" title="'.__('Update').'" href="#">'.html_print_image('images/config.png', true, ['class' => 'invert_filter']).'</a></span>';
$table->data['template_row']['edit'] .= '<a class="delete_icon" href="#">'.html_print_image('images/delete.png', true, ['class' => 'invert_filter']).'</a>'; $table->data['template_row']['edit'] .= '<a class="delete_icon" href="#">'.html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter', 'style' => 'padding: 10px']).'</a>';
$table->colspan['no_relations']['0'] = 5; $table->colspan['no_relations']['0'] = 5;
$table->cellstyle['no_relations']['0'] = 'text-align: center;'; $table->cellstyle['no_relations']['0'] = 'text-align: center;';
@ -3434,7 +3491,7 @@ class NetworkMap
'', '',
false, false,
'add_fictional_node();', 'add_fictional_node();',
'class="sub"', ['type' => 'link'],
true true
); );
$add_agent_node_html = html_print_table($table, true); $add_agent_node_html = html_print_table($table, true);
@ -3691,7 +3748,7 @@ class NetworkMap
$output .= '<div id="hide_labels_'.$networkmap['id'].'"'; $output .= '<div id="hide_labels_'.$networkmap['id'].'"';
$output .= ' class="absolute right_10px top_10px">'; $output .= ' class="absolute right_10px top_10px">';
$output .= '<a title="'.__('Hide Labels').'" href="javascript: hide_labels();">'; $output .= '<a title="'.__('Hide Labels').'" href="javascript: hide_labels();">';
$output .= html_print_image('/images/icono_borrar.png', true, ['id' => 'image_hide_show_labels']); $output .= html_print_image('/images/disable.svg', true, ['id' => 'image_hide_show_labels', 'class' => 'main_menu_icon invert_filter']);
$output .= '</a></div>'; $output .= '</a></div>';
$output .= '<div id="holding_spinner_'.$networkmap['id'].'" '; $output .= '<div id="holding_spinner_'.$networkmap['id'].'" ';

View File

@ -1880,10 +1880,10 @@ function html_print_extended_select_for_unit(
'font-size: xx-small;'.$select_style 'font-size: xx-small;'.$select_style
); );
echo ' <a href="javascript:">'.html_print_image( echo ' <a href="javascript:">'.html_print_image(
'images/pencil.png', 'images/edit.svg',
true, true,
[ [
'class' => $uniq_name.'_toggler', 'class' => $uniq_name.'_toggler main_menu_icon invert_filter',
'alt' => __('Custom'), 'alt' => __('Custom'),
'title' => __('Custom'), 'title' => __('Custom'),
'style' => 'width: 18px;', 'style' => 'width: 18px;',
@ -1896,10 +1896,10 @@ function html_print_extended_select_for_unit(
html_print_input_hidden($name, $selected, false, $uniq_name); html_print_input_hidden($name, $selected, false, $uniq_name);
echo ' <a href="javascript:">'.html_print_image( echo ' <a href="javascript:">'.html_print_image(
'images/default_list.png', 'images/logs@svg.svg',
true, true,
[ [
'class' => $uniq_name.'_toggler', 'class' => $uniq_name.'_toggler main_menu_icon invert_filter',
'alt' => __('List'), 'alt' => __('List'),
'title' => __('List'), 'title' => __('List'),
'style' => 'width: 18px;', 'style' => 'width: 18px;',
@ -1991,10 +1991,10 @@ function html_print_extended_select_for_post_process(
$style $style
); );
echo ' <a href="javascript:">'.html_print_image( echo ' <a href="javascript:">'.html_print_image(
'images/pencil.png', 'images/edit.svg',
true, true,
[ [
'class' => $uniq_name.'_toggler', 'class' => $uniq_name.'_toggler main_menu_icon invert_filter',
'alt' => __('Custom'), 'alt' => __('Custom'),
'title' => __('Custom'), 'title' => __('Custom'),
'style' => 'width: 18px;', 'style' => 'width: 18px;',
@ -2007,10 +2007,10 @@ function html_print_extended_select_for_post_process(
html_print_input_hidden($name, $selected, false, $uniq_name); html_print_input_hidden($name, $selected, false, $uniq_name);
echo ' <a href="javascript:">'.html_print_image( echo ' <a href="javascript:">'.html_print_image(
'images/default_list.png', 'images/logs@svg.svg',
true, true,
[ [
'class' => $uniq_name.'_toggler', 'class' => $uniq_name.'_toggler main_menu_icon invert_filter',
'alt' => __('List'), 'alt' => __('List'),
'title' => __('List'), 'title' => __('List'),
'style' => 'width: 18px;', 'style' => 'width: 18px;',
@ -2144,10 +2144,10 @@ function html_print_extended_select_for_time(
[ [
'href' => 'javascript:', 'href' => 'javascript:',
'content' => html_print_image( 'content' => html_print_image(
'images/pencil.png', 'images/edit.svg',
true, true,
[ [
'class' => $uniq_name.'_toggler '.$class.' invert_filter', 'class' => $uniq_name.'_toggler '.$class.' main_menu_icon invert_filter',
'alt' => __('Custom'), 'alt' => __('Custom'),
'title' => __('Custom'), 'title' => __('Custom'),
'style' => 'width: 18px; margin-bottom: -5px; margin-left: 10px; padding-top: 10px;'.$style_icon, 'style' => 'width: 18px; margin-bottom: -5px; margin-left: 10px; padding-top: 10px;'.$style_icon,
@ -2190,10 +2190,10 @@ function html_print_extended_select_for_time(
false false
); );
echo ' <a href="javascript:">'.html_print_image( echo ' <a href="javascript:">'.html_print_image(
'images/list.png', 'images/logs@svg.svg',
true, true,
[ [
'class' => $uniq_name.'_toggler invert_filter', 'class' => $uniq_name.'_toggler main_menu_icon invert_filter',
'alt' => __('List'), 'alt' => __('List'),
'title' => __('List'), 'title' => __('List'),
'style' => 'width: 18px;margin-bottom: -5px; padding-top: 10px;'.$style_icon, 'style' => 'width: 18px;margin-bottom: -5px; padding-top: 10px;'.$style_icon,
@ -6592,10 +6592,10 @@ function html_print_extended_select_for_downtime_cron(
'font-size: xx-small;'.$select_style 'font-size: xx-small;'.$select_style
); );
echo ' <a href="javascript:">'.html_print_image( echo ' <a href="javascript:">'.html_print_image(
'images/pencil.png', 'images/edit.svg',
true, true,
[ [
'class' => $uniq_name.'_toggler', 'class' => $uniq_name.'_toggler main_menu_icon invert_filter',
'alt' => __('Custom'), 'alt' => __('Custom'),
'title' => __('Custom'), 'title' => __('Custom'),
'style' => 'width: 18px;', 'style' => 'width: 18px;',
@ -6610,10 +6610,10 @@ function html_print_extended_select_for_downtime_cron(
html_print_input_hidden($name, $selected, false, $uniq_name); html_print_input_hidden($name, $selected, false, $uniq_name);
echo ' <a href="javascript:">'.$help_tooltip.'&nbsp'.html_print_image( echo ' <a href="javascript:">'.$help_tooltip.'&nbsp'.html_print_image(
'images/default_list.png', 'images/logs@svg.svg',
true, true,
[ [
'class' => $uniq_name.'_toggler', 'class' => $uniq_name.'_toggler main_menu_icon invert_filter',
'alt' => __('List'), 'alt' => __('List'),
'title' => __('List'), 'title' => __('List'),
'style' => 'width: 18px;', 'style' => 'width: 18px;',
@ -6745,6 +6745,7 @@ function html_print_label_input_block(
):string { ):string {
$div_class = ''; $div_class = '';
$label_class = ''; $label_class = '';
$div_id = '';
if (empty($options) === false) { if (empty($options) === false) {
if (isset($options['div_class']) === true) { if (isset($options['div_class']) === true) {

View File

@ -2535,6 +2535,7 @@ function ui_print_input_placeholder(
$attibutes[] = 'class="'.((isset($options['class']) === true) ? $options['class'] : 'input_sub_placeholder').'"'; $attibutes[] = 'class="'.((isset($options['class']) === true) ? $options['class'] : 'input_sub_placeholder').'"';
$attibutes[] = (isset($options['rawattributes']) === true) ? $options['rawattributes'] : ''; $attibutes[] = (isset($options['rawattributes']) === true) ? $options['rawattributes'] : '';
$attibutes[] = (isset($options['style']) === true) ? 'style="'.$options['style'].'"' : ''; $attibutes[] = (isset($options['style']) === true) ? 'style="'.$options['style'].'"' : '';
$attibutes[] = (isset($options['id']) === true) ? 'id="'.$options['id'].'"' : '';
$attibutes[] = (isset($options['title']) === true) ? 'title="'.$options['title'].'"' : ''; $attibutes[] = (isset($options['title']) === true) ? 'title="'.$options['title'].'"' : '';
$output = sprintf( $output = sprintf(

View File

@ -839,6 +839,11 @@ function edit_node(data_node, dblClick) {
"onclick", "onclick",
"update_fictional_node(" + node_selected.id_db + ");" "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( $("#node_options-node_name-2 input").attr(
"onclick", "onclick",
@ -846,9 +851,9 @@ function edit_node(data_node, dblClick) {
); );
if (node_selected.type === "3") { if (node_selected.type === "3") {
$("#node_details-0-0").html("<strong>Link to map</strong>"); $("#node_details-0-0").html("Link to map");
if (node_selected.networkmap_id > 0) { if (node_selected.networkmap_id > 0) {
$("#node_details-0-1").html( $("#node_details-0-1 div").html(
'<a href="index.php?sec=network&sec2=operation/agentes/pandora_networkmap&tab=view&id_networkmap=' + '<a href="index.php?sec=network&sec2=operation/agentes/pandora_networkmap&tab=view&id_networkmap=' +
node_selected.networkmap_id + node_selected.networkmap_id +
'">' + '">' +
@ -858,7 +863,7 @@ function edit_node(data_node, dblClick) {
"</a>" "</a>"
); );
} else { } else {
$("#node_details-0-1").html( $("#node_details-0-1 div").html(
$( $(
`#edit_networkmap_to_link option[value='${node_selected.networkmap_id}']` `#edit_networkmap_to_link option[value='${node_selected.networkmap_id}']`
).text() ).text()
@ -869,7 +874,7 @@ function edit_node(data_node, dblClick) {
$("#node_details-2").hide(); $("#node_details-2").hide();
$("#node_details-3").hide(); $("#node_details-3").hide();
} else { } else {
$("#node_details-0-0").html("<strong>Agent</strong>"); //$("#node_details-0-0").html("Agent");
$("#node_details-1").show(); $("#node_details-1").show();
$("#node_details-2").show(); $("#node_details-2").show();
$("#node_details-3").show(); $("#node_details-3").show();
@ -885,7 +890,7 @@ function edit_node(data_node, dblClick) {
type: "POST", type: "POST",
url: window.base_url_homedir + "/ajax.php", url: window.base_url_homedir + "/ajax.php",
success: function(data) { success: function(data) {
$("#node_details-0-1").html( $("#content_node_details-0-1").html(
'<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' + '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' +
node_selected["id_agent"] + node_selected["id_agent"] +
'">' + '">' +
@ -903,9 +908,9 @@ function edit_node(data_node, dblClick) {
addresses += address + "<br>"; addresses += address + "<br>";
} }
} }
$("#node_details-1-1").html(addresses); $("#content_node_details-1-1").html(addresses);
$("#node_details-2-1").html(data["os"]); $("#content_node_details-2-1").html(data["os"]);
$("#node_details-3-1").html(data["group"]); $("#content_node_details-3-1").html(data["group"]);
$("[aria-describedby=dialog_node_edit]").css({ top: "200px" }); $("[aria-describedby=dialog_node_edit]").css({ top: "200px" });
$("#foot").css({ $("#foot").css({
@ -934,18 +939,22 @@ function edit_node(data_node, dblClick) {
//Fictional node //Fictional node
$("#node_options-fictional_node_name").css("display", ""); $("#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 $("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").val(node_selected.networkmap_id);
$("#edit_networkmap_to_link").trigger("change"); $("#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_name").css("display", "none");
$("#node_options-node_update_button").css("display", "none"); $("#button-upd_only_node").css("display", "none");
} else { } else {
$("input[name='edit_name_node']").val(node_selected.text); // It doesn't eval the possible XSS so it's ok $("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_name").css("display", "none");
$("#node_options-fictional_node_networkmap_link").css("display", "none"); $("#node_options-fictional_node_networkmap_link-0").css(
$("#node_options-fictional_node_update_button").css("display", "none"); "display",
"none"
);
$("#node_options-node_name").css("display", ""); $("#node_options-node_name").css("display", "");
$("#button-upd_fictional_node").css("display", "none");
$("#button-upd_only_node").css("display", "");
} }
//Clean //Clean
@ -1184,9 +1193,15 @@ function load_interfaces(selected_links) {
$("#relations_table") $("#relations_table")
.parent() .parent()
.append( .append(
`<div class='action-buttons w100p'> `
<input id='update_relations_button' class='sub upd' type='button' value='update relations'> <div class='action-buttons w100p'>
</div>` <button id="update_relations_button" type="button" class="buttonButton" value="Update relations">
<span id="span-button-unnamed" class="font_11">
Update relations
</span>
<div style="" class="subIcon next "></div>
</button>
`
); );
$("#update_relations_button").click(function() { $("#update_relations_button").click(function() {
@ -1341,7 +1356,7 @@ function hide_labels_function() {
$("#hide_labels_" + networkmap_id + " > a").attr("title", "Show Labels"); $("#hide_labels_" + networkmap_id + " > a").attr("title", "Show Labels");
$("#hide_labels_" + networkmap_id + " > a > img").attr( $("#hide_labels_" + networkmap_id + " > a > img").attr(
"src", "src",
window.location.origin + "/pandora_console/images/icono_pintar.png" window.location.origin + "/pandora_console/images/enable.svg"
); );
d3.selectAll(".node_text").style("display", "none"); d3.selectAll(".node_text").style("display", "none");
@ -1354,7 +1369,7 @@ function show_labels_function() {
$("#hide_labels_" + networkmap_id + " > a").attr("title", "Hide Labels"); $("#hide_labels_" + networkmap_id + " > a").attr("title", "Hide Labels");
$("#hide_labels_" + networkmap_id + " > a > img").attr( $("#hide_labels_" + networkmap_id + " > a > img").attr(
"src", "src",
window.location.origin + "/pandora_console/images//icono_borrar.png" window.location.origin + "/pandora_console/images/disable.svg"
); );
d3.selectAll(".node_text").style("display", ""); d3.selectAll(".node_text").style("display", "");

View File

@ -613,7 +613,9 @@ function snmp_browser_create_modules(module_target, return_post = true) {
var oids = []; var oids = [];
id_check.forEach(function(product, index) { id_check.forEach(function(product, index) {
var oid = $("#" + product) var oid = $("#" + product)
.siblings("a") .parent()
.parent()
.find("a")
.attr("href"); .attr("href");
if (oid.indexOf('javascript: snmpGet("') != -1) { if (oid.indexOf('javascript: snmpGet("') != -1) {
oid = oid.replace('javascript: snmpGet("', ""); oid = oid.replace('javascript: snmpGet("', "");
@ -657,23 +659,29 @@ function snmp_browser_create_modules(module_target, return_post = true) {
params["page"] = "include/ajax/snmp_browser.ajax"; params["page"] = "include/ajax/snmp_browser.ajax";
params["snmp_extradata"] = snmp_data; params["snmp_extradata"] = snmp_data;
$("input[name=create_modules_" + module_target + "]").removeClass( $("button[name=create_modules_" + module_target + "]").removeClass(
"sub add" "sub add"
); );
$("input[name=create_modules_" + module_target + "]").addClass("sub spinn"); $("button[name=create_modules_" + module_target + "]").addClass(
$("#dialog_error").on("dialogclose", function(event) {
$("input[name=create_modules_" + module_target + "]").removeClass(
"sub spinn" "sub spinn"
); );
$("input[name=create_modules_" + module_target + "]").addClass("sub add");
$("#dialog_error").on("dialogclose", function(event) {
$("button[name=create_modules_" + module_target + "]").removeClass(
"sub spinn"
);
$("button[name=create_modules_" + module_target + "]").addClass(
"sub add"
);
}); });
$("#dialog_success").on("dialogclose", function(event) { $("#dialog_success").on("dialogclose", function(event) {
$("input[name=create_modules_" + module_target + "]").removeClass( $("button[name=create_modules_" + module_target + "]").removeClass(
"sub spinn" "sub spinn"
); );
$("input[name=create_modules_" + module_target + "]").addClass("sub add"); $("button[name=create_modules_" + module_target + "]").addClass(
"sub add"
);
}); });
$.ajax({ $.ajax({

View File

@ -1806,6 +1806,7 @@ div.title_line {
#menu_tab { #menu_tab {
margin-right: 20px; margin-right: 20px;
margin-top: 50px;
} }
#menu_tab .mn, #menu_tab .mn,
@ -8075,6 +8076,7 @@ div.graph div.legend table {
.networkconsole { .networkconsole {
width: 100%; width: 100%;
height: 100%; height: 100%;
min-height: 460px;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
background-color: #fafafa; background-color: #fafafa;
@ -9879,6 +9881,11 @@ div#err_msg_centralised {
font-style: italic; font-style: italic;
} }
.div-4-col {
flex: 25%;
display: flex;
flex-direction: column;
}
.div-col { .div-col {
width: 33%; width: 33%;
display: flex; display: flex;
@ -10555,7 +10562,8 @@ table#simple tr td,
table#advanced tr td, table#advanced tr td,
table.principal_table tr td, table.principal_table tr td,
.white_table_flex > table tr td, .white_table_flex > table tr td,
.table_section table tr td { .table_section table tr td,
#agent_controls {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
@ -11287,7 +11295,11 @@ form#satellite_conf_edit > fieldset.full-column {
.input_sub_placeholder { .input_sub_placeholder {
font-size: 8pt; font-size: 8pt;
color: #8a96a6; color: #8a96a6;
/*font-family: "lato";*/ }
.input_sub_placeholder_warning {
color: #ffb900;
font-style: italic;
} }
#principal_action_buttons input, #principal_action_buttons input,
@ -11371,3 +11383,13 @@ div[role="dialog"] {
.display-grid { .display-grid {
display: grid; display: grid;
} }
.flex-colum-center {
display: flex;
flex-direction: column;
align-items: center;
}
.flex-colum-center > img {
margin: 5px;
}

View File

@ -14,7 +14,7 @@
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
* *
* ============================================================================ * ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas * Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list * Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -204,15 +204,15 @@ if ($edit_networkmap) {
} }
$button = []; $button = [];
if ($edit_networkmap) { if ($edit_networkmap === true) {
$button['map'] = [ $button['map'] = [
'active' => false, 'active' => false,
'text' => '<a href="index.php?sec=network&sec2=operation/agentes/pandora_networkmap&tab=view&id_networkmap='.$id.'">'.html_print_image( 'text' => '<a href="index.php?sec=network&sec2=operation/agentes/pandora_networkmap&tab=view&id_networkmap='.$id.'">'.html_print_image(
'images/op_network.png', 'images/network@svg.svg',
true, true,
[ [
'title' => __('View map'), 'title' => __('View map'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>', ).'</a>',
]; ];
@ -292,30 +292,19 @@ if ($not_found) {
); );
} }
$table = new stdClass(); $methods = [
$table->id = 'form_editor'; 'twopi' => 'radial',
'dot' => 'flat',
'circo' => 'circular',
'neato' => 'spring1',
'fdp' => 'spring2',
'radial_dinamic' => 'radial dynamic',
];
$table->width = '98%'; $itemClass = '';
$table->class = 'databox_color'; if ($disabled_source === true) {
$itemClass = 'disabled';
$table->head = []; }
$table->size = [];
$table->size[0] = '30%';
$table->style = [];
$table->style[0] = 'font-weight: bold; width: 150px;';
$table->data = [];
$table->data[0][0] = __('Name');
$table->data[0][1] = html_print_input_text(
'name',
$name,
'',
30,
100,
true
);
$return_all_group = false; $return_all_group = false;
@ -323,8 +312,37 @@ if ($not_found) {
$return_all_group = true; $return_all_group = true;
} }
$table->data[1][0] = __('Group'); if (empty($scale_z) === true) {
$table->data[1][1] = '<div class="w250px">'.html_print_select_groups( $scale_z = 0.5;
}
$table = new stdClass();
$table->id = 'form_editor';
$table->width = '100%';
$table->class = 'databox filter-table-adv max_floating_element_size';
$table->head = [];
$table->size = [];
$table->style = [];
$table->style[0] = 'width: 50%';
$table->style[1] = 'width: 50%';
$table->colspan[1][0] = 2;
$table->data = [];
$table->data[0][] = html_print_label_input_block(
__('Name'),
html_print_input_text(
'name',
$name,
'',
30,
100,
true
)
);
$table->data[0][] = html_print_label_input_block(
__('Group'),
html_print_select_groups(
// Id_user. // Id_user.
$config['id_user'], $config['id_user'],
// Privilege. // Privilege.
@ -343,42 +361,69 @@ if ($not_found) {
'', '',
// Return. // Return.
true true
).'</div>'; )
$table->data[2][0] = __('Node radius');
$table->data[2][1] = html_print_input_text(
'node_radius',
$node_radius,
'',
2,
10,
true
); );
$table->data[3][0] = __('Description'); $table->data[1][] = html_print_label_input_block(
$table->data[3][1] = html_print_input_text( __('Description'),
html_print_input_text(
'description', 'description',
$description, $description,
'', '',
100, 100,
100, 100,
true true
)
); );
$table->data[4][0] = __('Position X'); $divLittleFields = [];
$table->data[4][1] = html_print_input_text('pos_x', $offset_x, '', 2, 10, true); $divLittleFields[] = html_print_label_input_block(
$table->data[5][0] = __('Position Y'); __('Position X'),
$table->data[5][1] = html_print_input_text('pos_y', $offset_y, '', 2, 10, true); html_print_input_text('pos_x', $offset_x, '', 10, 10, true, false, false, '', 'w50p'),
[ 'div_class' => 'div-4-col' ]
);
$table->data[6][0] = __('Zoom scale'); $divLittleFields[] = html_print_label_input_block(
if ($scale_z == '') { __('Position Y'),
$scale_z = 0.5; html_print_input_text('pos_y', $offset_y, '', 10, 10, true, false, false, '', 'w50p'),
} [ 'div_class' => 'div-4-col' ]
);
$table->data[6][1] = html_print_input_text('scale_z', $scale_z, '', 2, 10, true).ui_print_help_tip(__('Introduce zoom level. 1 = Highest resolution. Figures may include decimals'), true); $divLittleFields[] = html_print_label_input_block(
__('Zoom scale'),
html_print_input_text('scale_z', $scale_z, '', 10, 10, true, false, false, '', 'w50p').ui_print_input_placeholder(__('Introduce zoom level. 1 = Highest resolution. Figures may include decimals'), true),
[ 'div_class' => 'div-4-col' ]
);
$table->data['source'][0] = __('Source'); $divLittleFields[] = html_print_label_input_block(
$table->data['source'][1] = html_print_select( __('Node radius'),
html_print_input_text(
'node_radius',
$node_radius,
'',
10,
10,
true,
false,
false,
'',
'w50p'
),
[ 'div_class' => 'div-4-col' ]
);
$table->colspan[2][0] = 2;
$table->data[2][0] = html_print_div(
[
'style' => 'flex-direction: row;',
'content' => implode('', $divLittleFields),
],
true
);
$table->data['source'][] = html_print_label_input_block(
__('Source'),
html_print_select(
[ [
'group' => __('Group'), 'group' => __('Group'),
'recon_task' => __('Discovery task'), 'recon_task' => __('Discovery task'),
@ -394,14 +439,48 @@ if ($not_found) {
false, false,
'', '',
$disabled_source $disabled_source
)
); );
$table->data['source_data_recon_task'][0] = __('Source from recon task'); $table->data['source_data_group'][] = html_print_label_input_block(
$table->data['source_data_recon_task'][0] .= ui_print_help_tip( __('Source group'),
__('It is setted any recon task, the nodes get from the recontask IP mask instead from the group.'), html_print_select_groups(
$config['id_user'],
'AR',
true,
'id_group[]',
explode(',', $id_group),
'',
'',
'',
true,
true true
).ui_print_input_placeholder(
__('Source id group changed. All elements in networkmap will be lost.'),
true,
[
'class' => 'input_sub_placeholder input_sub_placeholder_warning',
'style' => 'display: none',
'id' => 'group_change_warning',
]
)
); );
$table->data['source_data_recon_task'][1] = html_print_select(
$table->data['source_data_group'][] = html_print_label_input_block(
__('Don\'t show subgroups:'),
html_print_checkbox(
'dont_show_subgroups',
'1',
$dont_show_subgroups,
true,
$disabled_source
)
);
$table->data['source_data_recon_task'][] = html_print_label_input_block(
__('Source from recon task'),
html_print_select(
$list_recon_tasks, $list_recon_tasks,
'recon_task_id', 'recon_task_id',
$recon_task_id, $recon_task_id,
@ -413,67 +492,29 @@ if ($not_found) {
true, true,
'', '',
$disabled_source $disabled_source
); ).ui_print_input_placeholder(
$table->data['source_data_recon_task'][1] .= ui_print_help_tip( __('It is setted any recon task, the nodes get from the recontask IP mask instead from the group.'),
__('Show only the task with the recon script "SNMP L2 Recon".'),
true true
)
); );
$table->data['source_data_ip_mask'][0] = __('Source from CIDR IP mask'); $table->data['source_data_ip_mask'][] = html_print_label_input_block(
$table->data['source_data_ip_mask'][1] = html_print_textarea( __('Source from CIDR IP mask'),
html_print_textarea(
'ip_mask', 'ip_mask',
3, 3,
5, 5,
$ip_mask, $ip_mask,
'style="width: 238px"', 'style="width: 100%"',
true, true,
'', '',
$disabled_source $disabled_source
)
); );
$table->data['source_data_group'][0] = __('Source group'); $table->data[7][] = html_print_label_input_block(
$table->data['source_data_group'][1] = '<div class="w250px">'.html_print_select_groups( __('Method generation networkmap'),
$config['id_user'], html_print_select(
'AR',
true,
'id_group[]',
explode(',', $id_group),
'',
'',
'',
true,
true
).'</div>';
$table->data['source_data_group'][1] .= html_print_image(
'images/error.png',
true,
[
'id' => 'group_change_warning',
'title' => __('Source id group changed. All elements in networkmap will be lost.'),
'style' => 'display : none',
]
);
$table->data['source_data_dont_show_subgroups'][0] = __('Don\'t show subgroups:');
$table->data['source_data_dont_show_subgroups'][1] = html_print_checkbox(
'dont_show_subgroups',
'1',
$dont_show_subgroups,
true,
$disabled_source
);
$methods = [
'twopi' => 'radial',
'dot' => 'flat',
'circo' => 'circular',
'neato' => 'spring1',
'fdp' => 'spring2',
'radial_dinamic' => 'radial dynamic',
];
$table->data[7][0] = __('Method generation networkmap');
$table->data[7][1] = html_print_select(
$methods, $methods,
'method', 'method',
$method, $method,
@ -485,27 +526,32 @@ if ($not_found) {
true, true,
'', '',
$disabled_generation_method_select $disabled_generation_method_select
)
); );
$itemClass = ''; $table->data['nodesep'][] = html_print_label_input_block(
if ($disabled_source) { __('Node separation'),
$itemClass = 'disabled'; html_print_input_text('node_sep', $node_sep, '', 5, 10, true, $disabled_source, false, $itemClass).ui_print_input_placeholder(__('Separation between nodes. By default 0.25'), true)
} );
$table->data['nodesep'][0] = __('Node separation'); $table->data['ranksep'][] = html_print_label_input_block(
$table->data['nodesep'][1] = html_print_input_text('node_sep', $node_sep, '', 5, 10, true, $disabled_source, false, $itemClass).ui_print_help_tip(__('Separation between nodes. By default 0.25'), true); __('Rank separation'),
html_print_input_text('rank_sep', $rank_sep, '', 5, 10, true, $disabled_source, false, $itemClass).ui_print_input_placeholder(__('Only flat and radial. Separation between arrows. By default 0.5 in flat and 1.0 in radial'), true)
);
$table->data['ranksep'][0] = __('Rank separation'); $table->data['mindist'][] = html_print_label_input_block(
$table->data['ranksep'][1] = html_print_input_text('rank_sep', $rank_sep, '', 5, 10, true, $disabled_source, false, $itemClass).ui_print_help_tip(__('Only flat and radial. Separation between arrows. By default 0.5 in flat and 1.0 in radial'), true); __('Min nodes dist'),
html_print_input_text('mindist', $mindist, '', 5, 10, true, $disabled_source, false, $itemClass).ui_print_input_placeholder(__('Only circular. Minimum separation between all nodes. By default 1.0'), true)
);
$table->data['mindist'][0] = __('Min nodes dist'); $table->data['kval'][] = html_print_label_input_block(
$table->data['mindist'][1] = html_print_input_text('mindist', $mindist, '', 5, 10, true, $disabled_source, false, $itemClass).ui_print_help_tip(__('Only circular. Minimum separation between all nodes. By default 1.0'), true); __('Default ideal node separation'),
html_print_input_text('kval', $kval, '', 5, 10, true, $disabled_source, false, $itemClass).ui_print_input_placeholder(__('Only fdp. Default ideal node separation in the layout. By default 0.3'), true)
);
$table->data['kval'][0] = __('Default ideal node separation'); $table->data['refresh'][] = html_print_label_input_block(
$table->data['kval'][1] = html_print_input_text('kval', $kval, '', 5, 10, true, $disabled_source, false, $itemClass).ui_print_help_tip(__('Only fdp. Default ideal node separation in the layout. By default 0.3'), true); __('Refresh'),
html_print_extended_select_for_time(
$table->data['refresh'][0] = __('Refresh');
$table->data['refresh'][1] = html_print_extended_select_for_time(
'refresh_time', 'refresh_time',
$refresh_time, $refresh_time,
'', '',
@ -515,36 +561,52 @@ if ($not_found) {
true, true,
false, false,
false false
)
); );
echo '<form id="networkmap_options_form" method="post" action="index.php?sec=network&amp;sec2=operation/agentes/pandora_networkmap">'; echo '<form id="networkmap_options_form" method="post" action="index.php?sec=network&amp;sec2=operation/agentes/pandora_networkmap">';
html_print_table($table); html_print_table($table);
echo "<div style='width: ".$table->width."; text-align: right; margin-top:20px;'>"; $actionButtons = [];
if ($new_networkmap) {
if ($new_networkmap === true) {
html_print_input_hidden('save_networkmap', 1); html_print_input_hidden('save_networkmap', 1);
html_print_submit_button( $actionButtons[] = html_print_submit_button(
__('Save networkmap'), __('Save networkmap'),
'crt', 'crt',
false, false,
'class="sub next" onclick="if (typeof(sent) == \'undefined\') {sent = 1; return true;} else {return false;}"' [
'onClick' => 'if (typeof(sent) == \'undefined\') {sent = 1; return true;} else {return false;}',
'icon' => 'next',
],
true
); );
} }
if ($edit_networkmap) { if ($edit_networkmap === true) {
html_print_input_hidden('id_networkmap', $id); html_print_input_hidden('id_networkmap', $id);
html_print_input_hidden('update_networkmap', 1); html_print_input_hidden('update_networkmap', 1);
html_print_submit_button( $actionButtons[] = html_print_submit_button(
__('Update networkmap'), __('Update networkmap'),
'crt', 'crt',
false, false,
'class="sub upd"' [ 'icon' => 'update'],
true
); );
} }
$actionButtons[] = html_print_go_back_button(
'index.php?sec=networkmapconsole&sec2=operation/agentes/pandora_networkmap',
['button_class' => ''],
true
);
html_print_action_buttons(
$actionButtons
);
echo '</form>'; echo '</form>';
echo '</div>';
} }
?> ?>
<script type="text/javascript"> <script type="text/javascript">

View File

@ -685,29 +685,22 @@ switch ($tab) {
$table->class = 'info_table'; $table->class = 'info_table';
$table->cellpadding = 0; $table->cellpadding = 0;
$table->cellspacing = 0; $table->cellspacing = 0;
$table->headstyle['copy'] = 'text-align: center;'; $table->headstyle['actions'] = 'text-align: right;';
$table->headstyle['edit'] = 'text-align: center;';
$table->style = []; $table->style = [];
$table->style['name'] = ''; $table->style['name'] = '';
$table->style['nodes'] = 'text-align: center;'; $table->style['nodes'] = 'text-align: left;';
$table->style['groups'] = 'text-align: left;'; $table->style['groups'] = 'text-align: left;';
if ($networkmaps_write === true || $networkmaps_manage === true) { if ($networkmaps_write === true || $networkmaps_manage === true) {
$table->style['copy'] = 'text-align: center;'; $table->style['actions'] = 'text-align: right;';
$table->style['edit'] = 'text-align: center;';
$table->style['delete'] = 'text-align: center;';
} }
$table->size = []; $table->size = [];
$table->size['name'] = '60%'; $table->size['name'] = '40%';
$table->size['nodes'] = '30px'; $table->size['nodes'] = '15%';
$table->size['groups'] = '400px'; $table->size['groups'] = '400px';
if ($networkmaps_write === true || $networkmaps_manage === true) { if ($networkmaps_write === true || $networkmaps_manage === true) {
$table->size['copy'] = '30px'; $table->size['actions'] = '10%';
$table->size['edit'] = '30px';
$table->size['delete'] = '30px';
} }
$table->head = []; $table->head = [];
@ -716,9 +709,7 @@ switch ($tab) {
$table->head['groups'] = __('Groups'); $table->head['groups'] = __('Groups');
if ($networkmaps_write === true || $networkmaps_manage === true) { if ($networkmaps_write === true || $networkmaps_manage === true) {
$table->head['copy'] = __('Copy'); $table->head['actions'] = __('Actions');
$table->head['edit'] = __('Edit');
$table->head['delete'] = __('Delete');
} }
$id_groups = array_keys(users_get_groups()); $id_groups = array_keys(users_get_groups());
@ -796,27 +787,52 @@ switch ($tab) {
$data['groups'] = ui_print_group_icon($network_map['id_group_map'], true); $data['groups'] = ui_print_group_icon($network_map['id_group_map'], true);
$data['copy'] = ''; $data['actions'] = '';
$data['edit'] = '';
$data['delete'] = '';
if ($networkmap_write || $networkmap_manage) { if ($networkmap_write || $networkmap_manage) {
$table->cellclass[] = [ $tableActionButtons = [];
'copy' => 'table_action_buttons',
'edit' => 'table_action_buttons', $tableActionButtons[] = html_print_anchor(
'delete' => 'table_action_buttons', [
]; 'title' => __('Copy'),
$data['copy'] = '<a href="index.php?'.'sec=network&'.'sec2=operation/agentes/pandora_networkmap&amp;'.'copy_networkmap=1&'.'id_networkmap='.$network_map['id'].'" alt="'.__('Copy').'">'.html_print_image('images/copy.png', true, ['class' => 'invert_filter']).'</a>'; 'href' => 'index.php?sec=network&sec2=operation/agentes/pandora_networkmap&amp;copy_networkmap=1&id_networkmap='.$network_map['id'],
$data['edit'] = '<a href="index.php?'.'sec=network&'.'sec2=operation/agentes/pandora_networkmap&'.'tab=edit&'.'edit_networkmap=1&'.'id_networkmap='.$network_map['id'].'" alt="'.__('Config').'">'.html_print_image('images/config.png', true, ['class' => 'invert_filter']).'</a>'; 'content' => html_print_image('images/copy.svg', true, ['class' => 'main_menu_icon invert_filter']),
$data['delete'] = '<a href="index.php?'.'sec=network&'.'sec2=operation/agentes/pandora_networkmap&'.'delete=1&'.'id_networkmap='.$network_map['id'].'" alt="'.__('Delete').'" onclick="javascript: if (!confirm(\''.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['class' => 'invert_filter']).'</a>'; ],
true
);
$tableActionButtons[] = html_print_anchor(
[
'title' => __('Edit'),
'href' => 'index.php?sec=network&sec2=operation/agentes/pandora_networkmap&tab=edit&edit_networkmap=1&id_networkmap='.$network_map['id'],
'content' => html_print_image('images/edit.svg', true, ['class' => 'main_menu_icon invert_filter']),
],
true
);
$tableActionButtons[] = html_print_anchor(
[
'title' => __('Delete'),
'href' => 'index.php?sec=network&sec2=operation/agentes/pandora_networkmap&delete=1&id_networkmap='.$network_map['id'],
'content' => html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter']),
],
true
);
$data['actions'] = html_print_div(
[
'class' => 'table_action_buttons',
'content' => implode('', $tableActionButtons),
],
true
);
} }
$table->data[] = $data; $table->data[] = $data;
} }
ui_pagination($count_maps, false, $offset);
html_print_table($table); html_print_table($table);
ui_pagination($count_maps, false, 0, 0, false, 'offset', true, 'pagination-bottom'); $tablePagination = ui_pagination($count_maps, false, 0, 0, true, 'offset', false);
} else { } else {
ui_print_info_message(['no_close' => true, 'message' => __('There are no maps defined.') ]); ui_print_info_message(['no_close' => true, 'message' => __('There are no maps defined.') ]);
} }
@ -829,20 +845,12 @@ switch ($tab) {
echo '<form id="empty_networkmap" method="post" action="index.php?sec=network&amp;sec2=operation/agentes/pandora_networkmap">'; echo '<form id="empty_networkmap" method="post" action="index.php?sec=network&amp;sec2=operation/agentes/pandora_networkmap">';
html_print_input_hidden('new_empty_networkmap', 1); html_print_input_hidden('new_empty_networkmap', 1);
echo '</form>'; echo '</form>';
html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(__('Create network map'), 'crt', false, [ 'icon' => 'next', 'form' => 'new_networkmap' ], true).html_print_submit_button(__('Create empty network map'), 'crt', false, [ 'icon' => 'next', 'form' => 'empty_networkmap' ], true),
],
false
);
/*
echo "<div style='width: ".$table->width."; margin-top: 5px;' class='action-buttons'>";
html_print_submit_button(__('Create network map'), 'crt', false, 'class="sub next"');
html_print_submit_button(__('Create empty network map'), 'crt', false, 'class="sub next"');
echo '</div>';
*/
} }
html_print_action_buttons(
html_print_submit_button(__('Create network map'), 'crt', false, [ 'icon' => 'next', 'form' => 'new_networkmap' ], true).html_print_submit_button(__('Create empty network map'), 'crt', false, [ 'icon' => 'next', 'form' => 'empty_networkmap' ], true),
[ 'right_content' => $tablePagination ],
);
break; break;
} }

View File

@ -14,7 +14,7 @@
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
* *
* ============================================================================ * ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas * Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list * Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -124,7 +124,7 @@ if (is_ajax() === true) {
$table = new StdClass(); $table = new StdClass();
$table->id = 'form_editor'; $table->id = 'form_editor';
$table->width = '98%'; $table->width = '100%';
$table->class = 'databox_color'; $table->class = 'databox_color';
$table->head = []; $table->head = [];
$table->size = []; $table->size = [];
@ -1264,7 +1264,7 @@ if (is_ajax() === true) {
$id_group = agents_get_agent_group($id_agent); $id_group = agents_get_agent_group($id_agent);
$return['group'] = db_get_value('nombre', 'tgrupo', 'id_grupo', $id_group); $return['group'] = db_get_value('nombre', 'tgrupo', 'id_grupo', $id_group);
$id_os = agents_get_os($id_agent); $id_os = agents_get_os($id_agent);
$return['os'] = ui_print_os_icon($id_os, true, true); $return['os'] = html_print_div([ 'class' => 'flex main_menu_icon invert_filter', 'content' => ui_print_os_icon($id_os, true, true)], true);
echo json_encode($return); echo json_encode($return);
@ -1526,7 +1526,7 @@ if (is_ajax() === true) {
$id_group = agents_get_agent_group($id_agent); $id_group = agents_get_agent_group($id_agent);
$return['group'] = db_get_value('nombre', 'tgrupo', 'id_grupo', $id_group); $return['group'] = db_get_value('nombre', 'tgrupo', 'id_grupo', $id_group);
$id_os = agents_get_os($id_agent); $id_os = agents_get_os($id_agent);
$return['os'] = ui_print_os_icon($id_os, true, true); $return['os'] = html_print_div([ 'class' => 'flex main_menu_icon invert_filter', 'content' => ui_print_os_icon($id_os, true, true)], true);
echo json_encode($return); echo json_encode($return);
@ -2341,11 +2341,11 @@ if ($networkmap === false) {
$buttons['screen'] = [ $buttons['screen'] = [
'active' => false, 'active' => false,
'text' => '<a href="index.php?sec=networkmapconsole&amp;sec2=operation/agentes/pandora_networkmap&amp;tab=view&amp;id_networkmap='.$id.'">'.html_print_image( 'text' => '<a href="index.php?sec=networkmapconsole&amp;sec2=operation/agentes/pandora_networkmap&amp;tab=view&amp;id_networkmap='.$id.'">'.html_print_image(
'images/normal_screen.png', 'images/exit_fullscreen@svg.svg',
true, true,
[ [
'title' => __('Normal screen'), 'title' => __('Normal screen'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>', ).'</a>',
]; ];
@ -2358,33 +2358,33 @@ if ($networkmap === false) {
$buttons['screen'] = [ $buttons['screen'] = [
'active' => false, 'active' => false,
'text' => '<a href="index.php?sec=networkmapconsole&amp;sec2=operation/agentes/pandora_networkmap&amp;pure=1&amp;tab=view&amp;id_networkmap='.$id.'">'.html_print_image( 'text' => '<a href="index.php?sec=networkmapconsole&amp;sec2=operation/agentes/pandora_networkmap&amp;pure=1&amp;tab=view&amp;id_networkmap='.$id.'">'.html_print_image(
'images/full_screen.png', 'images/fullscreen@svg.svg',
true, true,
[ [
'title' => __('Full screen'), 'title' => __('Full screen'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>', ).'</a>',
]; ];
$buttons['list'] = [ $buttons['list'] = [
'active' => false, 'active' => false,
'text' => '<a href="index.php?sec=networkmapconsole&amp;sec2=operation/agentes/pandora_networkmap">'.html_print_image( 'text' => '<a href="index.php?sec=networkmapconsole&amp;sec2=operation/agentes/pandora_networkmap">'.html_print_image(
'images/list.png', 'images/file-collection@svg.svg',
true, true,
[ [
'title' => __('List of networkmap'), 'title' => __('List of networkmap'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>', ).'</a>',
]; ];
$buttons['option'] = [ $buttons['option'] = [
'active' => false, 'active' => false,
'text' => '<a href="index.php?sec=network&sec2=operation/agentes/pandora_networkmap&tab=edit&edit_networkmap=1&id_networkmap='.$id.'">'.html_print_image( 'text' => '<a href="index.php?sec=network&sec2=operation/agentes/pandora_networkmap&tab=edit&edit_networkmap=1&id_networkmap='.$id.'">'.html_print_image(
'images/setup.png', 'images/edit.svg',
true, true,
[ [
'title' => __('Options'), 'title' => __('Options'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>', ).'</a>',
]; ];
@ -2396,16 +2396,23 @@ if ($networkmap === false) {
} }
if (!$dash_mode) { if (!$dash_mode) {
ui_print_page_header( ui_print_standard_header(
$networkmap['name'], $networkmap['name'],
'images/bricks.png', 'images/bricks.png',
false, false,
'network_map_enterprise_view', 'network_map_enterprise_view',
false, false,
$buttons, $buttons,
false, [
'', [
$config['item_title_size_text'] 'link' => '',
'label' => __('Topology maps'),
],
[
'link' => '',
'label' => __('Network maps'),
],
]
); );
} }

View File

@ -111,7 +111,7 @@ $(document).on('DOMSubtreeModified', "#snmp_create_module", function() {
}); });
$(document).on("click", 'div#snmp_create_buttons > input', function (event) { $(document).on("click", 'div#snmp_create_buttons > button', function (event) {
var source_button = this.name; var source_button = this.name;
var target = ""; var target = "";
@ -264,8 +264,8 @@ function snmp_show_result_message(data) {
height: 300, height: 300,
width: 500, width: 500,
close: function(e, ui) { close: function(e, ui) {
$("input[name=create_modules_network_component]").removeClass("sub spinn"); $("button[name=create_modules_network_component]").removeClass("sub spinn");
$("input[name=create_modules_network_component]").addClass("sub add"); $("button[name=create_modules_network_component]").addClass("sub add");
}, },
overlay: { overlay: {
opacity: 0.5, opacity: 0.5,