if response is not None:
blocklist = response.json()
+ found = 0
for block_level in blocklist:
for block in blocklist[block_level]:
block["first_seen"] = datetime.utcfromtimestamp(block["first_seen"]).strftime(config.get("timestamp_format"))
block["last_seen"] = datetime.utcfromtimestamp(block["last_seen"]).strftime(config.get("timestamp_format"))
+ found = found + 1
return templates.TemplateResponse("views/top.html", {
- "request": request,
- "mode" : mode if response is not None else None,
- "value" : value if response is not None else None,
- "amount" : amount if response is not None else None,
- "blocks" : blocklist,
- "info" : info,
+ "request" : request,
+ "mode" : mode if response is not None else None,
+ "value" : value if response is not None else None,
+ "amount" : amount if response is not None else None,
+ "found" : found,
+ "blocklist": blocklist,
+ "info" : info,
})
@router.get(config.get("base_url") + "/rss")
min-width: 50%;
width: 50em;
}
- .notes {
+ .notice {
margin-left: auto;
margin-right: auto;
margin-bottom: 20px;
border: 1px solid #eaeaea;
border-radius: 5px;
}
- .notes > div {
+ .notice > div {
margin: 0px;
padding: 5px;
}
- .notes > h2 {
+ .notice > h2 {
margin: 0px;
padding: 5px;
background-color: #eaeaea;
{% block footer %}
{% if mode == 'error_code' %}
- <div class="notes">
+ <div class="notice">
<h2>Error codes:</h2>
<ul>
<li>Error code 999 is fake and covers a lot of reasons why the domain/instance is not reachable. Mostly that the domain is not resolvable or the server refused connection.</li>
</ul>
</div>
{% elif mode == 'detection_mode' %}
- <div class="notes">
+ <div class="notice">
<h2>Detection modes:</h2>
<div>
Detection is done in following order:
</ol>
</div>
{% elif mode == 'obfuscation' %}
- <div class="notes">
+ <div class="notice">
<h2>Obfuscation status:</h2>
<ul>
<li>Only supported networks are counted here.</li>
{% endblock %}
{% block content %}
- {% for block_level in blocks %}
+ {% if amount == found %}
+ <div class="notice">
+ <h2>Maximum amount reached!</h2>
+ <div>
+ Please note that the maximum allowed amount is only returned, the blocker/blocked/reason might be more.
+ Paging support is not finished yet.
+ </div>
+ </div>
+ {% endif %}
+
+ {% for block_level in blocklist %}
<div class="block_level" id="{{block_level}}">
- <h2>{{block_level}} ({{blocks[block_level]|length}})</h2>
+ <h2>{{block_level}} ({{blocklist[block_level]|length}})</h2>
<table>
<thead>
<th>Blocker</th>
</thead>
<tbody>
- {% for block in blocks[block_level] %}
+ {% for block in blocklist[block_level] %}
<tr>
<td>
{% with domain=block['blocker'] %}