Files
MtoRagSystem/templates/admin/model_config/list.html.twig
2026-02-17 21:06:21 +01:00

150 lines
5.5 KiB
Twig

{% extends 'admin/base.html.twig' %}
{% block title %}KI Modell-Generierung{% endblock %}
{% block body %}
<div class="d-flex justify-content-between align-items-center mb-4">
<h1 class="h3 mb-0">KI Modell-Generierung</h1>
{% if is_granted('ROLE_SUPER_ADMIN') %}
<a href="{{ path('admin_model_config_create') }}"
class="btn btn-sm btn-outline-info">
Neue Konfiguration
</a>
{% endif %}
</div>
<div class="card bg-black border-secondary">
<div class="card-body p-0">
<table class="table table-dark table-striped table-hover align-middle mb-0">
<thead class="table-secondary text-dark">
<tr>
<th>Modell</th>
<th>Version</th>
<th>Stream</th>
<th>Temp</th>
<th>Top K</th>
<th>Top P</th>
<th>Repeat</th>
<th>Ctx</th>
<th>Status</th>
<th class="text-end">Aktionen</th>
</tr>
</thead>
<tbody>
{% for config in configs %}
<tr>
<td>
<span class="text-info">{{ config.modelName }}</span>
</td>
<td>v{{ config.version }}</td>
<td>
{% if config.stream %}
<span class="badge bg-info text-dark">Streaming</span>
{% else %}
<span class="badge bg-secondary">Blocking</span>
{% endif %}
</td>
<td>{{ config.temperature }}</td>
<td>{{ config.topK }}</td>
<td>{{ config.topP }}</td>
<td>{{ config.repeatPenalty }}</td>
<td>{{ config.numCtx }}</td>
<td>
{% if config.active %}
<span class="badge bg-success">Aktiv</span>
{% else %}
<span class="badge bg-dark border border-secondary">
Inaktiv
</span>
{% endif %}
</td>
<td class="text-end">
{% if not config.active and is_granted('ROLE_SUPER_ADMIN') %}
{# Aktivieren via POST + CSRF #}
<form method="post"
action="{{ path('admin_model_config_activate', {id: config.id}) }}"
class="d-inline"
onsubmit="return confirm('Diese Konfiguration aktivieren?');">
<input type="hidden"
name="_token"
value="{{ csrf_token('activate_model_config_' ~ config.id) }}">
<button class="btn btn-sm btn-outline-success me-2">
Aktivieren
</button>
</form>
{# Löschen via POST + CSRF #}
<form method="post"
action="{{ path('admin_model_config_delete', {id: config.id}) }}"
class="d-inline"
onsubmit="return confirm('Konfiguration wirklich löschen?');">
<input type="hidden"
name="_token"
value="{{ csrf_token('delete_model_config_' ~ config.id) }}">
<button class="btn btn-sm btn-outline-danger">
Löschen
</button>
</form>
{% else %}
<span class="text-secondary small">—</span>
{% endif %}
</td>
</tr>
{% else %}
<tr>
<td colspan="10" class="text-center text-secondary py-4">
Keine Konfiguration vorhanden.
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<div class="mt-4 mb-4 small text-secondary">
Hinweis: Änderungen wirken sich unmittelbar auf die Generierungsparameter
des aktiven Modells aus. Pro Modell kann nur eine Version aktiv sein.
</div>
<h2 class="h4 mb-4">Agent Live Test</h2>
<div class="card bg-black border-info">
<div class="card-body p-0">
<iframe
src="/index.html?admin_test=1"
class="w-100 border-0"
style="height:75vh;"
></iframe>
</div>
</div>
<div class="mt-3 small text-secondary">
Der Agent läuft im isolierten Admin-Test-Modus.
Keine Persistenz. Keine produktive Session.
</div>
{% endblock %}