Dieser Commit ist enthalten in:
Claude Project Manager
2025-07-05 17:51:16 +02:00
Commit 0d7d888502
1594 geänderte Dateien mit 122839 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -0,0 +1,151 @@
{% extends "base.html" %}
{% block title %}Aktive Lizenzsitzungen{% endblock %}
{% block content %}
<div class="container-fluid">
<h1>Lizenzsitzungen</h1>
<div class="row mb-4">
<div class="col-12">
<div class="card">
<div class="card-header">
<h5>Aktive Sitzungen</h5>
</div>
<div class="card-body">
{% if active_sessions %}
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>Lizenzschlüssel</th>
<th>Kunde</th>
<th>Hardware ID</th>
<th>IP-Adresse</th>
<th>Version</th>
<th>Gestartet</th>
<th>Letztes Heartbeat</th>
<th>Status</th>
<th>Aktion</th>
</tr>
</thead>
<tbody>
{% for session in active_sessions %}
<tr>
<td><code>{{ session[2][:8] }}...</code></td>
<td>{{ session[3] or 'Unbekannt' }}</td>
<td><code>{{ session[4][:12] }}...</code></td>
<td>{{ session[5] or 'Unbekannt' }}</td>
<td>{{ session[6] }}</td>
<td>{{ session[7].strftime('%H:%M:%S') }}</td>
<td>{{ session[8].strftime('%H:%M:%S') }}</td>
<td>
{% if session[9] < 90 %}
<span class="badge bg-success">Aktiv</span>
{% elif session[9] < 120 %}
<span class="badge bg-warning">Timeout bald</span>
{% else %}
<span class="badge bg-danger">Timeout</span>
{% endif %}
</td>
<td>
{% if session.get('username') in ['rac00n', 'w@rh@mm3r'] %}
<form method="POST" action="{{ url_for('admin.terminate_session', session_id=session[0]) }}"
style="display: inline;" onsubmit="return confirm('Sitzung wirklich beenden?');">
<button type="submit" class="btn btn-sm btn-danger">Beenden</button>
</form>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<p class="text-muted">Keine aktiven Sitzungen vorhanden.</p>
{% endif %}
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<h5>Sitzungsverlauf (letzte 24 Stunden)</h5>
</div>
<div class="card-body">
{% if session_history %}
<div class="table-responsive">
<table class="table table-sm">
<thead>
<tr>
<th>Lizenzschlüssel</th>
<th>Kunde</th>
<th>Hardware ID</th>
<th>IP-Adresse</th>
<th>Version</th>
<th>Gestartet</th>
<th>Beendet</th>
<th>Dauer</th>
<th>Grund</th>
</tr>
</thead>
<tbody>
{% for hist in session_history %}
<tr>
<td><code>{{ hist[1][:8] }}...</code></td>
<td>{{ hist[2] or 'Unbekannt' }}</td>
<td><code>{{ hist[3][:12] }}...</code></td>
<td>{{ hist[4] or 'Unbekannt' }}</td>
<td>{{ hist[5] }}</td>
<td>{{ hist[6].strftime('%d.%m %H:%M') }}</td>
<td>{{ hist[7].strftime('%d.%m %H:%M') }}</td>
<td>
{% set duration = hist[9] %}
{% if duration < 60 %}
{{ duration|int }}s
{% elif duration < 3600 %}
{{ (duration / 60)|int }}m
{% else %}
{{ (duration / 3600)|round(1) }}h
{% endif %}
</td>
<td>
{% if hist[8] == 'normal' %}
<span class="badge bg-success">Normal</span>
{% elif hist[8] == 'timeout' %}
<span class="badge bg-warning">Timeout</span>
{% elif hist[8] == 'forced' %}
<span class="badge bg-danger">Erzwungen</span>
{% elif hist[8] == 'replaced' %}
<span class="badge bg-info">Ersetzt</span>
{% else %}
{{ hist[8] }}
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<p class="text-muted">Keine Sitzungen in den letzten 24 Stunden.</p>
{% endif %}
</div>
</div>
</div>
</div>
<div class="mt-3">
<a href="{{ url_for('admin.license_config') }}" class="btn btn-secondary">Zurück zur Konfiguration</a>
</div>
</div>
<script>
// Auto-refresh every 30 seconds
setTimeout(function() {
location.reload();
}, 30000);
</script>
{% endblock %}