// ================================================================ // Boot Sequence // ================================================================ window.addEventListener('DOMContentLoaded', () => { window.fetchTowns(); window.fetchLog(); // pre-loads cmds globally even in queue mode window.fetchClientStatus(); window.fetchCaptchaStatus(); setInterval(window.fetchTowns, window.POLL_INTERVAL); // In log mode: fetchLog refreshes the panel. In queue mode: refreshLogPanel polls the queue. setInterval(() => { window.fetchLog(); // always keep cmds cache fresh for resource display window.refreshLogPanel(); // refresh whichever panel is visible }, window.POLL_INTERVAL); setInterval(window.fetchClientStatus, window.POLL_INTERVAL); setInterval(window.fetchCaptchaStatus, 5000); // check every 5s });