62 lines
4.1 KiB
HTML
62 lines
4.1 KiB
HTML
{% extends "base.html" %}
|
||
{% block title %}Tools{% endblock %}
|
||
{% set labels = {'allow': 'erlauben', 'require_approval': 'Freigabe nötig', 'deny': 'sperren'} %}
|
||
{% block content %}
|
||
<div class="stack stack-sm">
|
||
<h1>Tools</h1>
|
||
<p class="text-muted">Nicht eingestufte Tools sind gesperrt und werden dem Modell nicht angeboten. Ändert sich die Definition eines Tools (Beschreibung oder Schema), ist es wieder gesperrt, bis es neu eingestuft wird. Workspaces können die Einstufung nur verschärfen. Für Tools mit Freigabe legt die Freigabestufe fest, wer entscheidet (globale Approver werden unter <a href="/admin/users">Nutzer</a> benannt); mit „Vier Augen“ darf niemand seinen eigenen Antrag freigeben.</p>
|
||
</div>
|
||
{% include "_flash.html" %}
|
||
{% set open = definitions|rejectattr('classified')|list %}
|
||
{% if open %}
|
||
<div class="alert alert-warning" role="status"><div class="alert-content">
|
||
<p>{{ open|length }} Tools sind nicht eingestuft.</p>
|
||
<form method="post" action="/admin/tools/suggested" data-confirm="Alle nicht eingestuften Tools nach dem Vorschlag einstufen?">
|
||
<input type="hidden" name="_csrf" value="{{ p.csrf }}">
|
||
<button class="btn btn-secondary btn-sm" type="submit">Vorschläge übernehmen</button>
|
||
</form>
|
||
</div></div>
|
||
{% endif %}
|
||
|
||
<section class="card"><div class="card-body">
|
||
<div class="table-wrap"><table>
|
||
<thead><tr><th>Tool</th><th>Status</th><th>Einstufung</th></tr></thead>
|
||
<tbody>
|
||
{% for d in definitions %}
|
||
<tr>
|
||
<td>
|
||
<code>{{ d.name }}</code>
|
||
{% set o = origins.get(d.kind) %}
|
||
{% if o %}<p class="text-xs">{% if o.role == 'database' %}<span class="badge badge-info">Datenbank-Treiber</span> gilt für alle Datenbanken dieses Typs{% elif o.workspace_id %}<span class="badge badge-default">Verbindung</span> nur im Workspace {{ workspace_names.get(o.workspace_id, o.workspace_id) }}{% else %}<span class="badge badge-default">MCP-Server</span> {{ o.label }}{% endif %}{% if d.inherited_from %} · Einstufung von <code>{{ d.inherited_from }}</code> übernommen{% endif %}</p>{% endif %}
|
||
<p class="text-xs text-muted">{{ d.description }}</p>
|
||
<details><summary class="text-xs">Schema</summary><pre class="text-xs aiw-message">{{ d.schema|tojson(indent=2) }}</pre></details>
|
||
</td>
|
||
<td>
|
||
{% if d.classified %}<span class="badge badge-success">eingestuft</span>
|
||
{% elif d.classified_hash %}<span class="badge badge-warning">geändert – neu einstufen</span>
|
||
{% else %}<span class="badge badge-default">nicht eingestuft</span>{% endif %}
|
||
<p class="text-xs text-muted">Vorschlag: {{ d.suggested_risk }}</p>
|
||
</td>
|
||
<td>
|
||
<form method="post" action="/admin/tools/{{ d.name }}" class="cluster">
|
||
<input type="hidden" name="_csrf" value="{{ p.csrf }}">
|
||
<select name="risk_class" aria-label="Risikoklasse">
|
||
{% for c in classes %}<option value="{{ c }}" {% if (d.risk_class or d.suggested_risk) == c %}selected{% endif %}>{{ c }}</option>{% endfor %}
|
||
</select>
|
||
<select name="decision" aria-label="Entscheidung">
|
||
{% for c in decisions %}<option value="{{ c }}" {% if (d.decision if d.classified else defaults[d.risk_class or d.suggested_risk]) == c %}selected{% endif %}>{{ labels[c] }}</option>{% endfor %}
|
||
</select>
|
||
<select name="approval_level" aria-label="Freigabe durch" title="Wer Anträge dieses Tools entscheidet">
|
||
<option value="workspace_admin" {% if d.approval_level != 'global_approver' %}selected{% endif %}>Freigabe: Workspace (Admin oder Freigeber)</option>
|
||
<option value="global_approver" {% if d.approval_level == 'global_approver' %}selected{% endif %}>Freigabe: globaler Approver</option>
|
||
</select>
|
||
<label class="cluster text-sm"><input type="checkbox" name="four_eyes" value="1" {% if d.four_eyes %}checked{% endif %}> Vier Augen</label>
|
||
<button class="btn btn-ghost btn-sm" type="submit">{{ 'Ändern' if d.classified else 'Einstufen' }}</button>
|
||
</form>
|
||
</td>
|
||
</tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table></div>
|
||
</div></section>
|
||
{% endblock %}
|