()
| 1419 | } |
| 1420 | |
| 1421 | // File Management uses the full page width (its file browser benefits from |
| 1422 | // the extra room); every other tab keeps the centered max-width column. |
| 1423 | const mainEl = document.querySelector('main'); |
| 1424 | if (mainEl) mainEl.style.maxWidth = (tabName === 'files') ? 'none' : ''; |
| 1425 | |
| 1426 | const selectedBtn = document.querySelector(`[data-tab="${tabName}"]`); |
| 1427 | if (selectedBtn) { |
| 1428 | selectedBtn.classList.add('bg-Ragnar-600'); |
| 1429 | selectedBtn.classList.remove('text-gray-300', 'hover:text-white', 'hover:bg-gray-700'); |
| 1430 | } |
| 1431 | |
| 1432 | loadTabData(tabName); |
| 1433 | |
| 1434 | if (tabName === 'dashboard' || tabName === 'pentest') { |
| 1435 | ragnarScriptsAutoSync(); |
| 1436 | } |
| 1437 | |
| 1438 | if (tabName === 'config') { |
| 1439 | try { refreshSensingInstallCard(); syncRusenseTabToggle(); syncTerminalToggle(); syncMeshTabToggle(); } catch (e) { /* ignore */ } |
| 1440 | try { showConfigSubtab(localStorage.getItem('cfg-subtab') || 'system'); } catch (e) { /* ignore */ } |
| 1441 | } |
| 1442 | |
| 1443 | const mobileMenu = document.getElementById('mobile-menu'); |
| 1444 | if (mobileMenu) { |
| 1445 | mobileMenu.classList.add('hidden'); |
| 1446 | } |
| 1447 | } |
| 1448 | |
| 1449 | function _setSubtabActive(btn, active) { |
| 1450 | if (!btn) return; |
| 1451 | btn.classList.toggle('bg-Ragnar-600', active); |
| 1452 | btn.classList.toggle('text-white', active); |
| 1453 | btn.classList.toggle('text-slate-400', !active); |
| 1454 | btn.classList.toggle('hover:bg-slate-700', !active); |
| 1455 | btn.classList.toggle('hover:text-white', !active); |
nothing calls this directly
no test coverage detected