From: Roland Häder Date: Fri, 13 Oct 2023 00:31:50 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3393638f931e03d62f6524bb8ea5f1ff1c7493f9;p=fba.git Continued: - added view for recently added instances --- diff --git a/daemon.py b/daemon.py index b16e9e9..f3f246f 100755 --- a/daemon.py +++ b/daemon.py @@ -123,6 +123,15 @@ WHERE {mode} = ? \ ORDER BY domain \ LIMIT ?", [value, amount] ) + elif mode == "recently": + database.cursor.execute( + f"SELECT * \ +FROM instances \ +ORDER BY first_seen DESC \ +LIMIT ?", [amount] + ) + else: + raise HTTPException(status_code=500, detail=f"mode='{mode}' is unsupported") domainlist = database.cursor.fetchall() return domainlist diff --git a/templates/views/index.html b/templates/views/index.html index 4630c10..8660d39 100644 --- a/templates/views/index.html +++ b/templates/views/index.html @@ -68,6 +68,11 @@
  • Obfuscation statistics
  • Block level statistics
  • + +

    Recently added:

    + {% endblock %} {% block footer %}
    diff --git a/templates/views/list.html b/templates/views/list.html index 09b12c0..1f5ff96 100644 --- a/templates/views/list.html +++ b/templates/views/list.html @@ -1,6 +1,12 @@ {% extends "base.html" %} -{% block title %}{% if mode == 'detection_mode' %} - Detection mode {{value}}{% elif mode == 'software' %} - Used software {{value}}{% elif mode == 'command' %} - Command {{value}}{% endif %}{% endblock %} +{% block title %} + {% if mode == 'detection_mode' %} - Detection mode {{value}} + {% elif mode == 'software' %} - Used software {{value}} + {% elif mode == 'command' %} - Command {{value}} + {% elif mode == 'recently' %} - {{amount}} recently added instances + {% endif %} +{% endblock %} {% block header %} {% if mode == 'detection_mode' %} @@ -11,6 +17,8 @@

    Instances found by command {{value}}

    {% elif mode == 'origin' %}

    Instances originated from {{value}}

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

    {{amount}} recently added instances

    {% else %}

    mode={{mode}} not supported

    {% endif %}