mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-26 00:29:18 +02:00
cleanup modal: list stale files to remove; storage restructure: documents/ → {objet}/
This commit is contained in:
@@ -34,6 +34,7 @@ $now = time();
|
||||
// ── FilePond stats ───────────────────────────────────────────────────────
|
||||
$fpStaleCount = 0;
|
||||
$fpStaleSize = 0;
|
||||
$fpStaleFiles = [];
|
||||
$fpActiveCount = 0;
|
||||
$fpActiveSize = 0;
|
||||
|
||||
@@ -75,6 +76,12 @@ if (is_dir($filepondDir)) {
|
||||
if ($stale) {
|
||||
$fpStaleCount++;
|
||||
$fpStaleSize += $size;
|
||||
$fpStaleFiles[] = [
|
||||
'name' => $item,
|
||||
'size' => $size,
|
||||
'human' => humanBytes($size),
|
||||
'age_minutes' => $ageMinutes,
|
||||
];
|
||||
} else {
|
||||
$fpActiveCount++;
|
||||
$fpActiveSize += $size;
|
||||
@@ -96,6 +103,7 @@ while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
|
||||
|
||||
$trStaleCount = 0;
|
||||
$trStaleSize = 0;
|
||||
$trStaleFiles = [];
|
||||
$trActiveCount = 0;
|
||||
$trActiveSize = 0;
|
||||
|
||||
@@ -131,6 +139,12 @@ if (is_dir($trashDir)) {
|
||||
if ($stale) {
|
||||
$trStaleCount++;
|
||||
$trStaleSize += $size;
|
||||
$trStaleFiles[] = [
|
||||
'name' => $item,
|
||||
'size' => $size,
|
||||
'human' => humanBytes($size),
|
||||
'age_days' => $ageDays,
|
||||
];
|
||||
} else {
|
||||
$trActiveCount++;
|
||||
$trActiveSize += $size;
|
||||
@@ -144,12 +158,14 @@ echo json_encode([
|
||||
'filepond_stale_count' => $fpStaleCount,
|
||||
'filepond_stale_size' => $fpStaleSize,
|
||||
'filepond_stale_human' => humanBytes($fpStaleSize),
|
||||
'filepond_stale_files' => $fpStaleFiles,
|
||||
'filepond_active_count' => $fpActiveCount,
|
||||
'filepond_active_size' => $fpActiveSize,
|
||||
'filepond_active_human' => humanBytes($fpActiveSize),
|
||||
'trash_stale_count' => $trStaleCount,
|
||||
'trash_stale_size' => $trStaleSize,
|
||||
'trash_stale_human' => humanBytes($trStaleSize),
|
||||
'trash_stale_files' => $trStaleFiles,
|
||||
'trash_active_count' => $trActiveCount,
|
||||
'trash_active_size' => $trActiveSize,
|
||||
'trash_active_human' => humanBytes($trActiveSize),
|
||||
|
||||
Reference in New Issue
Block a user