From ce9fe8593440f477f9ac48801052517cabc6e5bd Mon Sep 17 00:00:00 2001 From: seo Date: Tue, 28 Jul 2026 22:56:35 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B0=A8=EB=9F=89=20=EB=AA=A8=EB=8B=88?= =?UTF-8?q?=ED=84=B0=20=EA=B4=80=EB=A6=AC=EC=9E=90=20=EB=B2=84=ED=8A=BC=20?= =?UTF-8?q?=ED=91=9C=EC=8B=9C=20=EB=B3=B4=EA=B0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- monitor.php | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/monitor.php b/monitor.php index 816becc..4add473 100644 --- a/monitor.php +++ b/monitor.php @@ -2407,7 +2407,7 @@ $carMonitorSession = car_monitor_launcher_session(); let currentLang = 'ko'; const DEFAULT_USAGE_REFRESH_INTERVAL_SEC = 10; - const CAR_MONITOR_SESSION = ; + let CAR_MONITOR_SESSION = ; const CMD_MAP = { se: { label: 'cmdStatus', icon: 'fa-search', bg: 'var(--box-bg-blue)', color: 'var(--accent-blue)' }, @@ -2924,11 +2924,13 @@ $carMonitorSession = car_monitor_launcher_session(); } } - function initCalibrationSettings() { + function showCalibrationSettings() { const btn = document.getElementById('settings-btn'); if (!btn || !CAR_MONITOR_SESSION?.admin) return; btn.classList.remove('d-none'); + if (btn.dataset.ready === '1') return; + btn.dataset.ready = '1'; btn.addEventListener('click', openCalibrationModal); document.getElementById('calibration-close-btn')?.addEventListener('click', closeCalibrationModal); @@ -2940,6 +2942,25 @@ $carMonitorSession = car_monitor_launcher_session(); }); } + async function initCalibrationSettings() { + if (CAR_MONITOR_SESSION?.admin) { + showCalibrationSettings(); + return; + } + + try { + const res = await fetch('https://chaegeon.com/custom/launcher/api.php?adminSession=1', { + credentials: 'include', + cache: 'no-store', + }); + const data = await res.json(); + if (res.ok && data?.authenticated && data?.admin) { + CAR_MONITOR_SESSION = { ...CAR_MONITOR_SESSION, authenticated: true, admin: true }; + showCalibrationSettings(); + } + } catch (_) {} + } + function openCalibrationModal() { const overlay = document.getElementById('calibration-overlay'); if (!overlay) return;