From 786eef6df5bb66f2de35a89aabbe3f6af30422fc Mon Sep 17 00:00:00 2001 From: Pontoporeia Date: Fri, 3 Jul 2026 17:08:49 +0200 Subject: [PATCH] cleanup: remplacer
par
/ (comme contenus.php) --- TODO.md | 1 + .../admin/actions/cleanup-stats-fragment.php | 94 ++++++++-------- .../actions/peertube-orphans-fragment.php | 106 ++++++++---------- app/templates/admin/cleanup.php | 58 ++++++---- 4 files changed, 127 insertions(+), 132 deletions(-) diff --git a/TODO.md b/TODO.md index 34371d1..ac685f3 100644 --- a/TODO.md +++ b/TODO.md @@ -17,3 +17,4 @@ - [x] Remove orientation display from search result card meta - [x] Add bulk select/delete to tmp cleanup dialog (like admin/index.php pattern) - [x] Move cleanup UI from modal to dedicated page (like add.php/edit.php) +- [x] Replace
with
/ in cleanup fragments (like contenus.php) diff --git a/app/public/admin/actions/cleanup-stats-fragment.php b/app/public/admin/actions/cleanup-stats-fragment.php index eeedad7..461d49c 100644 --- a/app/public/admin/actions/cleanup-stats-fragment.php +++ b/app/public/admin/actions/cleanup-stats-fragment.php @@ -4,7 +4,7 @@ * * GET /admin/actions/cleanup-stats-fragment.php * - * Returns an HTML fragment ready for HTMX swap into #tmp-cleanup-stats-wrapper. + * Returns an HTML fragment ready for HTMX innerHTML swap into #tmp-cleanup-stats-wrapper. */ require_once __DIR__ . '/../../../bootstrap.php'; require_once __DIR__ . '/../../../src/AdminAuth.php'; @@ -24,13 +24,6 @@ $trActive = $d['trash_active_count'] ?? 0; $totalStale = $fpStale + $trStale; $totalFiles = $fpStale + $fpActive + $trStale + $trActive; -// Build summary meta: total stale count + total size -$staleParts = []; -if ($fpStale > 0) $staleParts[] = $fpStale . ' téléversement'; -if ($trStale > 0) $staleParts[] = $trStale . ' corbeille'; -$staleMeta = implode(' + ', $staleParts); - -// Approximate total stale size $staleSize = ($d['filepond_stale_size'] ?? 0) + ($d['trash_stale_size'] ?? 0); $staleHuman = ''; if ($staleSize >= 1073741824) { $staleHuman = number_format($staleSize / 1073741824, 1) . ' GB'; } @@ -38,50 +31,52 @@ elseif ($staleSize >= 1048576) { $staleHuman = number_format($staleSize / 104857 elseif ($staleSize >= 1024) { $staleHuman = number_format($staleSize / 1024, 0) . ' KB'; } elseif ($staleSize > 0) { $staleHuman = $staleSize . ' B'; } -$summaryMeta = $staleMeta; -if ($staleHuman) $summaryMeta .= ' · ' . $staleHuman; - +$fpMeta = $fpStale . ' dossier' . ($fpStale > 1 ? 's' : ''); +if ($fpStale > 0) { + $fpMeta .= ' · ' . ($d['filepond_stale_human'] ?? ''); +} +$trMeta = $trStale . ' fichier' . ($trStale > 1 ? 's' : ''); +if ($trStale > 0) { + $trMeta .= ' · ' . ($d['trash_stale_human'] ?? ''); +} +?> -
-
- +
+ Fichiers temporaires -
+

✓ Aucun fichier temporaire.

-
-
+
-
- - diff --git a/app/public/admin/actions/peertube-orphans-fragment.php b/app/public/admin/actions/peertube-orphans-fragment.php index 88c2870..29da083 100644 --- a/app/public/admin/actions/peertube-orphans-fragment.php +++ b/app/public/admin/actions/peertube-orphans-fragment.php @@ -4,7 +4,7 @@ * * GET /admin/actions/peertube-orphans-fragment.php * - * Returns an HTML fragment ready for HTMX swap into #peertube-orphans-fragment. + * Returns an HTML fragment ready for HTMX innerHTML swap into #peertube-orphans-fragment. */ require_once __DIR__ . '/../../../bootstrap.php'; require_once __DIR__ . '/../../../src/AdminAuth.php'; @@ -17,80 +17,69 @@ $json = ob_get_clean(); $d = json_decode($json, true); if (!($d['configured'] ?? false)): ?> -
-
- +
+ Vidéos PeerTube orphelines -
-
-

⚠️ PeerTube non configuré.

-
-
-
+ +

⚠️ PeerTube non configuré.

+
-
-
- +
+ Vidéos PeerTube orphelines -
-
-

-
-
-
+ +

+ -
-
- +
+ Vidéos PeerTube orphelines vidéos orphelines -
-
+ 0): ?> - - - - - - - - - - - -
NomDate
- - - - -
+ + + + + + + + + + + +
NomDate
+ + + + +
-

✓ Aucune vidéo orpheline.

+

✓ Aucune vidéo orpheline.

-
-
+ 0): ?> -
- +
+ Références DB obsolètes -
+

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.

@@ -110,6 +99,5 @@ if (!($d['configured'] ?? false)): ?>
UUIDTFE(s)
-
+ -
diff --git a/app/templates/admin/cleanup.php b/app/templates/admin/cleanup.php index 0fd8742..e1fdefe 100644 --- a/app/templates/admin/cleanup.php +++ b/app/templates/admin/cleanup.php @@ -10,29 +10,39 @@ -
- -
-
- - - Fichiers temporaires - -

Chargement…

-
-
+
+
+

Téléversements et corbeille

+
+
+ + + Fichiers temporaires + +

Chargement…

+
+
+
- -
-

Chargement…

-
-
+
+

Vidéos PeerTube

+
+
+ + + Vidéos PeerTube + +

Chargement…

+
+
+
+