mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
Fix reverse scan metrics fetch in web UI
This commit is contained in:
parent
12dda43481
commit
d4864c0ff4
1 changed files with 1 additions and 1 deletions
|
|
@ -7,7 +7,7 @@ def pre_render(**kwargs):
|
|||
# Here we will have a list { 'counter_403': X, 'counter_401': Y ... }
|
||||
data = kwargs["app"].config["INSTANCES"].get_metrics("reversescan")
|
||||
# Format to fit [{code: 403, count: X}, {code: 401, count: Y} ...]
|
||||
format_data = [{"port": int(key.split("_")[1]), "count": int(value)} for key, value in data.items()]
|
||||
format_data = [{"port": int(key.split("_")[-1]), "count": value} for key, value in data.items()]
|
||||
format_data.sort(key=itemgetter("count"), reverse=True)
|
||||
return {"top_reverse_scan": format_data}
|
||||
except BaseException:
|
||||
|
|
|
|||
Loading…
Reference in a new issue