From 96d8e08dbd5fd76137384740fa674dc7d0d74cfc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 2 Jul 2026 15:08:59 +0000 Subject: [PATCH] Move static pages into subfolders using index.html --- public/{dashboard.html => dashboard/index.html} | 0 public/index.html | 4 ++-- public/js/dashboard.js | 6 +++--- public/js/login.js | 2 +- public/js/register.js | 2 +- public/{login.html => login/index.html} | 2 +- public/{preview.html => preview/index.html} | 0 public/{register.html => register/index.html} | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) rename public/{dashboard.html => dashboard/index.html} (100%) rename public/{login.html => login/index.html} (97%) rename public/{preview.html => preview/index.html} (100%) rename public/{register.html => register/index.html} (97%) diff --git a/public/dashboard.html b/public/dashboard/index.html similarity index 100% rename from public/dashboard.html rename to public/dashboard/index.html diff --git a/public/index.html b/public/index.html index 1738f41..e30a8b6 100644 --- a/public/index.html +++ b/public/index.html @@ -5,8 +5,8 @@ NOTXCS diff --git a/public/js/dashboard.js b/public/js/dashboard.js index 93fa45d..6b2161b 100644 --- a/public/js/dashboard.js +++ b/public/js/dashboard.js @@ -9,7 +9,7 @@ async function api(path, options = {}) { }); const data = await res.json().catch(() => ({ success: false, message: 'Invalid response from server' })); if (res.status === 401) { - window.location.href = '/login.html'; + window.location.href = '/login'; throw new Error('Not authenticated'); } return data; @@ -18,7 +18,7 @@ async function api(path, options = {}) { async function init() { const me = await api('/auth/me'); if (!me.success) { - window.location.href = '/login.html'; + window.location.href = '/login'; return; } document.getElementById('username-display').textContent = me.user.username; @@ -188,7 +188,7 @@ document.getElementById('delete-place-btn').addEventListener('click', async () = document.getElementById('logout-btn').addEventListener('click', async () => { await api('/auth/logout', { method: 'POST' }); - window.location.href = '/login.html'; + window.location.href = '/login'; }); // --- ACL (allowed persons / credentials) management --- diff --git a/public/js/login.js b/public/js/login.js index 00dd1d0..7e360c3 100644 --- a/public/js/login.js +++ b/public/js/login.js @@ -20,7 +20,7 @@ document.getElementById('login-form').addEventListener('submit', async (e) => { return; } - window.location.href = '/dashboard.html'; + window.location.href = '/dashboard'; } catch (err) { errorEl.textContent = 'Unable to reach the server. Please try again.'; errorEl.classList.add('visible'); diff --git a/public/js/register.js b/public/js/register.js index 370c434..ab44909 100644 --- a/public/js/register.js +++ b/public/js/register.js @@ -20,7 +20,7 @@ document.getElementById('register-form').addEventListener('submit', async (e) => return; } - window.location.href = '/dashboard.html'; + window.location.href = '/dashboard'; } catch (err) { errorEl.textContent = 'Unable to reach the server. Please try again.'; errorEl.classList.add('visible'); diff --git a/public/login.html b/public/login/index.html similarity index 97% rename from public/login.html rename to public/login/index.html index d9c7eb2..6995329 100644 --- a/public/login.html +++ b/public/login/index.html @@ -21,7 +21,7 @@ - + diff --git a/public/preview.html b/public/preview/index.html similarity index 100% rename from public/preview.html rename to public/preview/index.html diff --git a/public/register.html b/public/register/index.html similarity index 97% rename from public/register.html rename to public/register/index.html index 0de45cb..41792bd 100644 --- a/public/register.html +++ b/public/register/index.html @@ -21,7 +21,7 @@ - +