59 lines
4.1 KiB
HTML
59 lines
4.1 KiB
HTML
{% extends "base.html" %}
|
||
{% block title %}Hugin{% endblock %}
|
||
{% block content %}
|
||
<div class="stack stack-sm">
|
||
<h1>Hugin</h1>
|
||
<p class="text-muted">Hugin ist das Register für geprüfte Regeln, Skills und Befehle. Hier trägst du die Hugin-Instanz der Plattform ein. Den Integrations-Key (<code>hi_…</code>) seines Tenants trägt jeder Workspace-Admin unter <em>Einstellungen → Hugin</em> selbst ein; er bestimmt, welche Pakete und Pflichtpakete im Workspace gelten.</p>
|
||
</div>
|
||
{% include "_flash.html" %}
|
||
|
||
<section class="card"><div class="card-body stack stack-sm">
|
||
<h2>Host</h2>
|
||
{% if host %}
|
||
<p class="cluster"><code>{{ host.url }}</code>
|
||
{% if host.status == 'ok' %}<span class="badge badge-success">erreichbar</span>{% elif host.status == 'error' %}<span class="badge badge-danger">Fehler</span>{% else %}<span class="badge badge-default">ungeprüft</span>{% endif %}
|
||
{% if host.checked %}<span class="text-xs text-muted">geprüft {{ host.checked.strftime('%d.%m.%Y %H:%M') }}</span>{% endif %}</p>
|
||
{% if host.status == 'error' and host.status_message %}<p class="text-sm text-muted">{{ host.status_message }}</p>{% endif %}
|
||
{% else %}<p class="text-muted">Noch kein Host eingetragen; ohne Host können Workspaces Hugin nicht nutzen.</p>{% endif %}
|
||
<form method="post" action="/admin/hugin" class="stack stack-sm">
|
||
<input type="hidden" name="_csrf" value="{{ p.csrf }}">
|
||
<div class="form-group">
|
||
<label for="url">Adresse</label>
|
||
<input id="url" name="url" required type="url" value="{{ url }}" placeholder="https://hugin.example.org">
|
||
<p class="form-hint">Nur https und nur Hosts aus AIW_MCP_ALLOWED_HOSTS (lokal auch http://localhost). Geprüft wird die Erreichbarkeit (<code>/readyz</code>); ob ein Key gilt, zeigt jeder Workspace.</p>
|
||
</div>
|
||
<div class="cluster">
|
||
<button class="btn btn-primary btn-sm" type="submit">Speichern und prüfen</button>
|
||
</div>
|
||
</form>
|
||
{% if host %}
|
||
<form method="post" action="/admin/hugin/check">
|
||
<input type="hidden" name="_csrf" value="{{ p.csrf }}"><button class="btn btn-ghost btn-sm" type="submit">Erneut prüfen</button>
|
||
</form>
|
||
{% endif %}
|
||
</div></section>
|
||
|
||
<section class="card"><div class="card-body stack stack-sm">
|
||
<h2>Workspaces</h2>
|
||
<p class="text-sm text-muted">Welche Workspaces Hugin nutzen und mit welchem Tenant. Keys sind hier nicht sichtbar.</p>
|
||
{% if workspaces %}
|
||
<div class="table-wrap"><table>
|
||
<thead><tr><th>Workspace</th><th>Team</th><th>Zugang</th><th>Tenant</th><th>Pakete</th><th>Abgleich</th></tr></thead>
|
||
<tbody>
|
||
{% for s in workspaces %}{% set a = s.access %}
|
||
<tr>
|
||
<td><a href="/workspaces/{{ s.workspace.id }}">{{ s.workspace.name }}</a></td>
|
||
<td>{{ s.team }}</td>
|
||
<td>{% if not a %}<span class="text-muted">nicht eingerichtet</span>{% elif a.status == 'ok' %}<span class="badge badge-success">ok</span>{% elif a.status == 'error' %}<span class="badge badge-danger">Fehler</span>{% else %}<span class="badge badge-default">ungeprüft</span>{% endif %}
|
||
{% if a and a.status == 'error' and a.status_message %}<p class="text-xs text-muted">{{ a.status_message }}</p>{% endif %}
|
||
{% if a and a.checked %}<p class="text-xs text-muted">geprüft {{ a.checked.strftime('%d.%m.%Y %H:%M') }}</p>{% endif %}</td>
|
||
<td>{% if a and a.tenant %}<code>{{ a.tenant }}</code>{% if a.key_name %}<p class="text-xs text-muted">Key „{{ a.key_name }}“</p>{% endif %}{% else %}–{% endif %}</td>
|
||
<td class="text-sm">{% if s.locked or s.chosen %}{{ s.locked }} festgeschrieben<p class="text-xs text-muted">{{ s.chosen }} gewählt</p>{% else %}–{% endif %}</td>
|
||
<td class="text-sm">{% if a and a.synced %}{% if a.findings %}<span class="badge badge-warning" title="{{ s.findings|join('; ') }}">{{ s.findings|length }} offen</span>{% else %}<span class="text-muted">aktuell</span>{% endif %}<p class="text-xs text-muted">{{ a.synced.strftime('%d.%m.%Y %H:%M') }}</p>{% else %}–{% endif %}</td>
|
||
</tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table></div>
|
||
{% else %}<p class="text-muted">Noch keine Workspaces.</p>{% endif %}
|
||
</div></section>
|
||
{% endblock %}
|