chg: [correlation] add an option to remove max number of nodes if max_node == 0

pull/604/head
Terrtia 2023-06-18 16:09:57 +02:00
parent e9539e640b
commit 84bc2c0669
No known key found for this signature in database
GPG Key ID: 1E1B1F50D84613D0
3 changed files with 3 additions and 3 deletions

View File

@ -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))

View File

@ -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

View File

@ -256,7 +256,7 @@
<div class="form-group">
<label for="max_nb_nodes_in">Max number of nodes:</label>
<input class="form-control" type="number" value="{{dict_object["max_nodes"]}}" min="2" id="max_nb_nodes_in" name="max_nb_nodes_in">
<input class="form-control" type="number" value="{{dict_object["max_nodes"]}}" min="0" id="max_nb_nodes_in" name="max_nb_nodes_in">
</div>
<div class="text-center">