diff --git a/src/inc/routes/admin.mjs b/src/inc/routes/admin.mjs index 5b1284c..6ab406c 100644 --- a/src/inc/routes/admin.mjs +++ b/src/inc/routes/admin.mjs @@ -615,12 +615,10 @@ export default (router, tpl) => { router.post(/^\/admin\/settings\/?$/, lib.auth, async (req, res) => { const manual_approval = req.post.manual_approval === 'on' ? 'true' : 'false'; const registration_open = req.post.registration_open === 'on' ? 'true' : 'false'; - const enable_cleanup = req.post.enable_cleanup === 'on' ? 'true' : 'false'; const min_tags = isNaN(parseInt(req.post.min_tags)) ? 3 : Math.max(0, parseInt(req.post.min_tags)); const trusted_uploads = Math.max(0, parseInt(req.post.trusted_uploads) ?? 3); await db`INSERT INTO site_settings (key, value) VALUES ('manual_approval', ${manual_approval}) ON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value`; - await db`INSERT INTO site_settings (key, value) VALUES ('enable_cleanup', ${enable_cleanup}) ON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value`; if (cfg.websrv.open_registration_web_toggle !== false) { await db`INSERT INTO site_settings (key, value) VALUES ('registration_open', ${registration_open}) ON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value`; @@ -631,7 +629,6 @@ export default (router, tpl) => { await db`INSERT INTO site_settings (key, value) VALUES ('trusted_uploads', ${trusted_uploads.toString()}) ON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value`; setManualApproval(manual_approval === 'true'); - setEnableCleanup(enable_cleanup === 'true'); setMinTags(min_tags); setTrustedUploads(trusted_uploads); @@ -672,15 +669,12 @@ export default (router, tpl) => { router.post(/^\/admin\/cleanup\/?$/, lib.auth, async (req, res) => { try { - const enable_cleanup = req.post.enable_cleanup === 'on' ? 'true' : 'false'; const cleanup_start_date = req.post.cleanup_start_date || ''; const cleanup_end_date = req.post.cleanup_end_date || ''; - await db`INSERT INTO site_settings (key, value) VALUES ('enable_cleanup', ${enable_cleanup}) ON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value`; await db`INSERT INTO site_settings (key, value) VALUES ('cleanup_start_date', ${cleanup_start_date}) ON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value`; await db`INSERT INTO site_settings (key, value) VALUES ('cleanup_end_date', ${cleanup_end_date}) ON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value`; - setEnableCleanup(enable_cleanup === 'true'); setCleanupStartDate(cleanup_start_date); setCleanupEndDate(cleanup_end_date); diff --git a/views/admin.html b/views/admin.html index 174eb6f..e0e4dc1 100644 --- a/views/admin.html +++ b/views/admin.html @@ -44,18 +44,7 @@ - @if(typeof enable_cleanup_config === "undefined" || enable_cleanup_config !== false) -
-
- -

Enable the automated cleanup system and manager.

-
- -
- @endif + @if(registration_web_toggle_enabled)
@@ -115,7 +104,6 @@ const status = document.getElementById('settings-status'); const approvalToggle = document.getElementById('manual_approval_toggle'); const registrationToggle = document.getElementById('registration_open_toggle'); - const cleanupToggle = document.getElementById('enable_cleanup_toggle'); const minTagsInput = document.getElementById('min_tags_input'); const trustedUploadsInput = document.getElementById('trusted_uploads_input'); @@ -131,7 +119,6 @@ }, body: new URLSearchParams({ manual_approval: approvalToggle.checked ? 'on' : 'off', - enable_cleanup: cleanupToggle.checked ? 'on' : 'off', ...(registrationToggle ? { registration_open: registrationToggle.checked ? 'on' : 'off' } : {}), min_tags: minTagsInput.value, trusted_uploads: trustedUploadsInput.value, diff --git a/views/admin/cleanup.html b/views/admin/cleanup.html index 1fd5e62..a91005b 100644 --- a/views/admin/cleanup.html +++ b/views/admin/cleanup.html @@ -9,16 +9,7 @@
-
-
- -

This must be enabled to allow running the manual cleanup process.

-
- -
+
@@ -79,12 +70,6 @@ try { const formData = new FormData(form); - if (!document.getElementById('enable_cleanup_toggle').checked) { - formData.delete('enable_cleanup'); - formData.append('enable_cleanup', 'off'); - } else { - formData.set('enable_cleanup', 'on'); - } const res = await fetch(form.action, { method: 'POST',