Refresh the overview page with an actionable Get Started guide, live API request details, real usage sparklines, and OpenAI-inspired dashboard panels. Add collapsible setup state, role-aware quick actions, and localized copy so returning users can focus on platform health.
94 lines
3.0 KiB
TypeScript
Vendored
94 lines
3.0 KiB
TypeScript
Vendored
import { SystemInfoSection } from '../general/system-info-section'
|
|
import {
|
|
parseHeaderNavModules,
|
|
parseSidebarModulesAdmin,
|
|
serializeHeaderNavModules,
|
|
serializeSidebarModulesAdmin,
|
|
} from '../maintenance/config'
|
|
import { HeaderNavigationSection } from '../maintenance/header-navigation-section'
|
|
import { NoticeSection } from '../maintenance/notice-section'
|
|
import { SidebarModulesSection } from '../maintenance/sidebar-modules-section'
|
|
import type { SiteSettings } from '../types'
|
|
import { createSectionRegistry } from '../utils/section-registry'
|
|
|
|
const SITE_SECTIONS = [
|
|
{
|
|
id: 'system-info',
|
|
titleKey: 'System Information',
|
|
descriptionKey: 'Configure basic system information and branding',
|
|
build: (settings: SiteSettings) => (
|
|
<SystemInfoSection
|
|
defaultValues={{
|
|
theme: {
|
|
frontend: settings['theme.frontend'] as 'default' | 'classic',
|
|
},
|
|
SystemName: settings.SystemName,
|
|
Logo: settings.Logo,
|
|
Footer: settings.Footer,
|
|
About: settings.About,
|
|
HomePageContent: settings.HomePageContent,
|
|
ServerAddress: settings.ServerAddress,
|
|
legal: {
|
|
user_agreement: settings['legal.user_agreement'],
|
|
privacy_policy: settings['legal.privacy_policy'],
|
|
},
|
|
}}
|
|
/>
|
|
),
|
|
},
|
|
{
|
|
id: 'notice',
|
|
titleKey: 'System Notice',
|
|
descriptionKey: 'Configure system maintenance notice',
|
|
build: (settings: SiteSettings) => (
|
|
<NoticeSection defaultValue={settings.Notice ?? ''} />
|
|
),
|
|
},
|
|
{
|
|
id: 'header-navigation',
|
|
titleKey: 'Header navigation',
|
|
descriptionKey: 'Configure header navigation modules',
|
|
build: (settings: SiteSettings) => {
|
|
const headerNavConfig = parseHeaderNavModules(settings.HeaderNavModules)
|
|
const headerNavSerialized = serializeHeaderNavModules(headerNavConfig)
|
|
return (
|
|
<HeaderNavigationSection
|
|
config={headerNavConfig}
|
|
initialSerialized={headerNavSerialized}
|
|
/>
|
|
)
|
|
},
|
|
},
|
|
{
|
|
id: 'sidebar-modules',
|
|
titleKey: 'Sidebar modules',
|
|
descriptionKey: 'Configure sidebar modules for admin',
|
|
build: (settings: SiteSettings) => {
|
|
const sidebarConfig = parseSidebarModulesAdmin(
|
|
settings.SidebarModulesAdmin
|
|
)
|
|
const sidebarSerialized = serializeSidebarModulesAdmin(sidebarConfig)
|
|
return (
|
|
<SidebarModulesSection
|
|
config={sidebarConfig}
|
|
initialSerialized={sidebarSerialized}
|
|
/>
|
|
)
|
|
},
|
|
},
|
|
] as const
|
|
|
|
export type SiteSectionId = (typeof SITE_SECTIONS)[number]['id']
|
|
|
|
const siteRegistry = createSectionRegistry<SiteSectionId, SiteSettings>({
|
|
sections: SITE_SECTIONS,
|
|
defaultSection: 'system-info',
|
|
basePath: '/system-settings/site',
|
|
urlStyle: 'path',
|
|
})
|
|
|
|
export const SITE_SECTION_IDS = siteRegistry.sectionIds
|
|
export const SITE_DEFAULT_SECTION = siteRegistry.defaultSection
|
|
export const getSiteSectionNavItems = siteRegistry.getSectionNavItems
|
|
export const getSiteSectionContent = siteRegistry.getSectionContent
|