From 0a03048fe8453bb27d5875287675aa221c31b099 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 24 Aug 2023 22:29:19 +0200 Subject: [PATCH] Continued: - fetch all data in /list view - added total_peers and total_blocks to be exposed --- daemon.py | 2 +- templates/views/list.html | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/daemon.py b/daemon.py index f298737..53a50f6 100755 --- a/daemon.py +++ b/daemon.py @@ -115,7 +115,7 @@ def api_list(request: Request, mode: str, value: str, amount: int): if mode in ("detection_mode", "software", "command", "origin"): database.cursor.execute( - f"SELECT domain, origin, software, detection_mode, command, total_peers, total_blocks, first_seen, last_updated \ + f"SELECT * \ FROM instances \ WHERE {mode} = ? \ ORDER BY domain \ diff --git a/templates/views/list.html b/templates/views/list.html index 260537d..70c8f86 100644 --- a/templates/views/list.html +++ b/templates/views/list.html @@ -34,6 +34,8 @@ Software Detection mode Command + Total peers + Total blocks First added Last updated @@ -62,6 +64,8 @@ {% endwith %} {{row['command']}} + {{row['total_peers']}} + {{row['total_blocks']}} {{row['first_seen']}} {{row['last_updated']}} -- 2.39.5