From b4529cd24df2e7cece7f8f2ea9e5dc72e8e88a5b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 28 Jul 2023 09:50:49 +0200 Subject: [PATCH] Fixed: - also need to check if data[json] has at least one entry - mode=avg_peers shows software names, let's link to /list?mode=software here --- fba/http/nodeinfo.py | 2 +- templates/views/scoreboard.html | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/fba/http/nodeinfo.py b/fba/http/nodeinfo.py index 9507844..7d7620a 100644 --- a/fba/http/nodeinfo.py +++ b/fba/http/nodeinfo.py @@ -153,7 +153,7 @@ def fetch_wellknown_nodeinfo(domain: str) -> dict: ) logger.debug("data[]='%s'", type(data)) - if "error_message" not in data and "json" in data: + if "error_message" not in data and "json" in data and len(data["json"]) > 0: logger.debug("path='%s' returned valid json()=%d", path, len(data["json"])) break diff --git a/templates/views/scoreboard.html b/templates/views/scoreboard.html index f76775d..2f41754 100644 --- a/templates/views/scoreboard.html +++ b/templates/views/scoreboard.html @@ -44,14 +44,16 @@ {{loop.index}} - {% if mode in ('error_code', 'avg_peers', 'obfuscator', 'obfuscation') %} + {% if mode in ('error_code', 'obfuscator', 'obfuscation') %} {{entry['domain']}} - {% elif entry['domain'] == None %} - - {% elif mode == 'block_level' %} {{entry['domain']}} + {% elif mode == 'avg_peers' %} + {{entry['domain']}} {% elif mode in ('software', 'detection_mode', 'command') %} {{entry['domain']}} + {% elif entry['domain'] == None %} + - {% else %} {% with domain=entry['domain'] %} {% include "widgets/links.html" %} -- 2.39.5