From 84bc2c06694a1475140a4f19a1aff72229b0fc81 Mon Sep 17 00:00:00 2001 From: Terrtia Date: Sun, 18 Jun 2023 16:09:57 +0200 Subject: [PATCH] chg: [correlation] add an option to remove max number of nodes if max_node == 0 --- bin/lib/correlations_engine.py | 2 +- var/www/blueprints/correlation.py | 2 +- var/www/templates/correlation/show_correlation.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/lib/correlations_engine.py b/bin/lib/correlations_engine.py index d1d7e3b6..bf234c9c 100755 --- a/bin/lib/correlations_engine.py +++ b/bin/lib/correlations_engine.py @@ -193,7 +193,7 @@ def _get_correlations_graph_node(links, nodes, obj_type, subtype, obj_id, level, if obj2_str_id == previous_str_obj: continue - if len(nodes) > max_nodes: + if len(nodes) > max_nodes != 0: break nodes.add(obj2_str_id) links.add((obj_str_id, obj2_str_id)) diff --git a/var/www/blueprints/correlation.py b/var/www/blueprints/correlation.py index b43cfe1e..bcf61729 100644 --- a/var/www/blueprints/correlation.py +++ b/var/www/blueprints/correlation.py @@ -46,7 +46,7 @@ def sanitise_graph_mode(graph_mode): def sanitise_nb_max_nodes(nb_max_nodes): try: nb_max_nodes = int(nb_max_nodes) - if nb_max_nodes < 2: + if nb_max_nodes < 2 and nb_max_nodes != 0: nb_max_nodes = 300 except (TypeError, ValueError): nb_max_nodes = 300 diff --git a/var/www/templates/correlation/show_correlation.html b/var/www/templates/correlation/show_correlation.html index 667d0cb8..93ca5c2b 100644 --- a/var/www/templates/correlation/show_correlation.html +++ b/var/www/templates/correlation/show_correlation.html @@ -256,7 +256,7 @@
- +