page title

This commit is contained in:
2026-07-18 22:26:38 +02:00
parent 463aa9a7a3
commit 50568127c5
3 changed files with 74 additions and 12 deletions
+17 -12
View File
@@ -78,6 +78,7 @@ import {
countNodesBySection,
type NodeSectionCounts,
} from './sidebarCounts'
import { documentTitleFor, SECTION_TITLES } from './documentTitle'
import {
isResourceSectionId,
navigateTo,
@@ -112,18 +113,6 @@ const NAV_ITEMS: ReadonlyArray<{ id: SectionId; label: string }> = [
{ id: 'vms', label: 'Virtual Machines' },
]
const SECTION_TITLES: Record<SectionId, string> = {
overview: 'Overview',
vms: 'Virtual Machines',
docker: 'Docker',
containers: 'Containers',
logs: 'Logs',
profile: 'Profile',
configuration: 'Configuration',
setup: 'Setup',
login: 'Sign in',
}
const CONFIG_TABS: ReadonlyArray<{ id: ConfigTabId; label: string }> = [
{ id: 'overview', label: 'Overview' },
{ id: 'users', label: 'Users' },
@@ -3906,6 +3895,22 @@ function App() {
}
}, [bootState.kind])
useEffect(() => {
if (bootState.kind === 'loading') {
document.title = documentTitleFor('loading')
return
}
if (bootState.kind === 'setup') {
document.title = documentTitleFor('setup')
return
}
if (bootState.kind === 'login') {
document.title = documentTitleFor('login')
return
}
document.title = documentTitleFor(activeSection)
}, [bootState.kind, activeSection])
function goToSection(section: SectionId) {
if (section === 'setup' || section === 'login') {
return