mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 08:09:18 +02:00
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:
@@ -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"
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -41,7 +41,7 @@ document.addEventListener('htmx:afterSwap',()=>{document.querySelectorAll('input
|
||||
<?php endif; ?>
|
||||
<?php if ($tmpTotalCount > 0): ?>
|
||||
<button type="button" class="btn btn--sm btn--secondary" id="tmp-cleanup-btn"
|
||||
onclick="document.getElementById('tmp-cleanup-dialog').showModal(); htmx.trigger('#tmp-cleanup-stats-wrapper','loadStats'); htmx.trigger('#peertube-orphans-wrapper','loadPeertube')">
|
||||
onclick="document.getElementById('tmp-cleanup-dialog').showModal(); htmx.trigger('#tmp-cleanup-stats-wrapper','loadStats'); htmx.trigger('#peertube-orphans-fragment','loadPeertube')">
|
||||
<?= icon('trash') ?> Nettoyer (<?= $tmpTotalCount ?>)
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
</details>
|
||||
</div>
|
||||
<!-- ═══════ PeerTube ═══════ -->
|
||||
<div id="peertube-orphans-wrapper"
|
||||
<div id="peertube-orphans-fragment" style="display:contents"
|
||||
hx-get="/admin/actions/peertube-orphans-fragment.php"
|
||||
hx-trigger="loadPeertube"
|
||||
hx-swap="outerHTML"
|
||||
hx-indicator="#peertube-orphans-wrapper">
|
||||
hx-indicator="#peertube-orphans-fragment">
|
||||
<p style="margin:0;color:var(--text-secondary)">Chargement…</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user