From 531d2a6e26b726c91fd7729777c4fa4328be2f20 Mon Sep 17 00:00:00 2001 From: canglan Date: Sun, 12 Jul 2026 21:16:05 +0800 Subject: [PATCH] fix: expose all page objects to window for inline onclick handlers --- public/js/app.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/public/js/app.js b/public/js/app.js index 299bbe0..e39c720 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -82,10 +82,11 @@ const App = { showPublic(page, param) { document.getElementById('top-bar').classList.remove('hidden'); - document.getElementById('top-auth').classList.remove('hidden'); document.getElementById('main-layout').classList.add('hidden'); const pub = document.getElementById('public-page'); pub.classList.remove('hidden'); + const topAuth = document.getElementById('top-auth'); + if (Auth.logged()) { topAuth.classList.add('hidden'); } else { topAuth.classList.remove('hidden'); } const comp = page === 'login' ? LoginPage : page === 'register' ? RegisterPage : page === 'install' ? InstallPage : HomePage; comp.render(param).then(html => { pub.innerHTML = html; if (comp.mount) comp.mount(param); }).catch(() => { pub.innerHTML = '
'; @@ -118,3 +119,22 @@ const App = { }; document.addEventListener('DOMContentLoaded', () => App.init()); +window.App = App; +window.Dashboard = Dashboard; +window.TicketsPage = TicketsPage; +window.TicketDetail = TicketDetail; +window.TicketCreate = TicketCreate; +window.TrackingPage = TrackingPage; +window.UnclaimedPage = UnclaimedPage; +window.UsersPage = UsersPage; +window.TemplatesPage = TemplatesPage; +window.NotificationsPage = NotificationsPage; +window.SettingsPage = SettingsPage; +window.ExportPage = ExportPage; +window.LoginPage = LoginPage; +window.RegisterPage = RegisterPage; +window.HomePage = HomePage; +window.InstallPage = InstallPage; +window.U = U; +window.Auth = Auth; +window.API = API;