show.php
- Pfad:
src/View/semantic-explorer/dokumente/show.php
- Namespace: -
- Zeilen: 83 | Größe: 3,140 Bytes
- Geändert: 2025-12-20 14:47:44 | Gescannt: 2025-12-31 10:22:15
Code Hygiene Score: 99
- Dependencies: 100 (25%)
- LOC: 100 (20%)
- Methods: 100 (20%)
- Secrets: 100 (15%)
- Classes: 100 (10%)
- Magic Numbers: 90 (10%)
Issues 1
| Zeile |
Typ |
Beschreibung |
| 69 |
magic_number |
Magic Number gefunden: 100 |
Code
<?php ob_start(); ?>
<nav class="breadcrumb">
<a href="/">Home</a> »
<a href="/explorer">Explorer</a> »
<a href="/semantic-explorer">Semantic Explorer</a> »
<a href="/semantic-explorer/dokumente">Dokumente</a> »
<?= htmlspecialchars($document['filename']) ?>
</nav>
<h1><?= htmlspecialchars($document['filename']) ?></h1>
<p><code><?= htmlspecialchars($document['source_path']) ?></code></p>
<div class="stats-grid">
<div class="stat-card stat-card--info">
<span class="stat-card__value"><?= count($chunks) ?></span>
<span class="stat-card__label">Chunks</span>
</div>
<div class="stat-card">
<span class="stat-card__value"><?= number_format($document['file_size'] / 1024, 0) ?></span>
<span class="stat-card__label">KB</span>
</div>
<div class="stat-card stat-card--<?= $document['status'] === 'done' ? 'success' : ($document['status'] === 'error' ? 'warning' : 'info') ?>">
<span class="stat-card__value"><?= $document['status'] ?></span>
<span class="stat-card__label">Status</span>
</div>
</div>
<h2>Dokument-Info</h2>
<table>
<tr><th>Eigenschaft</th><th>Wert</th></tr>
<tr><td>Typ</td><td><code><?= htmlspecialchars($document['mime_type'] ?? '-') ?></code></td></tr>
<tr><td>Sprache</td><td><?= htmlspecialchars($document['language'] ?? '-') ?></td></tr>
<tr><td>Importiert</td><td><?= date('d.m.Y H:i:s', strtotime($document['imported_at'])) ?></td></tr>
<?php if ($document['processed_at']): ?>
<tr><td>Verarbeitet</td><td><?= date('d.m.Y H:i:s', strtotime($document['processed_at'])) ?></td></tr>
<?php endif; ?>
<?php if ($document['file_hash']): ?>
<tr><td>Hash</td><td><code><?= htmlspecialchars(substr($document['file_hash'], 0, 16)) ?>...</code></td></tr>
<?php endif; ?>
<?php if ($document['error_message']): ?>
<tr><td>Fehler</td><td class="text-danger"><?= htmlspecialchars($document['error_message']) ?></td></tr>
<?php endif; ?>
</table>
<?php if (!empty($chunks)): ?>
<h2>Chunks (<?= count($chunks) ?>)</h2>
<table>
<thead>
<tr>
<th>Index</th>
<th>Tokens</th>
<th>Status</th>
<th>Inhalt</th>
</tr>
</thead>
<tbody>
<?php foreach ($chunks as $c): ?>
<tr>
<td><a href="/semantic-explorer/chunks/<?= $c['id'] ?>">#<?= $c['chunk_index'] ?></a></td>
<td><?= $c['token_count'] ?></td>
<td>
<?php if ($c['qdrant_id']): ?>
<span class="badge badge--success">synced</span>
<?php else: ?>
<span class="badge">pending</span>
<?php endif; ?>
</td>
<td><?= htmlspecialchars(substr($c['content'], 0, 100)) ?>...</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
<p class="links-bar">
<a href="/semantic-explorer/dokumente">Alle Dokumente</a> |
<a href="/semantic-explorer">Zurueck zum Explorer</a>
</p>
<?php $content = ob_get_clean(); ?>
<?php require VIEW_PATH . '/layout.php'; ?>