show.php
- Pfad:
src/View/tasks/show.php - Namespace: -
- Zeilen: 184 | Größe: 6,265 Bytes
- Geändert: 2025-12-27 12:23:59 | 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.
Versionen 6
-
v6
2025-12-27 12:23 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v5
2025-12-27 12:23 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v4
2025-12-27 12:23 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v3
2025-12-27 12:23 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v2
2025-12-20 19:18 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v1
2025-12-20 19:18 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation
Code
<?php
declare(strict_types=1);
// @responsibility: View für Task-Details mit HTMX-Aktionen
ob_start();
?>
<nav class="breadcrumb">
<a href="/tasks">Tasks</a> » Task #<?= $task['id'] ?>
</nav>
<h1><?= htmlspecialchars($task['title']) ?></h1>
<table>
<tr><th>ID</th><td><?= $task['id'] ?></td></tr>
<tr><th>Status</th><td><span class="badge badge--<?= $task['status'] ?>"><?= $task['status'] ?></span></td></tr>
<tr><th>Typ</th><td><?= $task['type'] ?></td></tr>
<tr><th>Erstellt von</th><td><?= htmlspecialchars($task['created_by']) ?> (<?= $task['created_by_type'] ?>)</td></tr>
<tr><th>Erstellt</th><td><?= $task['created_at'] ?></td></tr>
<?php if ($task['completed_at']): ?>
<tr><th>Abgeschlossen</th><td><?= $task['completed_at'] ?></td></tr>
<?php endif; ?>
</table>
<?php if ($task['description']): ?>
<h2>Beschreibung</h2>
<p><?= nl2br(htmlspecialchars($task['description'])) ?></p>
<?php endif; ?>
<h2>Aktionen</h2>
<div class="action-bar">
<a href="/tasks/<?= $task['id'] ?>/edit" class="btn">Bearbeiten</a>
<?php if ($task['status'] === 'pending'): ?>
<button type="button"
class="btn btn--light"
hx-put="/api/v1/tasks/<?= $task['id'] ?>/status"
hx-headers='{"X-CSRF-TOKEN": "<?= $csrfToken ?>"}'
hx-vals='{"status": "in_progress"}'
hx-swap="none"
hx-on::after-request="if(event.detail.successful) location.reload()"
hx-disabled-elt="this">
Starten
</button>
<?php endif; ?>
<?php if ($task['status'] === 'in_progress'): ?>
<button type="button"
class="btn btn--success"
hx-put="/api/v1/tasks/<?= $task['id'] ?>/status"
hx-headers='{"X-CSRF-TOKEN": "<?= $csrfToken ?>"}'
hx-vals='{"status": "completed"}'
hx-swap="none"
hx-on::after-request="if(event.detail.successful) location.reload()"
hx-disabled-elt="this">
Abschließen
</button>
<?php endif; ?>
<?php if ($task['type'] !== 'human_task' && in_array($task['status'], ['pending', 'in_progress'])): ?>
<button type="button"
class="btn btn--primary"
hx-post="/api/v1/tasks/<?= $task['id'] ?>/execute"
hx-headers='{"X-CSRF-TOKEN": "<?= $csrfToken ?>"}'
hx-disabled-elt="this">
Mit KI ausführen
</button>
<?php endif; ?>
</div>
<?php if (!empty($assignments)): ?>
<h2>Zuweisungen</h2>
<input type="search" id="assignments-search" class="search-input" placeholder="Zuweisungen durchsuchen...">
<table id="assignments-table" data-sortable>
<thead>
<tr>
<th data-sort="assignee">Bearbeiter</th>
<th data-sort="type">Typ</th>
<th data-sort="model">Model</th>
<th data-sort="status">Status</th>
<th data-sort="date">Zugewiesen</th>
</tr>
</thead>
<tbody>
<?php foreach ($assignments as $a): ?>
<tr>
<td><?= htmlspecialchars($a['assignee']) ?></td>
<td><?= $a['assignee_type'] ?></td>
<td><?= $a['model_name'] ?: '-' ?></td>
<td><?= $a['status'] ?></td>
<td><?= substr($a['assigned_at'], 0, 16) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
<?php if (!empty($results)): ?>
<h2>Ergebnisse</h2>
<?php foreach ($results as $r): ?>
<div class="result-box">
<div class="result-box__header">
<strong><?= htmlspecialchars($r['executor']) ?> (<?= $r['model_name'] ?: $r['executor_type'] ?>)</strong>
<span class="badge badge--<?= $r['status'] === 'success' ? 'completed' : 'failed' ?>"><?= $r['status'] ?></span>
</div>
<table>
<tr><th>Tokens</th><td><?= $r['tokens_total'] ?: '-' ?> (In: <?= $r['tokens_input'] ?: '-' ?>, Out: <?= $r['tokens_output'] ?: '-' ?>)</td></tr>
<tr><th>Dauer</th><td><?= $r['duration_ms'] ? $r['duration_ms'] . 'ms' : '-' ?></td></tr>
<tr><th>Zeit</th><td><?= substr($r['created_at'], 0, 19) ?></td></tr>
</table>
<?php if ($r['response']): ?>
<div class="result-box__content">
<strong>Antwort:</strong>
<pre><?= htmlspecialchars($r['response']) ?></pre>
</div>
<?php endif; ?>
</div>
<?php endforeach; ?>
<?php endif; ?>
<?php if (!empty($comments)): ?>
<h2>Kommentare</h2>
<input type="search" id="comments-search" class="search-input" placeholder="Kommentare durchsuchen...">
<table id="comments-table" data-sortable>
<thead>
<tr>
<th data-sort="author">Autor</th>
<th data-sort="type">Typ</th>
<th data-sort="content">Inhalt</th>
<th data-sort="time">Zeit</th>
</tr>
</thead>
<tbody>
<?php foreach ($comments as $c): ?>
<tr>
<td><?= htmlspecialchars($c['author']) ?></td>
<td><?= $c['comment_type'] ?></td>
<td><?= htmlspecialchars($c['content']) ?></td>
<td><?= substr($c['created_at'], 0, 16) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
<p style="margin-top: 2rem;"><a href="/tasks">← Zurück zur Task-Liste</a></p>
<script type="module">
import { init } from '/js/components/data-table.js';
import { domAdapter } from '/js/adapters/domAdapter.js';
const deps = {
clock: { now_epoch_ms_utc: () => Date.now() },
logger: console,
ui: {
showMessage: (msg) => { console.log(msg.type + ': ' + msg.text); },
disableFeature: (key) => { console.warn('Feature disabled: ' + key); },
offerRetry: () => Promise.resolve(false)
},
runId: crypto.randomUUID()
};
const dataTable = init(deps);
const assignmentsTable = domAdapter.getElementById('assignments-table');
if (assignmentsTable !== null) {
dataTable.create('assignments-table', {
searchInput: 'assignments-search',
pageSize: 10
});
}
const commentsTable = domAdapter.getElementById('comments-table');
if (commentsTable !== null) {
dataTable.create('comments-table', {
searchInput: 'comments-search',
pageSize: 10
});
}
</script>
<?php $content = ob_get_clean(); ?>
<?php require VIEW_PATH . '/layout.php'; ?>