refactor form for blocklist download

This commit is contained in:
carnivuth
2026-01-27 17:42:20 +01:00
parent cadf77da44
commit 7e74896dfd

View File

@@ -9,6 +9,11 @@ import html
from datetime import datetime
from zoneinfo import ZoneInfo
# imports for the __init_subclass__ method, do not remove pls
from firewall import fwtype
from firewall.iptables import Iptables
from firewall.raw import Raw
def _escape(value) -> str:
"""Escape HTML special characters to prevent XSS attacks."""
@@ -653,11 +658,13 @@ def generate_dashboard(stats: dict, dashboard_path: str = "") -> str:
</svg>
<span class="github-logo-text">BlessedRebuS/Krawl</span>
</a>
<div class="download-section">
<a href="{dashboard_path}/api/download/malicious_ips.txt" class="download-btn" download>
Export Malicious IPs
</a>
</div>
<form class="download-section" action="{dashboard_path}/api/get_banlist" method="GET" >
<select class="download-btn" name="fwtype" id="fwtype">
<option value="raw">raw</option>
<option value="iptables">iptables</option>
</select>
<input type="submit" class="download-btn" value="Export IPs Banlist">
</form>
<h1>Krawl Dashboard</h1>
<div class="stats-grid">