mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-08-10 23:31:21 +02:00
chore: add explicit spacing to cleanup page article and h1
This commit is contained in:
@@ -10,94 +10,69 @@ require_once __DIR__ . '/../../../bootstrap.php';
|
||||
require_once __DIR__ . '/../../../src/AdminAuth.php';
|
||||
AdminAuth::requireLogin();
|
||||
|
||||
// Re-use the existing JSON endpoint internally
|
||||
ob_start();
|
||||
require __DIR__ . '/peertube-orphans.php';
|
||||
$json = ob_get_clean();
|
||||
$d = json_decode($json, true);
|
||||
require_once __DIR__ . '/_peertube-orphans-data.php';
|
||||
$d = getPeerTubeOrphansData();
|
||||
|
||||
if (!($d['configured'] ?? false)): ?>
|
||||
<fieldset>
|
||||
<legend>
|
||||
<?= icon('video') ?>
|
||||
Vidéos PeerTube orphelines
|
||||
</legend>
|
||||
<p style="margin:0;color:var(--color-warning)">⚠️ PeerTube non configuré.</p>
|
||||
</fieldset>
|
||||
<p style="margin:0;color:var(--color-warning)">⚠️ PeerTube non configuré.</p>
|
||||
<?php return; endif; ?>
|
||||
|
||||
<?php if (!empty($d['error'])): ?>
|
||||
<fieldset>
|
||||
<legend>
|
||||
<?= icon('video') ?>
|
||||
Vidéos PeerTube orphelines
|
||||
</legend>
|
||||
<p style="margin:0;color:var(--color-error)">✗ <?= htmlspecialchars($d['error']) ?></p>
|
||||
</fieldset>
|
||||
<p style="margin:0;color:var(--color-error)">✗ <?= htmlspecialchars($d['error']) ?></p>
|
||||
<?php return; endif; ?>
|
||||
|
||||
<fieldset>
|
||||
<legend>
|
||||
<?= icon('video') ?>
|
||||
Vidéos PeerTube orphelines <span class="n-meta"><?= (int)($d['orphan_count'] ?? 0) ?> vidéos orphelines</span>
|
||||
</legend>
|
||||
<?php if (($d['orphan_count'] ?? 0) > 0): ?>
|
||||
<table class="n-table">
|
||||
<thead><tr><th>Nom</th><th>Date</th><th width="1%"></th></tr></thead>
|
||||
<tbody>
|
||||
<?php foreach ($d['orphans'] as $v): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<strong><?= htmlspecialchars($v['name']) ?></strong>
|
||||
<span class="n-table__info" style="display:block"><?= htmlspecialchars($v['uuid']) ?></span>
|
||||
</td>
|
||||
<td style="white-space:nowrap"><?= htmlspecialchars(substr($v['createdAt'] ?? '', 0, 10)) ?></td>
|
||||
<td style="white-space:nowrap">
|
||||
<button type="button" class="btn btn--sm btn--danger" style="font-size:0.85em;padding:2px var(--space-xs)"
|
||||
hx-post="/admin/actions/peertube-delete.php"
|
||||
hx-confirm="Supprimer définitivement cette vidéo de PeerTube ?"
|
||||
hx-vals='{"csrf_token":"<?= htmlspecialchars($_SESSION['csrf_token']) ?>","uuid":"<?= htmlspecialchars($v['uuid']) ?>"}'
|
||||
hx-target="#peertube-orphans-fragment"
|
||||
hx-swap="innerHTML"
|
||||
hx-trigger="click"
|
||||
hx-indicator="#peertube-orphans-fragment">
|
||||
<?= icon('trash') ?>
|
||||
Supprimer
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3 id="peertube-orphans-heading">Vidéos orphelines <span class="n-meta"><?= (int)$d['orphan_count'] ?> vidéos orphelines</span></h3>
|
||||
<table class="n-table" aria-labelledby="peertube-orphans-heading">
|
||||
<thead><tr><th>Nom</th><th>Date</th><th width="1%"></th></tr></thead>
|
||||
<tbody>
|
||||
<?php foreach ($d['orphans'] as $v): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<strong><?= htmlspecialchars($v['name']) ?></strong>
|
||||
<span class="n-table__info" style="display:block"><?= htmlspecialchars($v['uuid']) ?></span>
|
||||
</td>
|
||||
<td style="white-space:nowrap"><?= htmlspecialchars(substr($v['createdAt'] ?? '', 0, 10)) ?></td>
|
||||
<td style="white-space:nowrap">
|
||||
<button type="button" class="btn btn--sm btn--danger" style="font-size:0.85em;padding:2px var(--space-xs)"
|
||||
hx-post="/admin/actions/peertube-delete.php"
|
||||
hx-confirm="Supprimer définitivement cette vidéo de PeerTube ?"
|
||||
hx-vals='{"csrf_token":"<?= htmlspecialchars($_SESSION['csrf_token']) ?>","uuid":"<?= htmlspecialchars($v['uuid']) ?>"}'
|
||||
hx-target="#peertube-orphans-fragment"
|
||||
hx-swap="innerHTML"
|
||||
hx-trigger="click"
|
||||
hx-indicator="#peertube-orphans-fragment">
|
||||
<?= icon('trash') ?>
|
||||
Supprimer
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php else: ?>
|
||||
<p style="margin:0;color:var(--accent-green)">✓ Aucune vidéo orpheline.</p>
|
||||
<p style="margin:0;color:var(--accent-green)">✓ Aucune vidéo orpheline.</p>
|
||||
<?php endif; ?>
|
||||
</fieldset>
|
||||
|
||||
<?php if (($d['stale_count'] ?? 0) > 0): ?>
|
||||
<fieldset>
|
||||
<legend>
|
||||
<?= icon('warning-diamond') ?>
|
||||
Références DB obsolètes <span class="n-meta"><?= $d['stale_count'] ?></span>
|
||||
</legend>
|
||||
<p style="margin:0 0 var(--space-sm) 0;font-size:0.85em;color:var(--text-secondary)">Ces UUID sont référencés en base de données mais n'existent plus sur la chaîne PeerTube. Les TFE liés affichent des liens morts.</p>
|
||||
<table class="n-table">
|
||||
<thead><tr><th>UUID</th><th>TFE(s)</th></tr></thead>
|
||||
<tbody>
|
||||
<?php foreach ($d['stale_entries'] as $s): ?>
|
||||
<tr>
|
||||
<td style="word-break:break-all;color:var(--text-secondary)"><?= htmlspecialchars($s['uuid']) ?></td>
|
||||
<td>
|
||||
<?php if (!empty($s['theses'])): ?>
|
||||
<?= implode(', ', array_map(function($t) {
|
||||
$label = $t['identifier'] ?: '#' . $t['thesis_id'];
|
||||
return '<a href="/admin/contenus-edit.php?id=' . (int)$t['thesis_id'] . '" target="_blank">' . htmlspecialchars($label) . '</a>';
|
||||
}, $s['theses'])) ?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
<h3 id="peertube-stale-heading" style="margin-top:var(--space-xl)">Références DB obsolètes <span class="n-meta"><?= $d['stale_count'] ?></span></h3>
|
||||
<p style="margin:0 0 var(--space-sm) 0;font-size:0.85em;color:var(--text-secondary)">Ces UUID sont référencés en base de données mais n'existent plus sur la chaîne PeerTube. Les TFE liés affichent des liens morts.</p>
|
||||
<table class="n-table" aria-labelledby="peertube-stale-heading">
|
||||
<thead><tr><th>UUID</th><th>TFE(s)</th></tr></thead>
|
||||
<tbody>
|
||||
<?php foreach ($d['stale_entries'] as $s): ?>
|
||||
<tr>
|
||||
<td style="word-break:break-all;color:var(--text-secondary)"><?= htmlspecialchars($s['uuid']) ?></td>
|
||||
<td>
|
||||
<?php if (!empty($s['theses'])): ?>
|
||||
<?= implode(', ', array_map(function($t) {
|
||||
$label = $t['identifier'] ?: '#' . $t['thesis_id'];
|
||||
return '<a href="/admin/contenus-edit.php?id=' . (int)$t['thesis_id'] . '" target="_blank">' . htmlspecialchars($label) . '</a>';
|
||||
}, $s['theses'])) ?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
|
||||
Reference in New Issue
Block a user