// Depends on: core/utils.js ($) const PAGE_TITLES = { dashboard: 'Overview', connections: 'Virtual Hosts', swarms: 'Server Tunnels', 'service-tunnels': 'Service Tunnels', tabs: 'Proxy & CA', ssh: 'SSH Connections', rdp: 'Remote Desktop', backups: 'Backups', logs: 'Logs', settings: 'Settings' }; function navigateTo(page) { document.querySelectorAll('.nav-item').forEach(i => i.classList.remove('active')); document.querySelectorAll('.page').forEach(p => p.classList.remove('active')); const navItem = document.querySelector(`.nav-item[data-page="${page}"]`); if (navItem) navItem.classList.add('active'); const pageEl = $(`page-${page}`); if (pageEl) pageEl.classList.add('active'); const titleEl = $('topbarTitle'); if (titleEl) titleEl.textContent = PAGE_TITLES[page] || page; } function setupNavigation() { document.querySelectorAll('.nav-item').forEach(item => { item.addEventListener('click', () => navigateTo(item.dataset.page)); }); }