79 lines
2.7 KiB
HTML
79 lines
2.7 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}Admin Dashboard - {{ APP_TITLE }}{% endblock %}
|
|
|
|
{% block content %}
|
|
<h1>Administrator Dashboard</h1>
|
|
|
|
<nav>
|
|
<ul style="display: flex; gap: 1rem; flex-wrap: wrap; list-style: none; padding: 0;">
|
|
<li><a href="{{ url_for('admin.accounts', tenant=session.tenant_code) }}" role="button">Accountverwaltung</a></li>
|
|
<li><a href="{{ url_for('admin_gruppen.gruppen', tenant=session.tenant_code) }}" role="button" class="secondary">Gruppenverwaltung</a></li>
|
|
<li><a href="{{ url_for('admin_strassen.strassen', tenant=session.tenant_code) }}" role="button" class="secondary">Straßenverwaltung</a></li>
|
|
</ul>
|
|
</nav>
|
|
|
|
<section>
|
|
<h2>API-Zugriffstoken</h2>
|
|
<p>
|
|
Mit diesen Tokens können externe Systeme Gruppenpositionen über die
|
|
API melden. Tokens sind mandantenweit gültig und sollten geheim
|
|
gehalten werden.
|
|
</p>
|
|
{% if api_tokens %}
|
|
<table id="apiTokenTable">
|
|
<thead>
|
|
<tr>
|
|
<th>Token</th>
|
|
<th>Erstellt</th>
|
|
<th>Ersteller</th>
|
|
<th>Aktion</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for token in api_tokens %}
|
|
<tr>
|
|
<td><code class="api-token-value">{{ token.token }}</code></td>
|
|
<td>{{ token.created_at }}</td>
|
|
<td>{{ token.created_by_name or '-' }}</td>
|
|
<td>
|
|
<button type="button" class="secondary"
|
|
onclick="deleteApiToken({{ token.id }})">Löschen</button>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% else %}
|
|
<p id="apiTokenEmpty">Noch keine API-Zugriffstoken vorhanden.</p>
|
|
{% endif %}
|
|
<button type="button" id="createApiTokenBtn">Neuen Token generieren</button>
|
|
</section>
|
|
|
|
<section>
|
|
<h2>Broker Status</h2>
|
|
<p>Aktive WebSocket-Verbindungen</p>
|
|
<table id="brokerStatusTable">
|
|
<thead>
|
|
<tr>
|
|
<th>Client-ID</th>
|
|
<th>Account-ID</th>
|
|
<th>Account</th>
|
|
<th>Rolle</th>
|
|
<th>Gruppe / Alias</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="brokerStatusBody">
|
|
<tr><td colspan="5">Lade...</td></tr>
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
|
|
<p style="margin-top: 2rem;"><a href="{{ url_for('auth.logout', tenant=session.tenant_code) }}" role="button" class="contrast">Abmelden</a></p>
|
|
{% endblock %}
|
|
|
|
{% block scripts %}
|
|
<script>window.CMBNET_ADMIN_RELOAD_WATCH = true;</script>
|
|
<script src="{{ url_for('static', filename='js/views/admin_dashboard.js') }}"></script>
|
|
{% endblock %}
|