From a57ff6ac77f39cf9206e260772e2e88435d115f7 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Fri, 18 Jul 2025 23:01:01 -0400 Subject: [PATCH] added ability to know something's actually happening on the upload server page. --- .../.local/upload_server/templates/index.html | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/home/stormux/.local/upload_server/templates/index.html b/home/stormux/.local/upload_server/templates/index.html index 64e0059..0f7170d 100644 --- a/home/stormux/.local/upload_server/templates/index.html +++ b/home/stormux/.local/upload_server/templates/index.html @@ -182,6 +182,18 @@ .upload-section:last-child { border-bottom: none; } + + /* Upload feedback styles */ + .btn:disabled { + background-color: #95a5a6; + cursor: not-allowed; + } + + .upload-status { + margin-top: 10px; + font-weight: bold; + color: var(--primary-color); + } @@ -222,6 +234,7 @@
+
@@ -245,6 +258,7 @@
+
@@ -356,6 +370,34 @@ }, false); } + // Upload progress handling + function setupUploadProgress(formSelector, buttonId, statusId) { + const form = document.querySelector(formSelector); + const button = document.getElementById(buttonId); + const status = document.getElementById(statusId); + const announcer = document.getElementById('status-announcer'); + + form.addEventListener('submit', function(e) { + // Disable button and show status + button.disabled = true; + button.textContent = 'Uploading...'; + status.style.display = 'block'; + status.textContent = 'Upload in progress, please wait...'; + + // Announce to screen readers + announcer.textContent = 'Upload started, please wait while files are being processed'; + + // Add a small delay to ensure the status is visible before form submits + setTimeout(() => { + // Form will submit naturally + }, 100); + }); + } + + // Set up progress handling for both forms + setupUploadProgress('form[action="/upload"]', 'upload-button', 'upload-status'); + setupUploadProgress('form[action="/upload_music"]', 'upload-folder-button', 'upload-folder-status'); + // Check if the client is on local network fetch('/check_local') .then(response => {