From b720d31d0d76557b92763b23fa659212eb10d4bc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 29 Jul 2024 22:14:22 +0200 Subject: [PATCH] Continued: - added view for recently updated instances - renamed 'recently' to 'added' for not confusing it --- daemon.py | 9 ++++++++- templates/views/index.html | 5 +++-- templates/views/list.html | 7 +++++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/daemon.py b/daemon.py index 9c76df9..d0b146f 100755 --- a/daemon.py +++ b/daemon.py @@ -127,11 +127,18 @@ WHERE {mode} = ? \ ORDER BY domain \ LIMIT ?", [value, amount] ) - elif mode == "recently": + elif mode == "added": database.cursor.execute( f"SELECT * \ FROM instances \ ORDER BY first_seen DESC \ +LIMIT ?", [amount] + ) + elif mode == "updated": + database.cursor.execute( + f"SELECT * \ +FROM instances \ +ORDER BY last_updated DESC \ LIMIT ?", [amount] ) else: diff --git a/templates/views/index.html b/templates/views/index.html index 0b607dc..3286a4e 100644 --- a/templates/views/index.html +++ b/templates/views/index.html @@ -70,9 +70,10 @@
  • Block level statistics
  • -

    Recently added:

    +

    Recently ...:

    {% endblock %} {% block footer %} diff --git a/templates/views/list.html b/templates/views/list.html index 8c55257..5a6b86c 100644 --- a/templates/views/list.html +++ b/templates/views/list.html @@ -5,7 +5,8 @@ {% elif mode == 'original_software' %} Original software {{value}} {% elif mode == 'software' %} Used software {{value}} {% elif mode == 'command' %} Command {{value}} - {% elif mode == 'recently' %} {{amount}} recently added instances + {% elif mode == 'added' %} {{amount}} recently added instances + {% elif mode == 'updated' %} {{amount}} recently updated instances {% endif %} {% endblock %} @@ -20,8 +21,10 @@

    Instances found by command {{value}}

    {% elif mode == 'origin' %}

    Instances originated from {{value}}

    - {% elif mode == 'recently' %} + {% elif mode == 'added' %}

    {{amount}} recently added instances

    + {% elif mode == 'updated' %} +

    {{amount}} recently updated instances

    {% else %}

    mode={{mode}} not supported

    {% endif %} -- 2.39.5