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,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] = '<div class="w250px">'.html_print_select_groups(
false,
'AR',
true,
'id_group',
$id_group,
'',
'',
0,
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[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 '<form method="post" action="index.php?sec=network&amp;sec2=operation/agentes/pandora_networkmap">';
html_print_table($table);
echo "<div style='width: ".$table->width."; text-align: right; margin-top:20px;'>";
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 '</form>';
echo '</div>';
}

View File

@ -42,7 +42,7 @@ switch ($action) {
default:
case 'new':
$actionButtons = html_print_submit_button(
__('Save'),
__('Create'),
'add',
false,
[ 'icon' => 'next' ],
@ -66,39 +66,26 @@ switch ($action) {
$table = new stdClass();
$table->width = '100%';
$table->id = 'add_alert_table';
$table->class = 'databox filters';
$table->head = [];
$table->data = [];
$table->size = [];
if (is_metaconsole() === true) {
$table->class = 'databox filters';
$table->head[0] = __('Main data');
$table->head_colspan[0] = 4;
$table->headstyle[0] = 'text-align: center';
}
$table->data = [];
$table->size = [];
$table->size = [];
$table->size[0] = '15%';
$table->size[1] = '90%';
if (is_metaconsole() === false) {
$table->size[0] = '15%';
$table->size[1] = '90%';
$table->style[0] = 'font-weight: bold; vertical-align: top;';
} 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(
false,
'AR',
@ -108,6 +95,36 @@ $write_groups = users_get_groups_for_select(
'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
// RW groups (special permission) we add it.
if (isset($write_groups[$idGroupReport]) === false && $idGroupReport) {
@ -120,23 +137,44 @@ if (users_can_manage_group_all('RW') === true) {
$return_all_group = true;
}
$table->data['group'][1] = '<div class="w290px inline">';
$table->data['group'][1] .= 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,
]
);
$table->data['group'][1] .= '</div>';
if (is_metaconsole() === true) {
$table->data['group'][1] = '<div class="w290px inline">';
$table->data['group'][1] .= 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,
]
);
$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']
|| is_user_admin($config['id_user'])
@ -147,41 +185,81 @@ if ($report_id_user == $config['id_user']
'group_edit' => __('The next group can edit the report'),
'user_edit' => __('Only the user and admin user can edit the report'),
];
$table->data['access'][0] = __('Write Access');
$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.'),
true
);
$table->data['access'][1] = html_print_select(
$type_access,
'type_access',
$type_access_selected,
'change_type_access(this)',
'',
0,
true
);
if (is_metaconsole() === true) {
$table->data['access'][0] = __('Write Access');
$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.'),
true
);
$table->data['access'][1] = html_print_select(
$type_access,
'type_access',
$type_access_selected,
'change_type_access(this)',
'',
0,
true
);
$style = 'display: none;';
if ($type_access_selected == 'group_edit') {
$style = '';
$class = ' invisible_important ';
if ($type_access_selected == 'group_edit') {
$class = '';
}
$table->data['access'][1] .= '<span class="access_subform'.$class.'" id="group_edit">';
$table->data['access'][1] .= '<div class="w290px inline">';
$table->data['access'][1] .= html_print_select_groups(
false,
'RW',
false,
'id_group_edit',
$id_group_edit,
false,
'',
'',
true
);
$table->data['access'][1] .= '</div>';
$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
);
}
$table->data['access'][1] .= '<span style="'.$style.'" class="access_subform" id="group_edit">';
$table->data['access'][1] .= '<div class="w290px inline">';
$table->data['access'][1] .= html_print_select_groups(
false,
'RW',
false,
'id_group_edit',
$id_group_edit,
false,
'',
'',
true
);
$table->data['access'][1] .= '</div>';
$table->data['access'][1] .= '</span>';
}
if ($enterpriseEnable) {
@ -190,41 +268,89 @@ if ($enterpriseEnable) {
$non_interactive_check = $non_interactive;
}
$table->data['interactive_report'][0] = __('Non interactive report');
$table->data['interactive_report'][1] .= html_print_checkbox_switch(
'non_interactive',
1,
$non_interactive_check,
if (is_metaconsole() === true) {
$table->data['interactive_report'][0] = __('Non interactive report');
$table->data['interactive_report'][1] .= html_print_checkbox_switch(
'non_interactive',
1,
$non_interactive_check,
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
)
);
}
}
if (is_metaconsole() === true) {
$table->data['description'][0] = __('Description');
$table->data['description'][1] = html_print_textarea(
'description',
2,
80,
$description,
'',
true
);
} else {
$table->data[2][1] = html_print_label_input_block(
__('Description'),
html_print_textarea(
'description',
2,
1,
$description,
'',
true
)
);
}
$table->data['description'][0] = __('Description');
$table->data['description'][1] = html_print_textarea(
'description',
2,
80,
$description,
'',
true
);
if (enterprise_installed() === true) {
$table->data['cover'][0] = __('Generate cover page in PDF render');
$table->data['cover'][1] = html_print_checkbox_switch(
'cover_page_render',
1,
$cover_page_render,
true
);
if (is_metaconsole() === true) {
$table->data['cover'][0] = __('Generate cover page in PDF render');
$table->data['cover'][1] = html_print_checkbox_switch(
'cover_page_render',
1,
$cover_page_render,
true
);
$table->data['index'][0] = __('Generate index in PDF render');
$table->data['index'][1] = html_print_checkbox_switch(
'index_render',
1,
$index_render,
true
);
$table->data['index'][0] = __('Generate index in PDF render');
$table->data['index'][1] = html_print_checkbox_switch(
'index_render',
1,
$index_render,
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">';
@ -238,11 +364,10 @@ echo '</div></form>';
?>
<script type="text/javascript">
function change_type_access(select_item) {
$(".access_subform").hide();
if ($(select_item).val() == "group_edit") {
$("#group_edit").show()
$("#group_edit").removeClass('invisible_important');
} 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(){
if ($("#checkbox-all_delete").prop("checked")) {
$('[id^=checkbox-massive_report_check]')
.parent()
.parent()
.parent()
.addClass('checkselected');
$(".check_delete").prop("checked", true);
console.log($('.check_delete'));
$('.check_delete').each(function(){
$('#hidden-id_report_'+$(this).val()).prop("disabled", false);
});
}
else{
$('[id^=checkbox-massive_report_check]')
.parent()
.parent()
.parent()
.removeClass('checkselected');
console.log($('.check_delete'));
$(".check_delete").prop("checked", false);
}
});
@ -752,55 +731,100 @@ switch ($action) {
$table_aux = new stdClass();
$table_aux->width = '100%';
$table_aux->class = 'databox filters';
$table_aux->cellpadding = 0;
$table_aux->cellspacing = 0;
if (is_metaconsole()) {
$table_aux->class = 'databox filters';
$table_aux->colspan[0][0] = 4;
$table_aux->data[0][0] = '<b>'.__('Group').'</b>';
$table_aux->colspan[0][0] = 4;
$table_aux->data[0][0] = '<b>'.__('Group').'</b>';
$table_aux->data[0][1] = html_print_select_groups(
false,
$access,
true,
'id_group',
$id_group,
'',
'',
'',
true,
false,
true,
'',
false,
'',
false,
false,
'id_grupo'
).'<br>';
$table_aux->data[0][1] = html_print_select_groups(
false,
$access,
true,
'id_group',
$id_group,
'',
'',
'',
true,
false,
true,
'',
false,
'',
false,
false,
'id_grupo'
).'<br>';
$table_aux->data[0][2] = '<b>'.__('Free text for search: ');
$table_aux->data[0][2] .= ui_print_help_tip(
__('Search by report name or description, list matches.'),
true
);
$table_aux->data[0][2] .= '</b>';
$table_aux->data[0][3] = html_print_input_text(
'search',
$search,
'',
30,
'',
true
);
$table_aux->data[0][2] = '<b>'.__('Free text for search: ');
$table_aux->data[0][2] .= ui_print_help_tip(
__('Search by report name or description, list matches.'),
true
);
$table_aux->data[0][2] .= '</b>';
$table_aux->data[0][3] = html_print_input_text(
__('search'),
$search,
'',
30,
'',
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][6] = html_print_submit_button(
__('Search'),
'search_submit',
false,
'class="sub upd"',
true
);
$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(
__('Search'),
'search_submit',
false,
'class="sub upd"',
true
);
}
$url_rb = 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder';
if (is_metaconsole()) {
@ -809,9 +833,37 @@ switch ($action) {
$filter .= '</form>';
ui_toggle($filter, __('Show Option'));
} else {
echo '<form action="'.$url_rb.'&id_group='.$id_group.'&pure='.$pure.'" method="post">';
html_print_table($table_aux);
echo '</form>';
$searchForm = '<form action="'.$url_rb.'&id_group='.$id_group.'&pure='.$pure.'" method="post">';
$searchForm .= html_print_table($table_aux, true);
$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');
@ -1116,7 +1168,13 @@ switch ($action) {
$data[$next] = ui_print_group_icon(
$report['id_group'],
true
true,
'',
'',
true,
false,
false,
'invert_filter'
);
$next++;
}

View File

@ -3022,17 +3022,30 @@ class NetworkMap
$table = new StdClass();
$table->id = 'node_details';
$table->class = 'filter-table-adv';
$table->width = '100%';
$table->data = [];
$table->data[0][0] = '<strong>'.__('Agent').'</strong>';
$table->data[0][1] = '';
$table->data[1][0] = '<strong>'.__('Adresses').'</strong>';
$table->data[1][1] = '';
$table->data[2][0] = '<strong>'.__('OS type').'</strong>';
$table->data[2][1] = '';
$table->data[3][0] = '<strong>'.__('Group').'</strong>';
$table->data[3][1] = '';
$table->data[0][] = html_print_label_input_block(
__('Agent'),
html_print_div(['id' => 'content_node_details-0-1'], true)
);
$table->data[0][] = html_print_label_input_block(
__('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(
html_print_table($table, true),
@ -3071,52 +3084,76 @@ class NetworkMap
$table = new StdClass();
$table->id = 'node_options';
$table->class = 'filter-table-adv';
$table->width = '100%';
$table->data = [];
$table->data[0][0] = __('Shape');
$table->data[0][1] = html_print_select(
[
'circle' => __('Circle'),
'square' => __('Square'),
'rhombus' => __('Rhombus'),
],
'shape',
'',
'javascript:',
'',
0,
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(
'edit_name_node',
'',
__('name node'),
'20',
'50',
true
);
$table->data['node_name'][2] = html_print_button(
__('Update node'),
'',
false,
'',
'class="sub next"',
true
$table->data[0][] = html_print_label_input_block(
__('Shape'),
html_print_select(
[
'circle' => __('Circle'),
'square' => __('Square'),
'rhombus' => __('Rhombus'),
],
'shape',
'',
'javascript:',
'',
0,
true
)
);
$table->data['fictional_node_name'][0] = __('Name');
$table->data['fictional_node_name'][1] = html_print_input_text(
'edit_name_fictional_node',
$table->data['node_name'][] = html_print_label_input_block(
__('Name'),
html_print_input_text(
'edit_name_node',
'',
__('name node'),
'20',
'50',
true
)
);
$table->data['fictional_node_name'][] = html_print_label_input_block(
__('Name'),
html_print_input_text(
'edit_name_fictional_node',
'',
__('name fictional node'),
'20',
'50',
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,
'',
__('name fictional node'),
'20',
'50',
['icon' => 'next'],
true
);
$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'][0] = __('Networkmap to link');
$table->data['fictional_node_networkmap_link'][1] = html_print_select(
$list_networkmaps,
'edit_networkmap_to_link',
'',
@ -3124,19 +3161,39 @@ class NetworkMap
'',
0,
true
);
$table->data['fictional_node_update_button'][0] = '';
$table->data['fictional_node_update_button'][1] = html_print_button(
);
$table->data['fictional_node_update_button'][0] = '';
$table->data['fictional_node_update_button'][1] = html_print_button(
__('Update fictional node'),
'',
false,
'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
);
$output .= ui_toggle(
html_print_table($table, true),
$nodeUpdateTable,
__('Node options'),
__('Node options'),
'',
@ -3210,9 +3267,9 @@ class NetworkMap
$table->data['template_row']['node_target'] = '';
$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>';
$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->cellstyle['no_relations']['0'] = 'text-align: center;';
@ -3434,7 +3491,7 @@ class NetworkMap
'',
false,
'add_fictional_node();',
'class="sub"',
['type' => 'link'],
true
);
$add_agent_node_html = html_print_table($table, true);
@ -3691,7 +3748,7 @@ class NetworkMap
$output .= '<div id="hide_labels_'.$networkmap['id'].'"';
$output .= ' class="absolute right_10px top_10px">';
$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 .= '<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
);
echo ' <a href="javascript:">'.html_print_image(
'images/pencil.png',
'images/edit.svg',
true,
[
'class' => $uniq_name.'_toggler',
'class' => $uniq_name.'_toggler main_menu_icon invert_filter',
'alt' => __('Custom'),
'title' => __('Custom'),
'style' => 'width: 18px;',
@ -1896,10 +1896,10 @@ function html_print_extended_select_for_unit(
html_print_input_hidden($name, $selected, false, $uniq_name);
echo ' <a href="javascript:">'.html_print_image(
'images/default_list.png',
'images/logs@svg.svg',
true,
[
'class' => $uniq_name.'_toggler',
'class' => $uniq_name.'_toggler main_menu_icon invert_filter',
'alt' => __('List'),
'title' => __('List'),
'style' => 'width: 18px;',
@ -1991,10 +1991,10 @@ function html_print_extended_select_for_post_process(
$style
);
echo ' <a href="javascript:">'.html_print_image(
'images/pencil.png',
'images/edit.svg',
true,
[
'class' => $uniq_name.'_toggler',
'class' => $uniq_name.'_toggler main_menu_icon invert_filter',
'alt' => __('Custom'),
'title' => __('Custom'),
'style' => 'width: 18px;',
@ -2007,10 +2007,10 @@ function html_print_extended_select_for_post_process(
html_print_input_hidden($name, $selected, false, $uniq_name);
echo ' <a href="javascript:">'.html_print_image(
'images/default_list.png',
'images/logs@svg.svg',
true,
[
'class' => $uniq_name.'_toggler',
'class' => $uniq_name.'_toggler main_menu_icon invert_filter',
'alt' => __('List'),
'title' => __('List'),
'style' => 'width: 18px;',
@ -2144,10 +2144,10 @@ function html_print_extended_select_for_time(
[
'href' => 'javascript:',
'content' => html_print_image(
'images/pencil.png',
'images/edit.svg',
true,
[
'class' => $uniq_name.'_toggler '.$class.' invert_filter',
'class' => $uniq_name.'_toggler '.$class.' main_menu_icon invert_filter',
'alt' => __('Custom'),
'title' => __('Custom'),
'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
);
echo ' <a href="javascript:">'.html_print_image(
'images/list.png',
'images/logs@svg.svg',
true,
[
'class' => $uniq_name.'_toggler invert_filter',
'class' => $uniq_name.'_toggler main_menu_icon invert_filter',
'alt' => __('List'),
'title' => __('List'),
'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
);
echo ' <a href="javascript:">'.html_print_image(
'images/pencil.png',
'images/edit.svg',
true,
[
'class' => $uniq_name.'_toggler',
'class' => $uniq_name.'_toggler main_menu_icon invert_filter',
'alt' => __('Custom'),
'title' => __('Custom'),
'style' => 'width: 18px;',
@ -6610,10 +6610,10 @@ function html_print_extended_select_for_downtime_cron(
html_print_input_hidden($name, $selected, false, $uniq_name);
echo ' <a href="javascript:">'.$help_tooltip.'&nbsp'.html_print_image(
'images/default_list.png',
'images/logs@svg.svg',
true,
[
'class' => $uniq_name.'_toggler',
'class' => $uniq_name.'_toggler main_menu_icon invert_filter',
'alt' => __('List'),
'title' => __('List'),
'style' => 'width: 18px;',
@ -6745,6 +6745,7 @@ function html_print_label_input_block(
):string {
$div_class = '';
$label_class = '';
$div_id = '';
if (empty($options) === false) {
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[] = (isset($options['rawattributes']) === true) ? $options['rawattributes'] : '';
$attibutes[] = (isset($options['style']) === true) ? 'style="'.$options['style'].'"' : '';
$attibutes[] = (isset($options['id']) === true) ? 'id="'.$options['id'].'"' : '';
$attibutes[] = (isset($options['title']) === true) ? 'title="'.$options['title'].'"' : '';
$output = sprintf(

View File

@ -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",
@ -846,9 +851,9 @@ function edit_node(data_node, dblClick) {
);
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) {
$("#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=' +
node_selected.networkmap_id +
'">' +
@ -858,7 +863,7 @@ function edit_node(data_node, dblClick) {
"</a>"
);
} else {
$("#node_details-0-1").html(
$("#node_details-0-1 div").html(
$(
`#edit_networkmap_to_link option[value='${node_selected.networkmap_id}']`
).text()
@ -869,7 +874,7 @@ function edit_node(data_node, dblClick) {
$("#node_details-2").hide();
$("#node_details-3").hide();
} else {
$("#node_details-0-0").html("<strong>Agent</strong>");
//$("#node_details-0-0").html("Agent");
$("#node_details-1").show();
$("#node_details-2").show();
$("#node_details-3").show();
@ -885,7 +890,7 @@ function edit_node(data_node, dblClick) {
type: "POST",
url: window.base_url_homedir + "/ajax.php",
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=' +
node_selected["id_agent"] +
'">' +
@ -903,9 +908,9 @@ function edit_node(data_node, dblClick) {
addresses += address + "<br>";
}
}
$("#node_details-1-1").html(addresses);
$("#node_details-2-1").html(data["os"]);
$("#node_details-3-1").html(data["group"]);
$("#content_node_details-1-1").html(addresses);
$("#content_node_details-2-1").html(data["os"]);
$("#content_node_details-3-1").html(data["group"]);
$("[aria-describedby=dialog_node_edit]").css({ top: "200px" });
$("#foot").css({
@ -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
@ -1184,9 +1193,15 @@ function load_interfaces(selected_links) {
$("#relations_table")
.parent()
.append(
`<div class='action-buttons w100p'>
<input id='update_relations_button' class='sub upd' type='button' value='update relations'>
</div>`
`
<div class='action-buttons w100p'>
<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() {
@ -1341,7 +1356,7 @@ function hide_labels_function() {
$("#hide_labels_" + networkmap_id + " > a").attr("title", "Show Labels");
$("#hide_labels_" + networkmap_id + " > a > img").attr(
"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");
@ -1354,7 +1369,7 @@ function show_labels_function() {
$("#hide_labels_" + networkmap_id + " > a").attr("title", "Hide Labels");
$("#hide_labels_" + networkmap_id + " > a > img").attr(
"src",
window.location.origin + "/pandora_console/images//icono_borrar.png"
window.location.origin + "/pandora_console/images/disable.svg"
);
d3.selectAll(".node_text").style("display", "");

View File

@ -613,7 +613,9 @@ function snmp_browser_create_modules(module_target, return_post = true) {
var oids = [];
id_check.forEach(function(product, index) {
var oid = $("#" + product)
.siblings("a")
.parent()
.parent()
.find("a")
.attr("href");
if (oid.indexOf('javascript: snmpGet("') != -1) {
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["snmp_extradata"] = snmp_data;
$("input[name=create_modules_" + module_target + "]").removeClass(
$("button[name=create_modules_" + module_target + "]").removeClass(
"sub add"
);
$("input[name=create_modules_" + module_target + "]").addClass("sub spinn");
$("button[name=create_modules_" + module_target + "]").addClass(
"sub spinn"
);
$("#dialog_error").on("dialogclose", function(event) {
$("input[name=create_modules_" + module_target + "]").removeClass(
$("button[name=create_modules_" + module_target + "]").removeClass(
"sub spinn"
);
$("input[name=create_modules_" + module_target + "]").addClass("sub add");
$("button[name=create_modules_" + module_target + "]").addClass(
"sub add"
);
});
$("#dialog_success").on("dialogclose", function(event) {
$("input[name=create_modules_" + module_target + "]").removeClass(
$("button[name=create_modules_" + module_target + "]").removeClass(
"sub spinn"
);
$("input[name=create_modules_" + module_target + "]").addClass("sub add");
$("button[name=create_modules_" + module_target + "]").addClass(
"sub add"
);
});
$.ajax({

View File

@ -1806,6 +1806,7 @@ div.title_line {
#menu_tab {
margin-right: 20px;
margin-top: 50px;
}
#menu_tab .mn,
@ -8075,6 +8076,7 @@ div.graph div.legend table {
.networkconsole {
width: 100%;
height: 100%;
min-height: 460px;
position: relative;
overflow: hidden;
background-color: #fafafa;
@ -9879,6 +9881,11 @@ div#err_msg_centralised {
font-style: italic;
}
.div-4-col {
flex: 25%;
display: flex;
flex-direction: column;
}
.div-col {
width: 33%;
display: flex;
@ -10555,7 +10562,8 @@ table#simple tr td,
table#advanced tr td,
table.principal_table tr td,
.white_table_flex > table tr td,
.table_section table tr td {
.table_section table tr td,
#agent_controls {
display: flex;
flex-direction: row;
align-items: center;
@ -11287,7 +11295,11 @@ form#satellite_conf_edit > fieldset.full-column {
.input_sub_placeholder {
font-size: 8pt;
color: #8a96a6;
/*font-family: "lato";*/
}
.input_sub_placeholder_warning {
color: #ffb900;
font-style: italic;
}
#principal_action_buttons input,
@ -11371,3 +11383,13 @@ div[role="dialog"] {
.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
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -204,15 +204,15 @@ if ($edit_networkmap) {
}
$button = [];
if ($edit_networkmap) {
if ($edit_networkmap === true) {
$button['map'] = [
'active' => false,
'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,
[
'title' => __('View map'),
'class' => 'invert_filter',
'class' => 'main_menu_icon invert_filter',
]
).'</a>',
];
@ -292,177 +292,6 @@ 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->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;
if (users_can_manage_group_all('AR') === true) {
$return_all_group = true;
}
$table->data[1][0] = __('Group');
$table->data[1][1] = '<div class="w250px">'.html_print_select_groups(
// Id_user.
$config['id_user'],
// Privilege.
'AR',
// ReturnAllGroup.
$return_all_group,
// Name.
'id_group_map',
// Selected.
$id_group_map,
// Script.
'',
// Nothing.
'',
// Nothing_value.
'',
// Return.
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[3][1] = html_print_input_text(
'description',
$description,
'',
100,
100,
true
);
$table->data[4][0] = __('Position X');
$table->data[4][1] = html_print_input_text('pos_x', $offset_x, '', 2, 10, true);
$table->data[5][0] = __('Position Y');
$table->data[5][1] = html_print_input_text('pos_y', $offset_y, '', 2, 10, true);
$table->data[6][0] = __('Zoom scale');
if ($scale_z == '') {
$scale_z = 0.5;
}
$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);
$table->data['source'][0] = __('Source');
$table->data['source'][1] = html_print_select(
[
'group' => __('Group'),
'recon_task' => __('Discovery task'),
'ip_mask' => __('CIDR IP mask'),
],
'source',
$source,
'',
'',
0,
true,
false,
false,
'',
$disabled_source
);
$table->data['source_data_recon_task'][0] = __('Source from recon task');
$table->data['source_data_recon_task'][0] .= ui_print_help_tip(
__('It is setted any recon task, the nodes get from the recontask IP mask instead from the group.'),
true
);
$table->data['source_data_recon_task'][1] = html_print_select(
$list_recon_tasks,
'recon_task_id',
$recon_task_id,
'',
__('None'),
0,
true,
false,
true,
'',
$disabled_source
);
$table->data['source_data_recon_task'][1] .= ui_print_help_tip(
__('Show only the task with the recon script "SNMP L2 Recon".'),
true
);
$table->data['source_data_ip_mask'][0] = __('Source from CIDR IP mask');
$table->data['source_data_ip_mask'][1] = html_print_textarea(
'ip_mask',
3,
5,
$ip_mask,
'style="width: 238px"',
true,
'',
$disabled_source
);
$table->data['source_data_group'][0] = __('Source group');
$table->data['source_data_group'][1] = '<div class="w250px">'.html_print_select_groups(
$config['id_user'],
'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',
@ -472,79 +301,312 @@ if ($not_found) {
'radial_dinamic' => 'radial dynamic',
];
$table->data[7][0] = __('Method generation networkmap');
$table->data[7][1] = html_print_select(
$methods,
'method',
$method,
'',
'',
'neato',
true,
false,
true,
'',
$disabled_generation_method_select
);
$itemClass = '';
if ($disabled_source) {
if ($disabled_source === true) {
$itemClass = 'disabled';
}
$table->data['nodesep'][0] = __('Node separation');
$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);
$return_all_group = false;
$table->data['ranksep'][0] = __('Rank separation');
$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);
if (users_can_manage_group_all('AR') === true) {
$return_all_group = true;
}
$table->data['mindist'][0] = __('Min nodes dist');
$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);
if (empty($scale_z) === true) {
$scale_z = 0.5;
}
$table->data['kval'][0] = __('Default ideal node separation');
$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);
$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['refresh'][0] = __('Refresh');
$table->data['refresh'][1] = html_print_extended_select_for_time(
'refresh_time',
$refresh_time,
'',
'',
'0',
false,
true,
false,
false
$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.
$config['id_user'],
// Privilege.
'AR',
// ReturnAllGroup.
$return_all_group,
// Name.
'id_group_map',
// Selected.
$id_group_map,
// Script.
'',
// Nothing.
'',
// Nothing_value.
'',
// Return.
true
)
);
$table->data[1][] = html_print_label_input_block(
__('Description'),
html_print_input_text(
'description',
$description,
'',
100,
100,
true
)
);
$divLittleFields = [];
$divLittleFields[] = html_print_label_input_block(
__('Position X'),
html_print_input_text('pos_x', $offset_x, '', 10, 10, true, false, false, '', 'w50p'),
[ 'div_class' => 'div-4-col' ]
);
$divLittleFields[] = html_print_label_input_block(
__('Position Y'),
html_print_input_text('pos_y', $offset_y, '', 10, 10, true, false, false, '', 'w50p'),
[ 'div_class' => 'div-4-col' ]
);
$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' ]
);
$divLittleFields[] = html_print_label_input_block(
__('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'),
'recon_task' => __('Discovery task'),
'ip_mask' => __('CIDR IP mask'),
],
'source',
$source,
'',
'',
0,
true,
false,
false,
'',
$disabled_source
)
);
$table->data['source_data_group'][] = html_print_label_input_block(
__('Source group'),
html_print_select_groups(
$config['id_user'],
'AR',
true,
'id_group[]',
explode(',', $id_group),
'',
'',
'',
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_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,
'recon_task_id',
$recon_task_id,
'',
__('None'),
0,
true,
false,
true,
'',
$disabled_source
).ui_print_input_placeholder(
__('It is setted any recon task, the nodes get from the recontask IP mask instead from the group.'),
true
)
);
$table->data['source_data_ip_mask'][] = html_print_label_input_block(
__('Source from CIDR IP mask'),
html_print_textarea(
'ip_mask',
3,
5,
$ip_mask,
'style="width: 100%"',
true,
'',
$disabled_source
)
);
$table->data[7][] = html_print_label_input_block(
__('Method generation networkmap'),
html_print_select(
$methods,
'method',
$method,
'',
'',
'neato',
true,
false,
true,
'',
$disabled_generation_method_select
)
);
$table->data['nodesep'][] = html_print_label_input_block(
__('Node separation'),
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['ranksep'][] = html_print_label_input_block(
__('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['mindist'][] = html_print_label_input_block(
__('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['kval'][] = html_print_label_input_block(
__('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['refresh'][] = html_print_label_input_block(
__('Refresh'),
html_print_extended_select_for_time(
'refresh_time',
$refresh_time,
'',
'',
'0',
false,
true,
false,
false
)
);
echo '<form id="networkmap_options_form" method="post" action="index.php?sec=network&amp;sec2=operation/agentes/pandora_networkmap">';
html_print_table($table);
echo "<div style='width: ".$table->width."; text-align: right; margin-top:20px;'>";
if ($new_networkmap) {
$actionButtons = [];
if ($new_networkmap === true) {
html_print_input_hidden('save_networkmap', 1);
html_print_submit_button(
$actionButtons[] = html_print_submit_button(
__('Save networkmap'),
'crt',
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('update_networkmap', 1);
html_print_submit_button(
$actionButtons[] = html_print_submit_button(
__('Update networkmap'),
'crt',
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 '</div>';
}
?>
<script type="text/javascript">

View File

@ -685,29 +685,22 @@ switch ($tab) {
$table->class = 'info_table';
$table->cellpadding = 0;
$table->cellspacing = 0;
$table->headstyle['copy'] = 'text-align: center;';
$table->headstyle['edit'] = 'text-align: center;';
$table->headstyle['actions'] = 'text-align: right;';
$table->style = [];
$table->style['name'] = '';
$table->style['nodes'] = 'text-align: center;';
$table->style['nodes'] = 'text-align: left;';
$table->style['groups'] = 'text-align: left;';
if ($networkmaps_write === true || $networkmaps_manage === true) {
$table->style['copy'] = 'text-align: center;';
$table->style['edit'] = 'text-align: center;';
$table->style['delete'] = 'text-align: center;';
$table->style['actions'] = 'text-align: right;';
}
$table->size = [];
$table->size['name'] = '60%';
$table->size['nodes'] = '30px';
$table->size['name'] = '40%';
$table->size['nodes'] = '15%';
$table->size['groups'] = '400px';
if ($networkmaps_write === true || $networkmaps_manage === true) {
$table->size['copy'] = '30px';
$table->size['edit'] = '30px';
$table->size['delete'] = '30px';
$table->size['actions'] = '10%';
}
$table->head = [];
@ -716,9 +709,7 @@ switch ($tab) {
$table->head['groups'] = __('Groups');
if ($networkmaps_write === true || $networkmaps_manage === true) {
$table->head['copy'] = __('Copy');
$table->head['edit'] = __('Edit');
$table->head['delete'] = __('Delete');
$table->head['actions'] = __('Actions');
}
$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['copy'] = '';
$data['edit'] = '';
$data['delete'] = '';
$data['actions'] = '';
if ($networkmap_write || $networkmap_manage) {
$table->cellclass[] = [
'copy' => 'table_action_buttons',
'edit' => 'table_action_buttons',
'delete' => 'table_action_buttons',
];
$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>';
$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>';
$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>';
$tableActionButtons = [];
$tableActionButtons[] = html_print_anchor(
[
'title' => __('Copy'),
'href' => 'index.php?sec=network&sec2=operation/agentes/pandora_networkmap&amp;copy_networkmap=1&id_networkmap='.$network_map['id'],
'content' => html_print_image('images/copy.svg', true, ['class' => 'main_menu_icon invert_filter']),
],
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;
}
ui_pagination($count_maps, false, $offset);
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 {
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">';
html_print_input_hidden('new_empty_networkmap', 1);
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;
}

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
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -124,7 +124,7 @@ if (is_ajax() === true) {
$table = new StdClass();
$table->id = 'form_editor';
$table->width = '98%';
$table->width = '100%';
$table->class = 'databox_color';
$table->head = [];
$table->size = [];
@ -1264,7 +1264,7 @@ if (is_ajax() === true) {
$id_group = agents_get_agent_group($id_agent);
$return['group'] = db_get_value('nombre', 'tgrupo', 'id_grupo', $id_group);
$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);
@ -1526,7 +1526,7 @@ if (is_ajax() === true) {
$id_group = agents_get_agent_group($id_agent);
$return['group'] = db_get_value('nombre', 'tgrupo', 'id_grupo', $id_group);
$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);
@ -2341,11 +2341,11 @@ if ($networkmap === false) {
$buttons['screen'] = [
'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(
'images/normal_screen.png',
'images/exit_fullscreen@svg.svg',
true,
[
'title' => __('Normal screen'),
'class' => 'invert_filter',
'class' => 'main_menu_icon invert_filter',
]
).'</a>',
];
@ -2358,33 +2358,33 @@ if ($networkmap === false) {
$buttons['screen'] = [
'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(
'images/full_screen.png',
'images/fullscreen@svg.svg',
true,
[
'title' => __('Full screen'),
'class' => 'invert_filter',
'class' => 'main_menu_icon invert_filter',
]
).'</a>',
];
$buttons['list'] = [
'active' => false,
'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,
[
'title' => __('List of networkmap'),
'class' => 'invert_filter',
'class' => 'main_menu_icon invert_filter',
]
).'</a>',
];
$buttons['option'] = [
'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(
'images/setup.png',
'images/edit.svg',
true,
[
'title' => __('Options'),
'class' => 'invert_filter',
'class' => 'main_menu_icon invert_filter',
]
).'</a>',
];
@ -2396,16 +2396,23 @@ if ($networkmap === false) {
}
if (!$dash_mode) {
ui_print_page_header(
ui_print_standard_header(
$networkmap['name'],
'images/bricks.png',
false,
'network_map_enterprise_view',
false,
$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 target = "";
@ -254,55 +254,55 @@ function snmp_show_result_message(data) {
var dato = JSON.parse(data);
if (dato.length !== 0) {
$("#error_text").text("");
$("#error_text").text("");
if (dato[0] === -1) {
$("#dialog_no_agents_selected").dialog({
if (dato[0] === -1) {
$("#dialog_no_agents_selected").dialog({
resizable: true,
draggable: true,
modal: true,
height: 300,
width: 500,
close: function(e, ui) {
$("input[name=create_modules_network_component]").removeClass("sub spinn");
$("input[name=create_modules_network_component]").addClass("sub add");
$("button[name=create_modules_network_component]").removeClass("sub spinn");
$("button[name=create_modules_network_component]").addClass("sub add");
},
overlay: {
opacity: 0.5,
background: "black"
opacity: 0.5,
background: "black"
}
});
} else {
$("#error_text").text("");
});
} else {
$("#error_text").text("");
dato.forEach(function (valor, indice, array) {
dato.forEach(function (valor, indice, array) {
$("#error_text").append("<br/>" + valor);
});
$("#dialog_error").dialog({
});
$("#dialog_error").dialog({
resizable: true,
draggable: true,
modal: true,
height: 300,
width: 500,
overlay: {
opacity: 0.5,
background: "black"
opacity: 0.5,
background: "black"
}
});
}
});
}
} else {
$("#dialog_success").dialog({
$("#dialog_success").dialog({
resizable: true,
draggable: true,
modal: true,
height: 250,
width: 500,
overlay: {
opacity: 0.5,
background: "black"
opacity: 0.5,
background: "black"
}
});
});
}
}
/**