From a556e1db3b1c34343bcc2f8c6c8d5ddda6e235fe Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Sun, 3 May 2026 01:13:21 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20=D9=85=D9=8F=D8=B5=D8=A7=D8=AF?= =?UTF-8?q?=D9=8E=D9=82:=20=D8=AA=D8=AD=D8=AF=D9=8A=D8=AB=20=D8=A8=D8=B1?= =?UTF-8?q?=D9=85=D8=AC=D9=8A=20=D8=AC=D8=AF=D9=8A=D8=AF=202026-05-03=2001?= =?UTF-8?q?:13?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/shell.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/public/shell.php b/public/shell.php index fd0aaee..f94b7f1 100644 --- a/public/shell.php +++ b/public/shell.php @@ -96,12 +96,18 @@ window.onpopstate = () => this.navigate(window.location.pathname); }, async navigate(path) { - if (path === '/login' || !this.isLoggedIn) { + // Handle subdirectories and index.php in the path + const isLogin = path.includes('/login'); + const isDashboard = path.includes('/dashboard') || path.endsWith('/') || path.endsWith('index.php'); + + if (isLogin || !this.isLoggedIn) { this.pageHtml = await this.loadPage('login'); - window.history.pushState({}, '', '/login'); - } else if (path === '/' || path === '/dashboard') { + if (!path.includes('/login')) window.history.pushState({}, '', 'login'); + } else if (isDashboard) { this.pageHtml = await this.loadPage('dashboard'); - window.history.pushState({}, '', '/dashboard'); + if (!path.includes('/dashboard')) window.history.pushState({}, '', 'dashboard'); + } else { + this.pageHtml = await this.loadPage('dashboard'); // Default } }, initCharts() {