feat: ImageUpload component, custom page title, sidebar menu order
This commit is contained in:
@@ -428,7 +428,20 @@ router.beforeEach((to, _from, next) => {
|
||||
|
||||
// Set page title
|
||||
const appStore = useAppStore()
|
||||
document.title = resolveDocumentTitle(to.meta.title, appStore.siteName, to.meta.titleKey as string)
|
||||
// For custom pages, use menu item label as document title
|
||||
if (to.name === 'CustomPage') {
|
||||
const id = to.params.id as string
|
||||
const items = appStore.cachedPublicSettings?.custom_menu_items ?? []
|
||||
const menuItem = items.find((item) => item.id === id)
|
||||
if (menuItem?.label) {
|
||||
const siteName = appStore.siteName || 'Sub2API'
|
||||
document.title = `${menuItem.label} - ${siteName}`
|
||||
} else {
|
||||
document.title = resolveDocumentTitle(to.meta.title, appStore.siteName, to.meta.titleKey as string)
|
||||
}
|
||||
} else {
|
||||
document.title = resolveDocumentTitle(to.meta.title, appStore.siteName, to.meta.titleKey as string)
|
||||
}
|
||||
|
||||
// Check if route requires authentication
|
||||
const requiresAuth = to.meta.requiresAuth !== false // Default to true
|
||||
|
||||
Reference in New Issue
Block a user