Clean up cleanup dialog

- Remove duplicate 'Téléversements abandonnés' heading already communicated by the summary
- Replace #peertube-orphans-wrapper with display:contents wrapper so PeerTube details sit as direct grid siblings
- Add hx-confirm to all delete buttons (filepond, trash, PeerTube orphans)
This commit is contained in:
Pontoporeia
2026-06-21 17:52:30 +02:00
parent dfde88eaa5
commit 6aee5ec131
4 changed files with 12 additions and 13 deletions

View File

@@ -61,10 +61,6 @@ if ($totalStale === 0 && $totalFiles === 0): ?>
</summary>
<?php if ($fpStale > 0): ?>
<p class="n-heading">
<?= icon('paint-brush-household') ?>
Téléversements abandonnés
</p>
<table class="n-table">
<thead><tr><th>Nom</th><th>Taille</th><th>Âge</th><th width="1%"></th></tr></thead>
<tbody>
@@ -76,6 +72,7 @@ if ($totalStale === 0 && $totalFiles === 0): ?>
<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/cleanup-tmp.php"
hx-confirm="Supprimer définitivement ce téléversement abandonné ?"
hx-vals='{"csrf_token":"<?= htmlspecialchars($_SESSION['csrf_token']) ?>","filepond_dir":"<?= htmlspecialchars($f['name']) ?>"}'
hx-target="#tmp-cleanup-stats-wrapper"
hx-swap="outerHTML"
@@ -106,6 +103,7 @@ if ($totalStale === 0 && $totalFiles === 0): ?>
<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/cleanup-tmp.php"
hx-confirm="Supprimer définitivement ce fichier de la corbeille ?"
hx-vals='{"csrf_token":"<?= htmlspecialchars($_SESSION['csrf_token']) ?>","trash_file":"<?= htmlspecialchars($f['name']) ?>"}'
hx-target="#tmp-cleanup-stats-wrapper"
hx-swap="outerHTML"

View File

@@ -4,7 +4,7 @@
*
* GET /admin/actions/peertube-orphans-fragment.php
*
* Returns an HTML fragment ready for HTMX swap into #peertube-orphans-wrapper.
* Returns an HTML fragment ready for HTMX swap into #peertube-orphans-fragment.
*/
require_once __DIR__ . '/../../../bootstrap.php';
require_once __DIR__ . '/../../../src/AdminAuth.php';
@@ -17,7 +17,7 @@ $json = ob_get_clean();
$d = json_decode($json, true);
if (!($d['configured'] ?? false)): ?>
<div id="peertube-orphans-wrapper">
<div id="peertube-orphans-fragment" style="display:contents">
<details id="peertube-orphans-col" class="n-section" open>
<summary>
<?= icon('video') ?>
@@ -31,7 +31,7 @@ if (!($d['configured'] ?? false)): ?>
<?php return; endif; ?>
<?php if (!empty($d['error'])): ?>
<div id="peertube-orphans-wrapper">
<div id="peertube-orphans-fragment" style="display:contents">
<details id="peertube-orphans-col" class="n-section" open>
<summary>
<?= icon('video') ?>
@@ -44,7 +44,7 @@ if (!($d['configured'] ?? false)): ?>
</div>
<?php return; endif; ?>
<div id="peertube-orphans-wrapper">
<div id="peertube-orphans-fragment" style="display:contents">
<details id="peertube-orphans-col" class="n-section" open>
<summary>
<?= icon('video') ?>
@@ -65,11 +65,12 @@ if (!($d['configured'] ?? false)): ?>
<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-wrapper"
hx-target="#peertube-orphans-fragment"
hx-swap="outerHTML"
hx-trigger="click"
hx-indicator="#peertube-orphans-wrapper">
hx-indicator="#peertube-orphans-fragment">
<?= icon('trash') ?>
Supprimer
</button>