routers/admin_flows.py: pro Organisation unbestätigte Geräte anzeigen und bestätigen (Bereitstellungsvorlage zuweisen), Enrollment Sessions anlegen/widerrufen. Confirm-Aktion ruft direkt anodes bestehenden resolve-Endpoint auf. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
80 lines
3.3 KiB
HTML
80 lines
3.3 KiB
HTML
{% extends "admin/layout.html" %}
|
|
{% block title %}Flows: {{ organization.name if organization else organization_id }} — Tuxflotte Admin{% endblock %}
|
|
{% block admin_content %}
|
|
<p><a href="/admin/flows">← Flows</a></p>
|
|
<h2>{{ organization.name if organization else organization_id }}</h2>
|
|
|
|
<section>
|
|
<h3>Unbestätigte Geräte</h3>
|
|
<p><small>Geräte ohne Bereitstellungsvorlagen-Zuweisung. Bestätigung setzt eine Vorlage und schaltet die Installation frei (deckt den serverseitigen Teil aus ADR-0008 ab, nicht das Installer-seitige Warten im Auto-Modus).</small></p>
|
|
{% if not unassigned_devices %}
|
|
<p>Keine unbestätigten Geräte.</p>
|
|
{% else %}
|
|
<figure>
|
|
<table>
|
|
<tbody>
|
|
{% for device in unassigned_devices %}
|
|
<tr>
|
|
<td>{{ device.hostname or device.device_fingerprint }}</td>
|
|
<td>{{ device.created_at }}</td>
|
|
<td>
|
|
<form method="post" action="/admin/flows/{{ organization_id }}/geraete/{{ device.id }}/bestaetigen">
|
|
<select name="bereitstellungsvorlage_id">
|
|
{% for bv in bereitstellungsvorlagen %}
|
|
<option value="{{ bv.id }}" {{ "selected" if bv.is_default else "" }}>{{ bv.label }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
<button type="submit">Bestätigen</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</figure>
|
|
{% endif %}
|
|
</section>
|
|
|
|
<section>
|
|
<h3>Enrollment Sessions</h3>
|
|
<figure>
|
|
<table>
|
|
<thead><tr><th>Vorlage</th><th>Geräte</th><th>Läuft ab</th><th>Status</th><th></th></tr></thead>
|
|
<tbody>
|
|
{% for es in enrollment_sessions %}
|
|
<tr>
|
|
<td>{{ es.bereitstellungsvorlage_label }}</td>
|
|
<td>{{ es.devices_used }} / {{ es.max_devices }}</td>
|
|
<td>{{ es.expires_at }}</td>
|
|
<td>{{ "widerrufen" if es.revoked_at else "aktiv" }}</td>
|
|
<td>
|
|
{% if not es.revoked_at %}
|
|
<form method="post" action="/admin/flows/{{ organization_id }}/enrollment-sessions/{{ es.id }}/widerrufen">
|
|
<button type="submit" class="secondary outline">Widerrufen</button>
|
|
</form>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</figure>
|
|
|
|
<details>
|
|
<summary role="button" class="secondary outline">Neue Enrollment Session anlegen</summary>
|
|
<form method="post" action="/admin/flows/{{ organization_id }}/enrollment-sessions">
|
|
<label>Bereitstellungsvorlage
|
|
<select name="bereitstellungsvorlage_id">
|
|
{% for bv in bereitstellungsvorlagen %}
|
|
<option value="{{ bv.id }}">{{ bv.label }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</label>
|
|
<label>Max. Geräteanzahl<input type="number" name="max_devices" value="10" min="1" required></label>
|
|
<label>Läuft ab am<input type="datetime-local" name="expires_at" required></label>
|
|
<button type="submit">Anlegen</button>
|
|
</form>
|
|
</details>
|
|
</section>
|
|
{% endblock %}
|