Skip to content

Commit 24ad7cf

Browse files
committed
chg: [show correlation] add btns: Show Direct Correlations (Level 0) + Clear All Object Types + Select All Object Types
1 parent 7489c81 commit 24ad7cf

File tree

1 file changed

+42
-5
lines changed

1 file changed

+42
-5
lines changed

var/www/templates/correlation/show_correlation.html

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -252,15 +252,28 @@ <h5>Hidden objects:</h5>
252252
</ul>
253253

254254
<ul class="list-group">
255-
<li class="list-group-item list-group-item-info">Select Correlation</li>
255+
<li class="list-group-item list-group-item-info">
256+
Select Correlation:
257+
<div>
258+
<span class="">
259+
<button class="btn btn-sm btn-info px-1 py-0" onclick="select_object_type_selector();" title="Select All Object Types">
260+
<i class="fa-solid fa-square-check"></i>
261+
</button>
262+
</span>
263+
<span class="">
264+
<button class="btn btn-sm btn-info px-1 py-0" onclick="unselect_object_type_selector();" title="Clear All Object Types">
265+
<i class="fa-solid fa-eraser"></i>
266+
</button>
267+
</span>
268+
</div>
269+
</li>
256270
<form action="{{ url_for('correlation.show_correlation') }}" method="post">
257-
<li class="list-group-item text-left">
271+
<li class="list-group-item text-left" id="correlation_type_selector">
258272

259273
<input type="hidden" id="obj_type" name="obj_type" value="{{ dict_object["object_type"] }}">
260274
<input type="hidden" id="subtype" name="subtype" value="{{ dict_object["metadata"]["type_id"] }}">
261275
<input type="hidden" id="obj_id" name="obj_id" value="{{ dict_object["correlation_id"] }}">
262276

263-
264277
<div class="form-check">
265278
<input class="form-check-input" type="checkbox" value="True" id="cookie-name_Check" name="cookie-name_Check" {%if "cookie-name" in dict_object["filter"]%}checked{%endif%}>
266279
<label class="form-check-label" for="cookie-name_Check">Cookie Name</label>
@@ -396,10 +409,21 @@ <h5>Hidden objects:</h5>
396409

397410
<div class="form-group">
398411
<label for="max_nb_nodes_in">Correlation Depth:</label>
399-
<input class="form-control" type="number" value="{{dict_object["level"]}}" min="0" id="level" name="level">
412+
<div class="row">
413+
<div class="col-xl-3">
414+
<div class="btn btn-sm btn-info px-1 py-1" onclick="set_level_zero();" title="Show Direct Correlations (Level 0)">
415+
<div class="d-flex align-items-center">
416+
<svg width="32" height="32" viewBox="0 0 32 32"><g fill="none"><path fill="#bebebe" d="M23.958 2H8.042A3.046 3.046 0 0 0 5 5.05v21.9A3.046 3.046 0 0 0 8.042 30h15.916A3.046 3.046 0 0 0 27 26.95V5.05A3.046 3.046 0 0 0 23.958 2"/><path fill="#636363" d="M7 7.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5A.75.75 0 0 1 7 7.25m.75 8a.75.75 0 0 0 0 1.5h2.5a.75.75 0 0 0 0-1.5zm14 0a.75.75 0 0 0 0 1.5h2.5a.75.75 0 0 0 0-1.5zm0-8.75a.75.75 0 0 0 0 1.5h2.5a.75.75 0 0 0 0-1.5zM7 25.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75m14.75-.75a.75.75 0 0 0 0 1.5h2.5a.75.75 0 0 0 0-1.5z"/><path fill="#d3d3d3" d="M12.5 9a3.5 3.5 0 1 1 7 0v14a3.5 3.5 0 1 1-7 0z"/><path fill="#635994" d="M13.5 9a2.5 2.5 0 0 1 5 0v14a2.5 2.5 0 0 1-5 0z"/><path fill="#00a6ed" d="M11 12a2 2 0 0 1 2-2h6a2 2 0 1 1 0 4h-6a2 2 0 0 1-2-2"/></g></svg>
417+
<i class="fa-solid fa-0"></i>
418+
</div>
419+
</div>
420+
</div>
421+
<div class="col-xl-9">
422+
<input class="form-control" type="number" value="{{dict_object["level"]}}" min="0" id="level" name="level">
423+
</div>
424+
</div>
400425
</div>
401426

402-
403427
</li>
404428
<li class="list-group-item text-left">
405429

@@ -534,6 +558,19 @@ <h4><i class="fas fa-tags"></i> Tags All Objects</h4>
534558
$('#ltagsgalaxies').val(tagsgalaxy);
535559
return true;
536560
}
561+
562+
function set_level_zero() {
563+
document.getElementById('level').value = 0;
564+
}
565+
566+
function select_object_type_selector() {
567+
document.querySelectorAll('#correlation_type_selector input[type="checkbox"]').forEach(cb => cb.checked = true);
568+
}
569+
570+
function unselect_object_type_selector() {
571+
document.querySelectorAll('#correlation_type_selector input[type="checkbox"]').forEach(cb => cb.checked = false);
572+
}
573+
537574
</script>
538575

539576
<script>

0 commit comments

Comments
 (0)