Skip to content

Commit

Permalink
sort tags on analysis page
Browse files Browse the repository at this point in the history
to fix the problem that the order of displayed tags is random and switches when you reload the page
  • Loading branch information
jstucke authored and maringuu committed Nov 7, 2023
1 parent f3a9b0f commit fac5f5c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/web_interface/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,9 @@ def render_fw_tags(tag_dict, size=14):
def render_analysis_tags(tags, size=14):
output = ''
if tags:
for plugin_name in tags:
for key, tag in tags[plugin_name].items():
for plugin_name in sorted(tags):
# sort tags by "value" (the displayed text in the tag)
for key, tag in sorted(tags[plugin_name].items(), key=lambda t: t[1]['value']):
if key == 'root_uid':
continue
color = tag['color'] if tag['color'] in TagColor.ALL else TagColor.BLUE
Expand Down

0 comments on commit fac5f5c

Please sign in to comment.