Backup #91
| ID | 91 |
| Dateipfad | /var/www/dev.campus.systemische-tools.de/src/View/backup-restore/show.php |
| Version | 1 |
| Typ |
modified |
| Größe | 4.0 KB |
| Hash | 0d3e8ab3d622e4c5b2e1ddb8f2d38cde3f073857c15e011071df9724e313e836 |
| Datum | 2025-12-20 19:16:41 |
| Geändert von | claude-code-hook |
| Grund | Claude Code Pre-Hook Backup vor Edit-Operation |
| Datei existiert |
Ja
|
Dateiinhalt
<?php
ob_start();
// Helper function
$formatBytes = function (int $bytes): string {
if ($bytes >= 1048576) {
return number_format($bytes / 1048576, 1) . ' MB';
}
if ($bytes >= 1024) {
return number_format($bytes / 1024, 1) . ' KB';
}
return $bytes . ' B';
};
// Check for messages
$restored = isset($_GET['restored']);
$error = $_GET['error'] ?? null;
?>
<nav class="breadcrumb">
<a href="/backup-restore">File Backup</a> » Backup #<?= $backup['id'] ?>
</nav>
<h1>Backup #<?= $backup['id'] ?></h1>
<?php if ($restored): ?>
<div class="alert alert--success">
Datei wurde erfolgreich wiederhergestellt.
</div>
<?php endif; ?>
<?php if ($error): ?>
<div class="alert alert--error">
Fehler: <?= htmlspecialchars($error) ?>
</div>
<?php endif; ?>
<table>
<tr><th>ID</th><td><?= $backup['id'] ?></td></tr>
<tr><th>Dateipfad</th><td><code><?= htmlspecialchars($backup['file_path']) ?></code></td></tr>
<tr><th>Version</th><td><?= $backup['version'] ?></td></tr>
<tr>
<th>Typ</th>
<td><span class="badge badge--<?= $backup['change_type'] ?>"><?= $backup['change_type'] ?></span></td>
</tr>
<tr><th>Größe</th><td><?= $formatBytes($backup['file_size']) ?></td></tr>
<tr><th>Hash</th><td><code><?= htmlspecialchars($backup['content_hash']) ?></code></td></tr>
<tr><th>Datum</th><td><?= $backup['changed_at'] ?></td></tr>
<tr><th>Geändert von</th><td><?= htmlspecialchars($backup['changed_by']) ?></td></tr>
<tr><th>Grund</th><td><?= htmlspecialchars($backup['reason']) ?></td></tr>
<tr>
<th>Datei existiert</th>
<td>
<?php if ($fileExists): ?>
<span class="badge badge--completed">Ja</span>
<?php else: ?>
<span class="badge badge--failed">Nein</span>
<?php endif; ?>
</td>
</tr>
</table>
<?php if (!empty($backup['diff_summary'])): ?>
<h2>Diff-Zusammenfassung</h2>
<pre><code><?= htmlspecialchars($backup['diff_summary']) ?></code></pre>
<?php endif; ?>
<h2>Dateiinhalt</h2>
<?php if ($contentPreview): ?>
<pre><code><?= htmlspecialchars($contentPreview) ?></code></pre>
<p>
<a href="/backup-restore/<?= $backup['id'] ?>/download" class="btn btn--light">Vollständig herunterladen</a>
</p>
<?php else: ?>
<p class="empty-state empty-state--small">Kein Inhalt vorhanden.</p>
<?php endif; ?>
<h2>Aktionen</h2>
<div class="action-bar">
<form method="post" action="/backup-restore/<?= $backup['id'] ?>/restore" style="display: inline;"
onsubmit="return confirm('Datei wirklich wiederherstellen?\n\nDies überschreibt den aktuellen Inhalt von:\n<?= htmlspecialchars($backup['file_path']) ?>');">
<button type="submit" class="btn btn--primary">Wiederherstellen</button>
</form>
<a href="/backup-restore/<?= $backup['id'] ?>/download" class="btn">Herunterladen</a>
</div>
<?php if (count($versions) > 1): ?>
<h2>Andere Versionen dieser Datei</h2>
<table data-sortable>
<thead>
<tr>
<th data-sort="id">ID</th>
<th data-sort="version">Version</th>
<th data-sort="change_type">Typ</th>
<th data-sort="file_size">Größe</th>
<th data-sort="changed_at">Datum</th>
</tr>
</thead>
<tbody>
<?php foreach ($versions as $version): ?>
<tr<?= $version['id'] == $backup['id'] ? ' class="highlight"' : '' ?>>
<td><a href="/backup-restore/<?= $version['id'] ?>"><?= $version['id'] ?></a></td>
<td><?= $version['version'] ?></td>
<td><span class="badge badge--<?= $version['change_type'] ?>"><?= $version['change_type'] ?></span></td>
<td><?= $formatBytes($version['file_size']) ?></td>
<td><?= substr($version['changed_at'], 0, 16) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
<p style="margin-top: 2rem;"><a href="/backup-restore">← Zurück zur Übersicht</a></p>
<?php $content = ob_get_clean(); ?>
<?php require VIEW_PATH . '/layout.php'; ?>
Vollständig herunterladen
Aktionen
← Zurück zur Übersicht