INNER CODE UNIT · JavaScript
navigate
XortexAI/XMem · admin/app.js:42
function navigate(page) {
currentPage = page;
document.querySelectorAll('.page').forEach(p => p.classList.remove('active'));
document.querySelectorAll('.nav-item').forEach(n => n.classList.remove('active'));
const el = document.getElementById('page-' + page);
if (el) el.classList.add('active');
const nav = document.querySelector(`[data-page="${page}"]`);
if (nav) nav.classList.add('active');
const titles = { overview:'Overview', logs:'Live Terminal', llm:'LLM & Costs', github:'GitHub Traffic', users:'Users', scanner:'Scanner Analytics', outreach:'Outreach' };
const titleEl = document.getElementById('page-title');
if (titleEl) titleEl.textContent = titles[page] || page;
if (page === 'overview') loadOverview();
if (page === 'llm') loadLLM();
if (page === 'github') loadGitHub();
if (page === 'users') loadUsers();
if (page === 'scanner') loadScanner();