optimize ui
add new ki endpoint params
This commit is contained in:
@@ -4,7 +4,13 @@
|
||||
|
||||
{% block body %}
|
||||
|
||||
<h1 class="h4 mb-4">System Prompt</h1>
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h1 class="h3">System Prompt</h1>
|
||||
</div>
|
||||
|
||||
{# ============================= #}
|
||||
{# Flash Messages #}
|
||||
{# ============================= #}
|
||||
|
||||
{% for message in app.flashes('success') %}
|
||||
<div class="alert alert-success">{{ message }}</div>
|
||||
@@ -13,92 +19,154 @@
|
||||
<div class="alert alert-danger">{{ message }}</div>
|
||||
{% endfor %}
|
||||
|
||||
<div class="card bg-black text-info border-secondary mb-4">
|
||||
{# ============================= #}
|
||||
{# Neue Version erstellen #}
|
||||
{# ============================= #}
|
||||
|
||||
<div class="card bg-black border-secondary mb-5 text-light">
|
||||
<div class="card-body">
|
||||
|
||||
<h5 class="text-info mb-3">Neue Version erstellen</h5>
|
||||
|
||||
<form method="post">
|
||||
<input type="hidden"
|
||||
name="_token"
|
||||
value="{{ csrf_token('create_system_prompt') }}">
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Kommentar (optional)</label>
|
||||
<input type="text"
|
||||
name="comment"
|
||||
class="form-control bg-dark text-info border-secondary"
|
||||
class="form-control bg-dark text-light border-secondary"
|
||||
placeholder="Warum wurde der Prompt geändert?">
|
||||
<div class="form-text text-secondary">
|
||||
Dokumentation der Änderung für spätere Nachvollziehbarkeit.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Prompt Inhalt | Variablen: {% verbatim %}{% now %}{% endverbatim %} = Datum/Zeit</label>
|
||||
<label class="form-label">
|
||||
Prompt-Inhalt
|
||||
</label>
|
||||
<div class="form-text text-secondary mb-2">
|
||||
Verfügbare Variable:
|
||||
<code>{% verbatim %}{% now %}{% endverbatim %}</code>
|
||||
(aktuelles Datum/Zeit)
|
||||
</div>
|
||||
<textarea name="content"
|
||||
rows="16"
|
||||
class="form-control bg-dark text-info border-secondary"
|
||||
>{{ active ? active.content : '' }}</textarea>
|
||||
class="form-control bg-dark text-light border-secondary"
|
||||
required>{{ active ? active.content : '' }}</textarea>
|
||||
</div>
|
||||
|
||||
<button class="btn btn-outline-light">
|
||||
Neue Version speichern
|
||||
</button>
|
||||
|
||||
{% if is_granted('ROLE_SUPER_ADMIN') %}
|
||||
<div class="d-flex justify-content-end">
|
||||
<button class="btn btn-outline-info">
|
||||
Neue Version speichern
|
||||
</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card bg-black text-info border-secondary">
|
||||
{# ============================= #}
|
||||
{# Versionen Übersicht #}
|
||||
{# ============================= #}
|
||||
|
||||
<div class="card bg-black border-secondary">
|
||||
<div class="card-body">
|
||||
|
||||
<h5>Versionen</h5>
|
||||
<h5 class="text-info mb-3">Versionen</h5>
|
||||
|
||||
<table class="table table-dark table-sm table-bordered align-middle">
|
||||
<thead>
|
||||
<table class="table table-dark table-striped table-hover align-middle">
|
||||
<thead class="table-secondary text-dark">
|
||||
<tr>
|
||||
<th>Version</th>
|
||||
<th>Aktiv</th>
|
||||
<th>Status</th>
|
||||
<th>Kommentar</th>
|
||||
<th>Erstellt</th>
|
||||
<th>Aktionen</th>
|
||||
<th class="text-end">Aktionen</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
{% for p in all %}
|
||||
<tr>
|
||||
<td>{{ p.version }}</td>
|
||||
<td>v{{ p.version }}</td>
|
||||
|
||||
<td>
|
||||
{% if p.active %}
|
||||
<span class="badge bg-success">ACTIVE</span>
|
||||
<span class="badge bg-success">Aktiv</span>
|
||||
{% else %}
|
||||
<span class="badge bg-dark border border-secondary">
|
||||
Inaktiv
|
||||
</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{ p.comment ?? '-' }}</td>
|
||||
<td>{{ p.createdAt|date('d.m.Y H:i:s') }}</td>
|
||||
<td>
|
||||
|
||||
{% if not p.active %}
|
||||
<td>{{ p.comment ?? '-' }}</td>
|
||||
|
||||
<td>{{ p.createdAt|date('d.m.Y H:i:s') }}</td>
|
||||
|
||||
<td class="text-end">
|
||||
|
||||
{% if not p.active and is_granted('ROLE_SUPER_ADMIN') %}
|
||||
|
||||
{# Aktivieren #}
|
||||
<form method="post"
|
||||
action="{{ path('admin_system_prompt_activate', {id: p.id}) }}"
|
||||
style="display:inline-block;">
|
||||
<button class="btn btn-sm btn-outline-light">
|
||||
class="d-inline"
|
||||
onsubmit="return confirm('Diese Version aktivieren?');">
|
||||
|
||||
<input type="hidden"
|
||||
name="_token"
|
||||
value="{{ csrf_token('activate_system_prompt_' ~ p.id) }}">
|
||||
|
||||
<button class="btn btn-sm btn-outline-success me-2">
|
||||
Aktivieren
|
||||
</button>
|
||||
</form>
|
||||
|
||||
{# Löschen #}
|
||||
<form method="post"
|
||||
action="{{ path('admin_system_prompt_delete', {id: p.id}) }}"
|
||||
style="display:inline-block;"
|
||||
class="d-inline"
|
||||
onsubmit="return confirm('Version wirklich löschen?');">
|
||||
|
||||
<input type="hidden"
|
||||
name="_token"
|
||||
value="{{ csrf_token('delete_system_prompt_' ~ p.id) }}">
|
||||
|
||||
<button class="btn btn-sm btn-outline-danger">
|
||||
Löschen
|
||||
</button>
|
||||
</form>
|
||||
|
||||
{% else %}
|
||||
-
|
||||
<span class="text-secondary">—</span>
|
||||
{% endif %}
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="5" class="text-center text-secondary py-4">
|
||||
Keine Versionen vorhanden.
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 small text-secondary">
|
||||
Hinweis: Der aktive System Prompt beeinflusst das Antwortverhalten
|
||||
des LLM unmittelbar. Änderungen sollten dokumentiert und versioniert erfolgen.
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user