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
<li><a href="scoreboard?mode=obfuscation&amount=10">Obfuscation statistics</a></li>
<li><a href="scoreboard?mode=block_level&amount=20">Block level statistics</a></li>
</ul>
+
+ <h2>Recently added:</h2>
+ <ul class="nav">
+ <li><a href="list?mode=recently&value=1&amount=50">50 instances</a></li>
+ </ul>
{% endblock %}
{% block footer %}
<div class="notice">
{% 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' %}
<h1>Instances found by command {{value}}</h1>
{% elif mode == 'origin' %}
<h1>Instances originated from {{value}}</h1>
+ {% elif mode == 'recently' %}
+ <h1>{{amount}} recently added instances</h1>
{% else %}
<h1 style="color: red">mode={{mode}} not supported</h1>
{% endif %}