mirror of https://github.com/CIRCL/lookyloo
chg: avoid duplicate URLs in hashlookup view
parent
649d7714cf
commit
e291fc6167
|
@ -516,6 +516,9 @@ def urls_rendered_page(tree_uuid: str):
|
||||||
@app.route('/tree/<string:tree_uuid>/hashlookup', methods=['GET'])
|
@app.route('/tree/<string:tree_uuid>/hashlookup', methods=['GET'])
|
||||||
def hashlookup(tree_uuid: str):
|
def hashlookup(tree_uuid: str):
|
||||||
merged, total_ressources = lookyloo.merge_hashlookup_tree(tree_uuid)
|
merged, total_ressources = lookyloo.merge_hashlookup_tree(tree_uuid)
|
||||||
|
# We only want unique URLs for the template
|
||||||
|
for sha1, entries in merged.items():
|
||||||
|
entries['nodes'] = set(node.name for node in entries['nodes'])
|
||||||
return render_template('hashlookup.html', base_tree_uuid=tree_uuid, merged=merged, total_ressources=total_ressources)
|
return render_template('hashlookup.html', base_tree_uuid=tree_uuid, merged=merged, total_ressources=total_ressources)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<dt class="col-sm-2">URLs in tree</dt>
|
<dt class="col-sm-2">URLs in tree</dt>
|
||||||
<dd class="col-sm-10">
|
<dd class="col-sm-10">
|
||||||
{% for node in entries['nodes'] %}
|
{% for node in entries['nodes'] %}
|
||||||
{{ node.name }} </br>
|
{{ node }} </br>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
Loading…
Reference in New Issue