From 77c1c3114f4788f244e144671507e78dfa2f4af3 Mon Sep 17 00:00:00 2001 From: cosmo Date: Sat, 18 Apr 2026 17:10:26 +0200 Subject: [PATCH] move instance management and firewall help into modal windows --- static/app.js | 21 +++++++ static/index.html | 155 +++++++++++++++++++++++++++------------------- static/style.css | 73 ++++++++++++++++++++++ 3 files changed, 185 insertions(+), 64 deletions(-) diff --git a/static/app.js b/static/app.js index 2b37740..22792a9 100644 --- a/static/app.js +++ b/static/app.js @@ -15,10 +15,30 @@ document.addEventListener('DOMContentLoaded', () => { const createUserForm = document.getElementById('create-user-form'); const changePasswordForm = document.getElementById('change-password-form'); const profileSuccess = document.getElementById('profile-success'); + const helpBtn = document.getElementById('help-btn'); + const helpModal = document.getElementById('help-modal'); + const addInstanceModal = document.getElementById('add-instance-modal'); + const showAddBtn = document.getElementById('show-add-btn'); let config = { firewall_host_ip: null }; let currentUser = null; + const openModal = (modal) => modal.classList.add('active'); + const closeModal = (modal) => modal.classList.remove('active'); + + document.querySelectorAll('.btn-close').forEach(btn => { + btn.addEventListener('click', () => { + closeModal(btn.closest('.modal')); + }); + }); + + window.addEventListener('click', (e) => { + if (e.target.classList.contains('modal')) closeModal(e.target); + }); + + helpBtn.addEventListener('click', () => openModal(helpModal)); + showAddBtn.addEventListener('click', () => openModal(addInstanceModal)); + const showLogin = () => { loginOverlay.style.display = 'flex'; logoutBtn.style.display = 'none'; @@ -158,6 +178,7 @@ document.addEventListener('DOMContentLoaded', () => { if (res.ok) { addForm.reset(); document.getElementById('port').value = "4646"; + closeModal(addInstanceModal); fetchInstances(); } else if (res.status === 401) { showLogin(); diff --git a/static/index.html b/static/index.html index 1c79eb2..7663ac1 100644 --- a/static/index.html +++ b/static/index.html @@ -18,13 +18,22 @@

XIVLauncher Remote OTP

- +
+ + +