optimize ui

add new ki endpoint params
This commit is contained in:
team2
2026-02-17 20:36:47 +01:00
parent 5b2a633a99
commit 6822c8f3f8
23 changed files with 1915 additions and 608 deletions

View File

@@ -4,51 +4,64 @@
{% block body %}
<a href="{{ path('admin_dashboard') }}"
class="btn btn-sm btn-outline-light mb-3">
← Zurück
</a>
<div class="d-flex justify-content-between align-items-center mb-4">
<h1 class="h3">Wissensdaten (Chunk-Index)</h1>
<h1 class="h4 mb-4">Wissensdaten (Chunk-Index)</h1>
<a href="{{ path('admin_dashboard') }}"
class="btn btn-sm btn-outline-secondary">
Zurück zum Dashboard
</a>
</div>
{# ============================= #}
{# Index Meta Section #}
{# ============================= #}
<div class="card bg-black text-info border-secondary mb-4"{#>
<div class="card bg-black border-secondary mb-5">
<div class="card-body">
<h5 class="mb-3">Index Meta (index_meta.json)</h5>
<h5 class="text-info mb-3">Index Meta (index_meta.json)</h5>
{% if meta.error is defined %}
<div class="alert alert-danger">
<strong>Fehler:</strong><br>
{{ meta.error }}<br>
<small>{{ meta.path }}</small>
<small class="text-muted">{{ meta.path }}</small>
</div>
{% else %}
<table class="table table-dark table-sm table-bordered align-middle mb-0">
<tbody>
{% for key, value in meta %}
<tr>
<th style="width:280px;">{{ key }}</th>
<td>
{% if value is iterable %}
<pre class="mb-0 text-info">
<div class="table-responsive">
<table class="table table-dark table-striped align-middle mb-0">
<tbody>
{% for key, value in meta %}
<tr>
<th style="width:260px;" class="text-secondary">
{{ key }}
</th>
<td>
{% if value is iterable %}
<pre class="mb-0 small text-info">
{{ value|json_encode(constant('JSON_PRETTY_PRINT')) }}
</pre>
{% else %}
{{ value }}
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% else %}
{{ value }}
{% endif %}
</td>
</tr>
{% else %}
<tr>
<td colspan="2" class="text-secondary">
Keine Meta-Daten vorhanden.
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
</div>
</div>#}
</div>
{# ============================= #}
{# NDJSON Section #}
@@ -57,19 +70,27 @@
{% set currentPage = ndjson.page|default(1) %}
{% set currentLimit = ndjson.limit|default(50) %}
<div class="card bg-black text-info border-secondary mb-4">
<div class="card bg-black border-secondary">
<div class="card-body">
<div class="d-flex justify-content-between align-items-center mb-3">
<h5 class="mb-0">NdJson Index Übersicht Chunks (index.ndjson)</h5>
<h5 class="text-info mb-0">
NDJSON-Index Übersicht (index.ndjson)
</h5>
<div>
<a href="{{ path('admin_system_agent', {page: (currentPage - 1 < 1 ? 1 : currentPage - 1), limit: currentLimit}) }}"
<div class="btn-group">
<a href="{{ path('admin_system_agent', {
page: currentPage > 1 ? currentPage - 1 : 1,
limit: currentLimit
}) }}"
class="btn btn-sm btn-outline-light">
← Zurück
</a>
<a href="{{ path('admin_system_agent', {page: currentPage + 1, limit: currentLimit}) }}"
<a href="{{ path('admin_system_agent', {
page: currentPage + 1,
limit: currentLimit
}) }}"
class="btn btn-sm btn-outline-light">
Weiter →
</a>
@@ -84,50 +105,74 @@
</div>
{% endif %}
<div class="mb-2 text-secondary">
Datei vorhanden: {{ ndjson.path ? 'JA' : 'NEIN' }} |
Geladene Einträge: {{ debugCount|default(0) }} |
Seite {{ currentPage }} • Limit {{ currentLimit }}
<div class="mb-3 small text-secondary">
Datei:
{% if ndjson.path %}
<span class="badge bg-success">Vorhanden</span>
{% else %}
<span class="badge bg-danger">Nicht gefunden</span>
{% endif %}
• Geladene Einträge: {{ debugCount|default(0) }}
• Seite {{ currentPage }}
• Limit {{ currentLimit }}
</div>
<div class="table-responsive">
<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 style="width:220px;">chunk_id</th>
<th style="width:200px;">chunk_id</th>
<th style="width:180px;">document_id</th>
<th>Text (gekürzt)</th>
</tr>
</thead>
<tbody>
{% for item in ndjson.items|default([]) %}
<tr>
<td>{{ item.chunk_id ?? '-' }}</td>
<td> <a href="{{ path('admin_document_show', {id: item.document_id}) }}"
class="text-decoration-none text-light">
{{ item.document_id ?? '-' }}
</a></td>
<td class="small">{{ item.chunk_id ?? '-' }}</td>
<td>
{% if item.document_id %}
<a href="{{ path('admin_document_show', {id: item.document_id}) }}"
class="text-decoration-none text-light">
{{ item.document_id }}
</a>
{% else %}
-
{% endif %}
</td>
<td>
{% set text = item.text ?? '' %}
{{ text|slice(0, 240) }}{% if text|length > 240 %}{% endif %}
<div class="small">
{{ text|slice(0, 240) }}
{% if text|length > 240 %}{% endif %}
</div>
<details class="mt-2">
<summary class="text-secondary" style="cursor:pointer;">
<summary class="text-secondary small">
JSON anzeigen
</summary>
<pre class="bg-dark text-info p-2 border border-secondary rounded mt-2">
<pre class="bg-dark text-info p-2 border border-secondary rounded mt-2 small">
{{ item|json_encode(constant('JSON_PRETTY_PRINT')) }}
</pre>
</pre>
</details>
</td>
</tr>
{% else %}
<tr>
<td colspan="3" class="text-secondary">
<td colspan="3" class="text-center text-secondary py-4">
Keine Einträge gefunden.
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
@@ -135,4 +180,10 @@
</div>
</div>
<div class="mt-4 small text-secondary">
Hinweis: Änderungen am NDJSON-Index oder an der Indexstruktur können
inkonsistente Retrieval-Ergebnisse verursachen, bis ein vollständiger
Reindex durchgeführt wurde.
</div>
{% endblock %}