Merge branch 'ent-3595-discovery-fase-2' of brutus.artica.lan:artica/pandorafms into ent-3595-discovery-fase-2

Former-commit-id: f1c63c2e0be43e9c01306375446fc1eaa3c039ef
This commit is contained in:
Daniel Barbero Martin 2019-03-26 17:22:36 +01:00
commit 19bf0ae940
4 changed files with 35 additions and 11 deletions

@ -585,10 +585,6 @@ class NetworkMap
$this->idGroup = $this->map['id_group'];
switch ($this->map['source']) {
case SOURCE_GROUP:
$this->idGroup = $this->map['source_data'];
break;
case SOURCE_TASK:
$this->idTask = $this->map['source_data'];
break;
@ -597,6 +593,8 @@ class NetworkMap
$this->network = $this->map['source_data'];
break;
case SOURCE_GROUP:
// Already load.
default:
// Ignore.
break;
@ -753,7 +751,9 @@ class NetworkMap
// Empty map returns no data.
$nodes = [];
} else {
if ($this->mapOptions['map_filter']['dont_show_subgroups'] == 'true') {
if ($this->mapOptions['map_filter']['dont_show_subgroups'] === 'true'
|| $this->mapOptions['map_filter']['dont_show_subgroups'] == 1
) {
// Show only current selected group.
$filter['id_grupo'] = $this->idGroup;
} else {
@ -3226,7 +3226,8 @@ class NetworkMap
enterprise_installed: enterprise_installed,
node_radius: node_radius,
holding_area_dimensions: networkmap_holding_area_dimensions,
url_background_grid: url_background_grid
url_background_grid: url_background_grid,
font_size: '.$this->mapOptions['font_size'].'
});
init_drag_and_drop();
init_minimap();

@ -2956,6 +2956,10 @@ function init_graph(parameter_object) {
$(window).height() - $("#menu_tab_frame_view").height() - 20; // 20 of margin
}
if (typeof parameter_object.font_size != "undefined") {
window.font_size = parameter_object.font_size;
}
window.refresh_period = 5 * 1000; //milliseconds
if (typeof parameter_object.refresh_period != "undefined") {
window.refresh_period = parameter_object.refresh_period;
@ -3968,6 +3972,10 @@ function draw_elements_graph() {
var font_size = node_radius / 1.5;
if (typeof window.font_size != "undefined") {
font_size = window.font_size;
}
node_temp
.append("text")
.attr("class", "node_text")

@ -53,7 +53,7 @@ if ($new_networkmap) {
$recon_task_id = 0;
$source = 'group';
$ip_mask = '';
$dont_show_subgroups = false;
$dont_show_subgroups = 0;
$offset_x = '';
$offset_y = '';
$scale_z = 0.5;
@ -330,7 +330,13 @@ if ($not_found) {
$table->data['source_data_ip_mask'][1] = html_print_input_text('ip_mask', $ip_mask, '', 20, 255, true, $disabled_source);
$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);
$table->data['source_data_dont_show_subgroups'][1] = html_print_checkbox(
'dont_show_subgroups',
'1',
$dont_show_subgroups,
true,
$disabled_source
);
$methods = [
'twopi' => 'radial',

@ -76,7 +76,10 @@ if (enterprise_installed()) {
$method = (string) get_parameter('method', 'fdp');
$dont_show_subgroups = 0;
$dont_show_subgroups = (int) get_parameter_checkbox(
'dont_show_subgroups',
0
);
$node_radius = (int) get_parameter('node_radius', 40);
$description = get_parameter('description', '');
@ -168,7 +171,10 @@ if (enterprise_installed()) {
$description = get_parameter('description', '');
$values['description'] = $description;
$dont_show_subgroups = 0;
$dont_show_subgroups = (int) get_parameter_checkbox(
'dont_show_subgroups',
0
);
$node_radius = (int) get_parameter('node_radius', 40);
$row = db_get_row('tmap', 'id', $id);
$filter = json_decode($row['filter'], true);
@ -247,7 +253,10 @@ if ($new_networkmap || $save_networkmap) {
''
);
$source = (string) get_parameter('source', 'group');
$dont_show_subgroups = (int) get_parameter('dont_show_subgroups', 0);
$dont_show_subgroups = (int) get_parameter_checkbox(
'dont_show_subgroups',
0
);
$node_radius = (int) get_parameter('node_radius', 40);
$description = get_parameter('description', '');