index.php
- Pfad:
src/View/system-explorer/chunks/index.php - Namespace: -
- Zeilen: 89 | Größe: 3,900 Bytes
- Geändert: 2025-12-20 14:49:45 | Gescannt: 2025-12-31 10:22:15
Code Hygiene Score: 100
- Dependencies: 100 (25%)
- LOC: 100 (20%)
- Methods: 100 (20%)
- Secrets: 100 (15%)
- Classes: 100 (10%)
- Magic Numbers: 100 (10%)
Keine Issues gefunden.
Code
<?php ob_start(); ?>
<nav class="breadcrumb">
<a href="/">Home</a> » <a href="/explorer">Explorer</a> » <a href="/system-explorer">System Explorer</a> » Chunks
</nav>
<h1>Chunks</h1>
<p>Textabschnitte mit Vektor-Embeddings. Gesamt: <?= number_format($totalCount) ?> Chunks.</p>
<form method="get" class="filter-form">
<input type="text" name="search" value="<?= htmlspecialchars($currentSearch) ?>" placeholder="Suche in Inhalt/Keywords...">
<select name="category">
<option value="">Alle Kategorien</option>
<?php foreach ($categories as $cat): ?>
<option value="<?= htmlspecialchars($cat) ?>" <?= $currentCategory === $cat ? 'selected' : '' ?>><?= htmlspecialchars($cat) ?></option>
<?php endforeach; ?>
</select>
<select name="status">
<option value="">Alle Status</option>
<option value="pending" <?= $currentStatus === 'pending' ? 'selected' : '' ?>>Pending</option>
<option value="completed" <?= $currentStatus === 'completed' ? 'selected' : '' ?>>Completed</option>
<option value="failed" <?= $currentStatus === 'failed' ? 'selected' : '' ?>>Failed</option>
</select>
<button type="submit" class="btn btn--primary">Filtern</button>
<?php if ($currentSearch || $currentCategory || $currentStatus): ?>
<a href="/system-explorer/chunks" class="btn">Reset</a>
<?php endif; ?>
</form>
<table data-sortable>
<thead>
<tr>
<th data-sort="id">ID</th>
<th data-sort="dokument_title">Dokument</th>
<th data-sort="taxonomy_category">Kategorie</th>
<th data-sort="token_count">Tokens</th>
<th data-sort="analysis_status">Status</th>
<th data-sort="content">Inhalt</th>
</tr>
</thead>
<tbody>
<?php foreach ($chunks as $c): ?>
<tr>
<td><a href="/system-explorer/chunks/<?= $c['id'] ?>">#<?= $c['id'] ?></a></td>
<td><a href="/docs/<?= htmlspecialchars($c['dokument_path']) ?>"><?= htmlspecialchars(substr($c['dokument_title'], 0, 30)) ?></a></td>
<td>
<?php if ($c['taxonomy_category']): ?>
<a href="?category=<?= urlencode($c['taxonomy_category']) ?>">
<span class="badge"><?= htmlspecialchars($c['taxonomy_category']) ?></span>
</a>
<?php endif; ?>
</td>
<td><?= $c['token_count'] ?></td>
<td>
<?php if ($c['qdrant_id']): ?>
<span class="badge badge--success">synced</span>
<?php elseif ($c['analysis_status'] === 'completed'): ?>
<span class="badge badge--info">analyzed</span>
<?php else: ?>
<span class="badge"><?= $c['analysis_status'] ?></span>
<?php endif; ?>
</td>
<td><?= htmlspecialchars(substr(strip_tags($c['content']), 0, 80)) ?>...</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php if ($totalPages > 1): ?>
<div class="pagination">
<?php if ($currentPage > 1): ?>
<a href="?page=<?= $currentPage - 1 ?>&category=<?= urlencode($currentCategory) ?>&status=<?= urlencode($currentStatus) ?>&search=<?= urlencode($currentSearch) ?>" class="btn btn--small">« Zurück</a>
<?php endif; ?>
<span>Seite <?= $currentPage ?> von <?= $totalPages ?></span>
<?php if ($currentPage < $totalPages): ?>
<a href="?page=<?= $currentPage + 1 ?>&category=<?= urlencode($currentCategory) ?>&status=<?= urlencode($currentStatus) ?>&search=<?= urlencode($currentSearch) ?>" class="btn btn--small">Weiter »</a>
<?php endif; ?>
</div>
<?php endif; ?>
<p class="links-bar">
<a href="/system-explorer">Zurück zum Explorer</a>
</p>
<?php $content = ob_get_clean(); ?>
<?php require VIEW_PATH . '/layout.php'; ?>