{
"event": "PreToolUse",
"tool_name": "Edit",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/View\/content-pipeline\/run-status.php",
"old_string": " <!-- Actions -->\n <div class=\"action-bar\">\n <form action=\"\/content-pipeline\/<?= $pipeline['id'] ?>\/run\/<?= $run['id'] ?>\/cancel\" method=\"POST\" id=\"cancel-form\">\n <input type=\"hidden\" name=\"_csrf_token\" value=\"<?= htmlspecialchars($_SESSION['_csrf_token'] ?? '') ?>\">\n <button type=\"submit\" class=\"btn btn--danger\" id=\"cancel-btn\" <?= $run['status'] !== 'running' ? 'disabled' : '' ?>>\n Abbrechen\n <\/button>\n <\/form>\n <a href=\"\/content-pipeline\/<?= $pipeline['id'] ?>\" class=\"btn btn--secondary\">Zurueck zur Pipeline<\/a>\n <\/div>\n<\/div>",
"new_string": "<\/div>"
}
}
{
"tool_response": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/View\/content-pipeline\/run-status.php",
"oldString": " <!-- Actions -->\n <div class=\"action-bar\">\n <form action=\"\/content-pipeline\/<?= $pipeline['id'] ?>\/run\/<?= $run['id'] ?>\/cancel\" method=\"POST\" id=\"cancel-form\">\n <input type=\"hidden\" name=\"_csrf_token\" value=\"<?= htmlspecialchars($_SESSION['_csrf_token'] ?? '') ?>\">\n <button type=\"submit\" class=\"btn btn--danger\" id=\"cancel-btn\" <?= $run['status'] !== 'running' ? 'disabled' : '' ?>>\n Abbrechen\n <\/button>\n <\/form>\n <a href=\"\/content-pipeline\/<?= $pipeline['id'] ?>\" class=\"btn btn--secondary\">Zurueck zur Pipeline<\/a>\n <\/div>\n<\/div>",
"newString": "<\/div>",
"originalFile": "<?php ob_start(); ?>\n\n<h1>Pipeline Status<\/h1>\n<p class=\"subtitle\"><?= htmlspecialchars($pipeline['name']) ?> → Run #<?= $run['id'] ?><\/p>\n\n<div class=\"status-page\"\n id=\"status-container\"\n data-poll-url=\"\/content-pipeline\/<?= $pipeline['id'] ?>\/run\/<?= $run['id'] ?>\/poll\">\n\n <!-- Status Badge + Cancel -->\n <div class=\"status-header\">\n <span class=\"badge badge--large\" id=\"status-badge\" data-status=\"<?= $run['status'] ?>\">\n <?= $run['status'] ?>\n <\/span>\n <form action=\"\/content-pipeline\/<?= $pipeline['id'] ?>\/run\/<?= $run['id'] ?>\/cancel\" method=\"POST\" id=\"cancel-form\" class=\"status-header__cancel\">\n <input type=\"hidden\" name=\"_csrf_token\" value=\"<?= htmlspecialchars($_SESSION['_csrf_token'] ?? '') ?>\">\n <button type=\"submit\" class=\"btn btn--danger btn--small\" id=\"cancel-btn\" <?= $run['status'] !== 'running' ? 'disabled' : '' ?>>\n Abbrechen\n <\/button>\n <\/form>\n <span class=\"stall-warning\" id=\"stall-warning\" style=\"display: none;\">\n Keine Aktivitaet seit 60s\n <\/span>\n <\/div>\n\n <!-- Info Cards -->\n <div class=\"status-cards\">\n <div class=\"status-card\">\n <div class=\"status-card__icon\">📄<\/div>\n <div class=\"status-card__label\">Schritt<\/div>\n <div class=\"status-card__value\" id=\"current-step\"><?= htmlspecialchars($run['current_step'] ?? 'Initialisierung') ?><\/div>\n <\/div>\n <div class=\"status-card\">\n <div class=\"status-card__icon\">📁<\/div>\n <div class=\"status-card__label\">Aktuelles Dokument<\/div>\n <div class=\"status-card__value status-card__value--small\" id=\"current-document\"><?= htmlspecialchars($run['current_document'] ?? '-') ?><\/div>\n <\/div>\n <div class=\"status-card\">\n <div class=\"status-card__icon\">⏰<\/div>\n <div class=\"status-card__label\">Zeit<\/div>\n <div class=\"status-card__value\" id=\"elapsed-time\">00:00<\/div>\n <div class=\"status-card__sub\" id=\"estimated-time\"><\/div>\n <\/div>\n <\/div>\n\n <!-- Progress Bar -->\n <div class=\"progress-section\">\n <div class=\"progress-label\">\n <span>Dokumente: <span id=\"docs-processed\">0<\/span>\/<span id=\"docs-total\">0<\/span><\/span>\n <span id=\"progress-percent\">0%<\/span>\n <\/div>\n <div class=\"progress-bar\">\n <div class=\"progress-bar__fill\" id=\"progress-fill\" style=\"width: 0%\"><\/div>\n <\/div>\n <\/div>\n\n <!-- Stats -->\n <div class=\"stats-row\">\n <div class=\"stat-box\">\n <div class=\"stat-box__value\" id=\"chunks-count\">0<\/div>\n <div class=\"stat-box__label\">Chunks<\/div>\n <\/div>\n <div class=\"stat-box\">\n <div class=\"stat-box__value\" id=\"embeddings-count\">0<\/div>\n <div class=\"stat-box__label\">Embeddings<\/div>\n <\/div>\n <div class=\"stat-box stat-box--danger\">\n <div class=\"stat-box__value\" id=\"failed-count\">0<\/div>\n <div class=\"stat-box__label\">Fehler<\/div>\n <\/div>\n <\/div>\n\n <!-- Live Log -->\n <div class=\"log-section\">\n <h3>Live Log<\/h3>\n <pre class=\"log-output\" id=\"log-output\"><?= htmlspecialchars($run['log_tail'] ?? 'Warte auf Ausgabe...') ?><\/pre>\n <\/div>\n\n <!-- Error Display -->\n <div class=\"error-section\" id=\"error-section\" style=\"display: <?= $run['error_log'] ? 'block' : 'none' ?>;\">\n <h3>Fehler<\/h3>\n <pre class=\"error-output\" id=\"error-output\"><?= htmlspecialchars($run['error_log'] ?? '') ?><\/pre>\n <\/div>\n\n <!-- Actions -->\n <div class=\"action-bar\">\n <form action=\"\/content-pipeline\/<?= $pipeline['id'] ?>\/run\/<?= $run['id'] ?>\/cancel\" method=\"POST\" id=\"cancel-form\">\n <input type=\"hidden\" name=\"_csrf_token\" value=\"<?= htmlspecialchars($_SESSION['_csrf_token'] ?? '') ?>\">\n <button type=\"submit\" class=\"btn btn--danger\" id=\"cancel-btn\" <?= $run['status'] !== 'running' ? 'disabled' : '' ?>>\n Abbrechen\n <\/button>\n <\/form>\n <a href=\"\/content-pipeline\/<?= $pipeline['id'] ?>\" class=\"btn btn--secondary\">Zurueck zur Pipeline<\/a>\n <\/div>\n<\/div>\n\n<style>\n.subtitle {\n color: var(--text-muted, #666);\n margin-top: -0.5rem;\n margin-bottom: 1.5rem;\n}\n\n.status-page {\n max-width: 800px;\n}\n\n.status-header {\n display: flex;\n align-items: center;\n gap: 1rem;\n margin-bottom: 1.5rem;\n}\n\n.badge--large {\n font-size: 1rem;\n padding: 0.5rem 1rem;\n text-transform: uppercase;\n}\n\n.badge[data-status=\"running\"] {\n background: var(--info-color, #0066cc);\n color: white;\n animation: pulse 2s infinite;\n}\n\n.badge[data-status=\"completed\"] {\n background: var(--success-color, #28a745);\n color: white;\n}\n\n.badge[data-status=\"failed\"] {\n background: var(--danger-color, #dc3545);\n color: white;\n}\n\n.badge[data-status=\"cancelled\"] {\n background: var(--warning-color, #ffc107);\n color: #333;\n}\n\n@keyframes pulse {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.7; }\n}\n\n.stall-warning {\n background: var(--warning-bg, #fff3cd);\n color: var(--warning-color, #856404);\n padding: 0.25rem 0.5rem;\n border-radius: 4px;\n font-size: 0.85rem;\n animation: blink 1s infinite;\n}\n\n@keyframes blink {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.5; }\n}\n\n.status-cards {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n gap: 1rem;\n margin-bottom: 1.5rem;\n}\n\n.status-card {\n background: var(--card-bg, #fff);\n border: 1px solid var(--border-color, #ddd);\n border-radius: 8px;\n padding: 1rem;\n text-align: center;\n}\n\n.status-card__icon {\n font-size: 1.5rem;\n margin-bottom: 0.25rem;\n}\n\n.status-card__label {\n font-size: 0.75rem;\n color: var(--text-muted, #666);\n text-transform: uppercase;\n margin-bottom: 0.25rem;\n}\n\n.status-card__value {\n font-size: 1.25rem;\n font-weight: bold;\n word-break: break-word;\n}\n\n.status-card__value--small {\n font-size: 0.9rem;\n font-weight: normal;\n}\n\n.status-card__sub {\n font-size: 0.8rem;\n color: var(--text-muted, #666);\n}\n\n.progress-section {\n margin-bottom: 1.5rem;\n}\n\n.progress-label {\n display: flex;\n justify-content: space-between;\n margin-bottom: 0.5rem;\n font-size: 0.9rem;\n}\n\n.progress-bar {\n height: 24px;\n background: var(--bg-muted, #e9ecef);\n border-radius: 12px;\n overflow: hidden;\n}\n\n.progress-bar__fill {\n height: 100%;\n background: linear-gradient(90deg, var(--primary-color, #007bff), var(--success-color, #28a745));\n transition: width 0.5s ease;\n border-radius: 12px;\n}\n\n.stats-row {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n gap: 1rem;\n margin-bottom: 1.5rem;\n}\n\n.stat-box {\n background: var(--bg-muted, #f5f5f5);\n border-radius: 8px;\n padding: 1rem;\n text-align: center;\n}\n\n.stat-box--danger .stat-box__value {\n color: var(--danger-color, #dc3545);\n}\n\n.stat-box__value {\n font-size: 1.5rem;\n font-weight: bold;\n}\n\n.stat-box__label {\n font-size: 0.8rem;\n color: var(--text-muted, #666);\n}\n\n.log-section, .error-section {\n margin-bottom: 1.5rem;\n}\n\n.log-section h3, .error-section h3 {\n margin-bottom: 0.5rem;\n font-size: 1rem;\n}\n\n.log-output {\n background: var(--bg-dark, #1e1e1e);\n color: var(--text-light, #d4d4d4);\n padding: 1rem;\n border-radius: 6px;\n font-family: monospace;\n font-size: 0.8rem;\n max-height: 300px;\n overflow-y: auto;\n white-space: pre-wrap;\n word-break: break-word;\n}\n\n.error-output {\n background: var(--danger-bg, #f8d7da);\n color: var(--danger-color, #721c24);\n padding: 1rem;\n border-radius: 6px;\n font-family: monospace;\n font-size: 0.8rem;\n max-height: 200px;\n overflow-y: auto;\n white-space: pre-wrap;\n}\n\n.action-bar {\n display: flex;\n gap: 1rem;\n margin-top: 2rem;\n}\n\n.action-bar form {\n display: inline;\n}\n\n@media (max-width: 600px) {\n .status-cards, .stats-row {\n grid-template-columns: 1fr;\n }\n}\n<\/style>\n\n<script>\n(function() {\n const container = document.getElementById('status-container');\n const pollUrl = container.dataset.pollUrl;\n let pollInterval = null;\n let isTerminal = false;\n\n function updateUI(data) {\n \/\/ Status Badge\n const badge = document.getElementById('status-badge');\n badge.textContent = data.status;\n badge.dataset.status = data.status;\n\n \/\/ Stall Warning\n document.getElementById('stall-warning').style.display = data.is_stalled ? 'inline' : 'none';\n\n \/\/ Current Step & Document\n document.getElementById('current-step').textContent = data.current_step || 'Warte...';\n document.getElementById('current-document').textContent = data.current_document || '-';\n\n \/\/ Time\n document.getElementById('elapsed-time').textContent = data.elapsed_formatted || '00:00';\n const estimatedEl = document.getElementById('estimated-time');\n if (data.estimated_formatted) {\n estimatedEl.textContent = '~' + data.estimated_formatted + ' verbleibend';\n } else {\n estimatedEl.textContent = '';\n }\n\n \/\/ Progress\n document.getElementById('docs-processed').textContent = data.documents_processed;\n document.getElementById('docs-total').textContent = data.documents_total;\n document.getElementById('progress-percent').textContent = data.progress + '%';\n document.getElementById('progress-fill').style.width = data.progress + '%';\n\n \/\/ Stats\n document.getElementById('chunks-count').textContent = data.chunks_created;\n document.getElementById('embeddings-count').textContent = data.embeddings_created;\n document.getElementById('failed-count').textContent = data.documents_failed;\n\n \/\/ Log\n if (data.log_tail) {\n const logEl = document.getElementById('log-output');\n logEl.textContent... [TRUNCATED-8e05aa3706b1d18d]",
"structuredPatch": [
{
"oldStart": 82,
"oldLines": 16,
"newStart": 82,
"newLines": 6,
"lines": [
" <pre class=\"error-output\" id=\"error-output\"><?= htmlspecialchars($run['error_log'] ?? '') ?><\/pre>",
" <\/div>",
" ",
"- <!-- Actions -->",
"- <div class=\"action-bar\">",
"- <form action=\"\/content-pipeline\/<?= $pipeline['id'] ?>\/run\/<?= $run['id'] ?>\/cancel\" method=\"POST\" id=\"cancel-form\">",
"- <input type=\"hidden\" name=\"_csrf_token\" value=\"<?= htmlspecialchars($_SESSION['_csrf_token'] ?? '') ?>\">",
"- <button type=\"submit\" class=\"btn btn--danger\" id=\"cancel-btn\" <?= $run['status'] !== 'running' ? 'disabled' : '' ?>>",
"- Abbrechen",
"- <\/button>",
"- <\/form>",
"- <a href=\"\/content-pipeline\/<?= $pipeline['id'] ?>\" class=\"btn btn--secondary\">Zurueck zur Pipeline<\/a>",
"- <\/div>",
" <\/div>",
" ",
" <style>"
]
}
],
"userModified": false,
"replaceAll": false
}
}