Backup #663
| ID | 663 |
| Dateipfad | /var/www/dev.campus.systemische-tools.de/src/View/content-pipeline/run-status.php |
| Version | 6 |
| Typ |
modified |
| Größe | 9.2 KB |
| Hash | ad12fdcbae7b4d6f4c5ba424a24865aa2d908518c48a1d3b792718bda5305668 |
| Datum | 2025-12-23 04:59:30 |
| Geändert von | claude-code-hook |
| Grund | Claude Code Pre-Hook Backup vor Edit-Operation |
| Datei existiert |
Ja
|
Dateiinhalt
<?php ob_start(); ?>
<h1>Pipeline Status</h1>
<p class="subtitle"><?= htmlspecialchars($pipeline['name']) ?> → Run #<?= $run['id'] ?></p>
<div class="status-page"
id="status-container"
data-poll-url="/content-pipeline/<?= $pipeline['id'] ?>/run/<?= $run['id'] ?>/poll">
<!-- Status Badge + Cancel -->
<div class="status-header">
<span class="badge badge--large" id="status-badge" data-status="<?= $run['status'] ?>">
<?= $run['status'] ?>
</span>
<form action="/content-pipeline/<?= $pipeline['id'] ?>/run/<?= $run['id'] ?>/cancel" method="POST" id="cancel-form" class="status-header__cancel">
<input type="hidden" name="_csrf_token" value="<?= htmlspecialchars($_SESSION['_csrf_token'] ?? '') ?>">
<button type="submit" class="btn btn--danger btn--small" id="cancel-btn" <?= $run['status'] !== 'running' ? 'disabled' : '' ?>>
Abbrechen
</button>
</form>
<span class="stall-warning" id="stall-warning" style="display: none;">
Keine Aktivitaet seit 60s
</span>
</div>
<!-- Status Info -->
<ul class="status-info">
<li><span class="status-info__label">Schritt:</span> <span class="status-info__value" id="current-step"><?= htmlspecialchars($run['current_step'] ?? 'Initialisierung') ?></span></li>
<li><span class="status-info__label">Dokument:</span> <span class="status-info__value" id="current-document"><?= htmlspecialchars($run['current_document'] ?? '-') ?></span></li>
<li><span class="status-info__label">Zeit:</span> <span class="status-info__value" id="elapsed-time">00:00</span></li>
<li><span class="status-info__label">ETA:</span> <span class="status-info__value" id="eta-time">-</span></li>
</ul>
<!-- Stats -->
<div class="stats-row">
<div class="stat-box">
<div class="stat-box__value" id="chunks-count">0</div>
<div class="stat-box__label">Chunks</div>
</div>
<div class="stat-box">
<div class="stat-box__value" id="embeddings-count">0</div>
<div class="stat-box__label">Embeddings</div>
</div>
<div class="stat-box stat-box--danger">
<div class="stat-box__value" id="failed-count">0</div>
<div class="stat-box__label">Fehler</div>
</div>
</div>
<!-- Live Log -->
<div class="log-section">
<h3>Live Log</h3>
<pre class="log-output" id="log-output"><?= htmlspecialchars($run['log_tail'] ?? 'Warte auf Ausgabe...') ?></pre>
</div>
<!-- Error Display -->
<div class="error-section" id="error-section" style="display: <?= $run['error_log'] ? 'block' : 'none' ?>;">
<h3>Fehler</h3>
<pre class="error-output" id="error-output"><?= htmlspecialchars($run['error_log'] ?? '') ?></pre>
</div>
</div>
<style>
.subtitle {
color: var(--text-muted, #666);
margin-top: -0.5rem;
margin-bottom: 1.5rem;
}
.status-page {
max-width: 800px;
}
.status-header {
display: flex;
align-items: center;
gap: 1rem;
margin-bottom: 1.5rem;
}
.badge--large {
font-size: 1rem;
padding: 0.5rem 1rem;
text-transform: uppercase;
}
.badge[data-status="running"] {
background: var(--info-color, #0066cc);
color: white;
animation: pulse 2s infinite;
}
.badge[data-status="completed"] {
background: var(--success-color, #28a745);
color: white;
}
.badge[data-status="failed"] {
background: var(--danger-color, #dc3545);
color: white;
}
.badge[data-status="cancelled"] {
background: var(--warning-color, #ffc107);
color: #333;
}
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.7; }
}
.stall-warning {
background: var(--warning-bg, #fff3cd);
color: var(--warning-color, #856404);
padding: 0.25rem 0.5rem;
border-radius: 4px;
font-size: 0.85rem;
animation: blink 1s infinite;
}
@keyframes blink {
0%, 100% { opacity: 1; }
50% { opacity: 0.5; }
}
.status-info {
list-style: none;
padding: 0;
margin: 0 0 1.5rem 0;
background: var(--card-bg, #fff);
border: 1px solid var(--border-color, #ddd);
border-radius: 8px;
padding: 1rem;
}
.status-info li {
display: flex;
padding: 0.5rem 0;
border-bottom: 1px solid var(--border-color, #eee);
}
.status-info li:last-child {
border-bottom: none;
}
.status-info__label {
font-weight: 500;
color: var(--text-muted, #666);
min-width: 100px;
}
.status-info__value {
flex: 1;
font-family: monospace;
}
.stats-row {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 1rem;
margin-bottom: 1.5rem;
}
.stat-box {
background: var(--bg-muted, #f5f5f5);
border-radius: 8px;
padding: 1rem;
text-align: center;
}
.stat-box--danger .stat-box__value {
color: var(--danger-color, #dc3545);
}
.stat-box__value {
font-size: 1.5rem;
font-weight: bold;
}
.stat-box__label {
font-size: 0.8rem;
color: var(--text-muted, #666);
}
.log-section, .error-section {
margin-bottom: 1.5rem;
}
.log-section h3, .error-section h3 {
margin-bottom: 0.5rem;
font-size: 1rem;
}
.log-output {
background: var(--bg-dark, #1e1e1e);
color: var(--text-light, #d4d4d4);
padding: 1rem;
border-radius: 6px;
font-family: monospace;
font-size: 0.8rem;
max-height: 300px;
overflow-y: auto;
white-space: pre-wrap;
word-break: break-word;
}
.error-output {
background: var(--danger-bg, #f8d7da);
color: var(--danger-color, #721c24);
padding: 1rem;
border-radius: 6px;
font-family: monospace;
font-size: 0.8rem;
max-height: 200px;
overflow-y: auto;
white-space: pre-wrap;
}
.status-header__cancel {
margin: 0;
}
@media (max-width: 600px) {
.status-cards, .stats-row {
grid-template-columns: 1fr;
}
}
</style>
<script>
(function() {
const container = document.getElementById('status-container');
const pollUrl = container.dataset.pollUrl;
let pollInterval = null;
let isTerminal = false;
function updateUI(data) {
// Status Badge
const badge = document.getElementById('status-badge');
badge.textContent = data.status;
badge.dataset.status = data.status;
// Stall Warning
document.getElementById('stall-warning').style.display = data.is_stalled ? 'inline' : 'none';
// Current Step & Document
document.getElementById('current-step').textContent = data.current_step || 'Warte...';
document.getElementById('current-document').textContent = data.current_document || '-';
// Time
document.getElementById('elapsed-time').textContent = data.elapsed_formatted || '00:00';
const estimatedEl = document.getElementById('estimated-time');
if (data.estimated_formatted) {
estimatedEl.textContent = '~' + data.estimated_formatted + ' verbleibend';
} else {
estimatedEl.textContent = '';
}
// Progress
document.getElementById('docs-processed').textContent = data.documents_processed;
document.getElementById('docs-total').textContent = data.documents_total;
document.getElementById('progress-percent').textContent = data.progress + '%';
document.getElementById('progress-fill').style.width = data.progress + '%';
// Stats
document.getElementById('chunks-count').textContent = data.chunks_created;
document.getElementById('embeddings-count').textContent = data.embeddings_created;
document.getElementById('failed-count').textContent = data.documents_failed;
// Log
if (data.log_tail) {
const logEl = document.getElementById('log-output');
logEl.textContent = data.log_tail;
logEl.scrollTop = logEl.scrollHeight;
}
// Error
if (data.error_log) {
document.getElementById('error-section').style.display = 'block';
document.getElementById('error-output').textContent = data.error_log;
}
// Cancel Button
document.getElementById('cancel-btn').disabled = data.is_terminal;
// Stop polling if terminal
if (data.is_terminal && !isTerminal) {
isTerminal = true;
stopPolling();
}
}
function poll() {
fetch(pollUrl)
.then(response => response.json())
.then(data => {
updateUI(data);
})
.catch(error => {
console.error('Polling error:', error);
});
}
function startPolling() {
poll(); // Initial poll
pollInterval = setInterval(poll, 2000); // Poll every 2s
}
function stopPolling() {
if (pollInterval) {
clearInterval(pollInterval);
pollInterval = null;
}
}
// Start polling on page load
startPolling();
// Stop polling when page is hidden
document.addEventListener('visibilitychange', function() {
if (document.hidden) {
stopPolling();
} else if (!isTerminal) {
startPolling();
}
});
})();
</script>
<?php $content = ob_get_clean(); ?>
<?php require VIEW_PATH . '/layout.php'; ?>
Vollständig herunterladen
Aktionen
Andere Versionen dieser Datei
| ID |
Version |
Typ |
Größe |
Datum |
| 1925 |
19 |
modified |
11.2 KB |
2025-12-28 01:20 |
| 1703 |
18 |
modified |
11.1 KB |
2025-12-27 12:21 |
| 1702 |
17 |
modified |
10.9 KB |
2025-12-27 12:21 |
| 884 |
16 |
modified |
10.9 KB |
2025-12-23 15:25 |
| 674 |
15 |
modified |
10.9 KB |
2025-12-23 05:13 |
| 671 |
14 |
modified |
10.5 KB |
2025-12-23 05:08 |
| 670 |
13 |
modified |
10.1 KB |
2025-12-23 05:08 |
| 669 |
12 |
modified |
9.5 KB |
2025-12-23 05:07 |
| 668 |
11 |
modified |
9.5 KB |
2025-12-23 05:07 |
| 667 |
10 |
modified |
10.2 KB |
2025-12-23 05:04 |
| 666 |
9 |
modified |
10.2 KB |
2025-12-23 05:04 |
| 665 |
8 |
modified |
10.3 KB |
2025-12-23 04:59 |
| 664 |
7 |
modified |
10.3 KB |
2025-12-23 04:59 |
| 663 |
6 |
modified |
9.2 KB |
2025-12-23 04:59 |
| 662 |
5 |
modified |
9.9 KB |
2025-12-23 04:59 |
| 661 |
4 |
modified |
10.6 KB |
2025-12-23 04:57 |
| 660 |
3 |
modified |
10.6 KB |
2025-12-23 04:52 |
| 659 |
2 |
modified |
11.2 KB |
2025-12-23 04:52 |
| 658 |
1 |
modified |
10.8 KB |
2025-12-23 04:52 |
← Zurück zur Übersicht