// Nexus โ Shared Sidebar + Layout Component // Usage: Include after Alpine.js. Call initLayout() on each page. // Sets sidebar, highlights active nav item, loads user info. function initLayout(activeNav) { // activeNav: 'index'|'servers'|'files'|'push'|'scripts'|'credentials'|'schedules'|'retries'|'audit'|'settings' const navItems = [ { id:'index', icon:'๐ ', label:'ไปช่กจ็', href:'/app/index.html' }, { id:'servers', icon:'๐ฅ', label:'ๆๅกๅจ', href:'/app/servers.html' }, { id:'files', icon:'๐', label:'ๆไปถ็ฎก็', href:'/app/files.html' }, { id:'push', icon:'๐ค', label:'ๆจ้', href:'/app/push.html' }, { id:'scripts', icon:'๐', label:'่ๆฌๅบ', href:'/app/scripts.html' }, { id:'credentials', icon:'๐', label:'ๅญๆฎ', href:'/app/credentials.html' }, { id:'schedules', icon:'โฐ', label:'่ฐๅบฆ', href:'/app/schedules.html' }, { id:'retries', icon:'๐', label:'้่ฏ้ๅ', href:'/app/retries.html' }, ]; const bottomNav = [ { id:'audit', icon:'๐', label:'ๅฎก่ฎกๆฅๅฟ', href:'/app/audit.html' }, { id:'settings', icon:'โ๏ธ', label:'่ฎพ็ฝฎ', href:'/app/settings.html' }, ]; // Build sidebar HTML const navHtml = navItems.map(n => `${n.icon} ${n.label}` ).join(''); const bottomHtml = bottomNav.map(n => `${n.icon} ${n.label}` ).join(''); // Find sidebar container const sidebar = document.querySelector('[data-sidebar]'); if (!sidebar) return; sidebar.innerHTML = `