Files
Fail2banMqttActionBanishment/emitter/banevents/templates/banevents/dashboard.html
T
2026-07-20 11:05:07 +02:00

106 lines
5.4 KiB
HTML

{% load i18n %}
<!DOCTYPE html>
<html lang="{{ LANGUAGE_CODE }}">
<head>
<meta charset="utf-8">
<title>Fail2banActionBanisher — {% trans "Tableau de bord" %}</title>
<link rel="stylesheet" href="/static/banevents/css/main.css">
<link rel="stylesheet" href="/static/banevents/vendor/leaflet/leaflet.css">
<style>#banevents-map { height: 400px; border-radius: var(--radius-lg); overflow: hidden; }</style>
</head>
<body data-selected-node="{{ selected_node }}" style="--sidebar-w: {{ sidebar_width }};">
<div class="vc-messages" id="banevents-messages"></div>
<nav class="vc-sidebar">
<div class="vc-brand"><span>Fail2banActionBanishment</span><small>(C) dd@miraceti</small></div>
<div class="vc-sidebar-nav">
<a class="vc-nav-link vc-nav-link--active" href="{% url 'banevents:dashboard' %}">{% trans "Bannissements (direct)" %}</a>
<a class="vc-nav-link" href="{% url 'banevents:history' %}">{% trans "Historique" %}</a>
{% if community_enrollment_enabled %}
<a class="vc-nav-link" href="{% url 'banevents:community' %}">{% trans "Rejoindre la communauté" %}</a>
{% endif %}
{% include "banevents/_master_nav.html" %}
</div>
{% include "banevents/_sidebar_stats.html" %}
</nav>
<div class="vc-main-wrap vc-main-wrap--with-sidebar">
<main class="vc-main">
<div class="vc-container">
<div class="vc-page-header">
<h2>{% trans "Événements de bannissement" %}</h2>
{% if filterable_nodes|length > 1 %}
<form method="get" class="vc-header-actions">
<select name="node" class="vc-btn vc-btn--ghost vc-btn--sm" onchange="this.form.submit()">
<option value=""{% if not selected_node %} selected{% endif %}>{% trans "Tous les noeuds" %}</option>
{% for node in filterable_nodes %}
<option value="{{ node.node_id }}"{% if node.node_id == selected_node %} selected{% endif %}>{{ node.display_name }}{% if not node.is_online %} {% trans "(hors ligne)" %}{% endif %}</option>
{% endfor %}
</select>
</form>
{% endif %}
</div>
<div class="vc-card">
<div class="vc-card-title" style="justify-content: space-between;">
<span>{% trans "Carte" %}</span>
<button type="button" id="banevents-map-reset" class="vc-btn vc-btn--ghost vc-btn--sm">{% trans "Réinitialiser la vue" %}</button>
</div>
<div id="banevents-map"></div>
</div>
<div class="vc-card">
<table class="vc-table">
<thead>
<tr>
<th>{% trans "Reçu le" %}</th>
<th>{% trans "Noeud" %}</th>
<th>{% trans "Jail" %}</th>
<th>{% trans "Action" %}</th>
<th>IP</th>
<th>{% trans "Port/Protocole" %}</th>
<th>{% trans "Durée du ban" %}</th>
<th>{% trans "Localisation" %}</th>
</tr>
</thead>
<tbody id="banevents-table-body">
{% for event in events %}
{% include "banevents/_event_row.html" %}
{% endfor %}
</tbody>
</table>
{% if not events %}
<div class="vc-empty-state" id="banevents-empty-state">
<h3>{% trans "Aucun événement pour le moment" %}</h3>
<p>{% trans "En attente d'un ban à diffuser en direct via WebSocket (manage.py mqtt_listen doit tourner)." %}</p>
</div>
{% endif %}
</div>
</div>
</main>
</div>
<script id="banevents-initial-data" type="application/json">{{ events_json|safe }}</script>
{% comment %}
notifications.js n'est pas rendu côté serveur : les quelques mots
qu'il affiche (statut d'une commande reçue du master) passent par ce
bloc JSON plutôt que d'être codés en dur en français dans le .js.
{% endcomment %}
{% trans "Commande reçue du master (non gérée)" as js_i18n_unhandled %}
{% trans "appliqué" as js_i18n_ok %}
{% trans "échec" as js_i18n_error %}
{% trans "Fermer" as js_i18n_close %}
<script id="banevents-i18n" type="application/json">{
"unhandled": "{{ js_i18n_unhandled|escapejs }}",
"ok": "{{ js_i18n_ok|escapejs }}",
"error": "{{ js_i18n_error|escapejs }}",
"close": "{{ js_i18n_close|escapejs }}"
}</script>
<script src="/static/banevents/vendor/leaflet/leaflet.js"></script>
<script src="/static/banevents/js/stream.js"></script>
<script src="/static/banevents/js/table.js"></script>
<script src="/static/banevents/js/map.js"></script>
<script src="/static/banevents/js/notifications.js"></script>
<script src="/static/banevents/js/dashboard.js"></script>
</body>
</html>