feat(default): reorganize system settings pricing UI

Refine the default system settings structure and model pricing editor so pricing configuration is easier to scan and edit.
This commit is contained in:
CaIon
2026-05-06 16:24:06 +08:00
parent 9acf5fecae
commit 0f9f094a48
62 changed files with 3655 additions and 2343 deletions
@@ -0,0 +1,21 @@
import { createFileRoute, redirect } from '@tanstack/react-router'
import { BillingSettings } from '@/features/system-settings/billing'
import {
BILLING_DEFAULT_SECTION,
BILLING_SECTION_IDS,
} from '@/features/system-settings/billing/section-registry.tsx'
export const Route = createFileRoute(
'/_authenticated/system-settings/billing/$section'
)({
beforeLoad: ({ params }) => {
const validSections = BILLING_SECTION_IDS as unknown as string[]
if (!validSections.includes(params.section)) {
throw redirect({
to: '/system-settings/billing/$section',
params: { section: BILLING_DEFAULT_SECTION },
})
}
},
component: BillingSettings,
})
@@ -0,0 +1,13 @@
import { createFileRoute, redirect } from '@tanstack/react-router'
import { BILLING_DEFAULT_SECTION } from '@/features/system-settings/billing/section-registry.tsx'
export const Route = createFileRoute(
'/_authenticated/system-settings/billing/'
)({
beforeLoad: () => {
throw redirect({
to: '/system-settings/billing/$section',
params: { section: BILLING_DEFAULT_SECTION },
})
},
})
@@ -1,21 +0,0 @@
import { createFileRoute, redirect } from '@tanstack/react-router'
import { GeneralSettings } from '@/features/system-settings/general'
import {
GENERAL_DEFAULT_SECTION,
GENERAL_SECTION_IDS,
} from '@/features/system-settings/general/section-registry.tsx'
export const Route = createFileRoute(
'/_authenticated/system-settings/general/$section'
)({
beforeLoad: ({ params }) => {
const validSections = GENERAL_SECTION_IDS as unknown as string[]
if (!validSections.includes(params.section)) {
throw redirect({
to: '/system-settings/general/$section',
params: { section: GENERAL_DEFAULT_SECTION },
})
}
},
component: GeneralSettings,
})
@@ -1,13 +0,0 @@
import { createFileRoute, redirect } from '@tanstack/react-router'
import { GENERAL_DEFAULT_SECTION } from '@/features/system-settings/general/section-registry.tsx'
export const Route = createFileRoute(
'/_authenticated/system-settings/general/'
)({
beforeLoad: () => {
throw redirect({
to: '/system-settings/general/$section',
params: { section: GENERAL_DEFAULT_SECTION },
})
},
})
@@ -3,7 +3,7 @@ import { createFileRoute, redirect } from '@tanstack/react-router'
export const Route = createFileRoute('/_authenticated/system-settings/')({
beforeLoad: () => {
throw redirect({
to: '/system-settings/general',
to: '/system-settings/site',
})
},
})
@@ -1,21 +0,0 @@
import { createFileRoute, redirect } from '@tanstack/react-router'
import { IntegrationSettings } from '@/features/system-settings/integrations'
import {
INTEGRATIONS_DEFAULT_SECTION,
INTEGRATIONS_SECTION_IDS,
} from '@/features/system-settings/integrations/section-registry.tsx'
export const Route = createFileRoute(
'/_authenticated/system-settings/integrations/$section'
)({
beforeLoad: ({ params }) => {
const validSections = INTEGRATIONS_SECTION_IDS as unknown as string[]
if (!validSections.includes(params.section)) {
throw redirect({
to: '/system-settings/integrations/$section',
params: { section: INTEGRATIONS_DEFAULT_SECTION },
})
}
},
component: IntegrationSettings,
})
@@ -1,13 +0,0 @@
import { createFileRoute, redirect } from '@tanstack/react-router'
import { INTEGRATIONS_DEFAULT_SECTION } from '@/features/system-settings/integrations/section-registry.tsx'
export const Route = createFileRoute(
'/_authenticated/system-settings/integrations/'
)({
beforeLoad: () => {
throw redirect({
to: '/system-settings/integrations/$section',
params: { section: INTEGRATIONS_DEFAULT_SECTION },
})
},
})
@@ -1,21 +0,0 @@
import { createFileRoute, redirect } from '@tanstack/react-router'
import { MaintenanceSettings } from '@/features/system-settings/maintenance'
import {
MAINTENANCE_DEFAULT_SECTION,
MAINTENANCE_SECTION_IDS,
} from '@/features/system-settings/maintenance/section-registry.tsx'
export const Route = createFileRoute(
'/_authenticated/system-settings/maintenance/$section'
)({
beforeLoad: ({ params }) => {
const validSections = MAINTENANCE_SECTION_IDS as unknown as string[]
if (!validSections.includes(params.section)) {
throw redirect({
to: '/system-settings/maintenance/$section',
params: { section: MAINTENANCE_DEFAULT_SECTION },
})
}
},
component: MaintenanceSettings,
})
@@ -1,13 +0,0 @@
import { createFileRoute, redirect } from '@tanstack/react-router'
import { MAINTENANCE_DEFAULT_SECTION } from '@/features/system-settings/maintenance/section-registry.tsx'
export const Route = createFileRoute(
'/_authenticated/system-settings/maintenance/'
)({
beforeLoad: () => {
throw redirect({
to: '/system-settings/maintenance/$section',
params: { section: MAINTENANCE_DEFAULT_SECTION },
})
},
})
@@ -0,0 +1,21 @@
import { createFileRoute, redirect } from '@tanstack/react-router'
import { OperationsSettings } from '@/features/system-settings/operations'
import {
OPERATIONS_DEFAULT_SECTION,
OPERATIONS_SECTION_IDS,
} from '@/features/system-settings/operations/section-registry.tsx'
export const Route = createFileRoute(
'/_authenticated/system-settings/operations/$section'
)({
beforeLoad: ({ params }) => {
const validSections = OPERATIONS_SECTION_IDS as unknown as string[]
if (!validSections.includes(params.section)) {
throw redirect({
to: '/system-settings/operations/$section',
params: { section: OPERATIONS_DEFAULT_SECTION },
})
}
},
component: OperationsSettings,
})
@@ -0,0 +1,13 @@
import { createFileRoute, redirect } from '@tanstack/react-router'
import { OPERATIONS_DEFAULT_SECTION } from '@/features/system-settings/operations/section-registry.tsx'
export const Route = createFileRoute(
'/_authenticated/system-settings/operations/'
)({
beforeLoad: () => {
throw redirect({
to: '/system-settings/operations/$section',
params: { section: OPERATIONS_DEFAULT_SECTION },
})
},
})
@@ -1,21 +0,0 @@
import { createFileRoute, redirect } from '@tanstack/react-router'
import { RequestLimitsSettings } from '@/features/system-settings/request-limits'
import {
REQUEST_LIMITS_DEFAULT_SECTION,
REQUEST_LIMITS_SECTION_IDS,
} from '@/features/system-settings/request-limits/section-registry.tsx'
export const Route = createFileRoute(
'/_authenticated/system-settings/request-limits/$section'
)({
beforeLoad: ({ params }) => {
const validSections = REQUEST_LIMITS_SECTION_IDS as unknown as string[]
if (!validSections.includes(params.section)) {
throw redirect({
to: '/system-settings/request-limits/$section',
params: { section: REQUEST_LIMITS_DEFAULT_SECTION },
})
}
},
component: RequestLimitsSettings,
})
@@ -1,13 +0,0 @@
import { createFileRoute, redirect } from '@tanstack/react-router'
import { REQUEST_LIMITS_DEFAULT_SECTION } from '@/features/system-settings/request-limits/section-registry.tsx'
export const Route = createFileRoute(
'/_authenticated/system-settings/request-limits/'
)({
beforeLoad: () => {
throw redirect({
to: '/system-settings/request-limits/$section',
params: { section: REQUEST_LIMITS_DEFAULT_SECTION },
})
},
})
@@ -0,0 +1,21 @@
import { createFileRoute, redirect } from '@tanstack/react-router'
import { SecuritySettings } from '@/features/system-settings/security'
import {
SECURITY_DEFAULT_SECTION,
SECURITY_SECTION_IDS,
} from '@/features/system-settings/security/section-registry.tsx'
export const Route = createFileRoute(
'/_authenticated/system-settings/security/$section'
)({
beforeLoad: ({ params }) => {
const validSections = SECURITY_SECTION_IDS as unknown as string[]
if (!validSections.includes(params.section)) {
throw redirect({
to: '/system-settings/security/$section',
params: { section: SECURITY_DEFAULT_SECTION },
})
}
},
component: SecuritySettings,
})
@@ -0,0 +1,13 @@
import { createFileRoute, redirect } from '@tanstack/react-router'
import { SECURITY_DEFAULT_SECTION } from '@/features/system-settings/security/section-registry.tsx'
export const Route = createFileRoute(
'/_authenticated/system-settings/security/'
)({
beforeLoad: () => {
throw redirect({
to: '/system-settings/security/$section',
params: { section: SECURITY_DEFAULT_SECTION },
})
},
})
@@ -0,0 +1,21 @@
import { createFileRoute, redirect } from '@tanstack/react-router'
import { SiteSettings } from '@/features/system-settings/site'
import {
SITE_DEFAULT_SECTION,
SITE_SECTION_IDS,
} from '@/features/system-settings/site/section-registry.tsx'
export const Route = createFileRoute(
'/_authenticated/system-settings/site/$section'
)({
beforeLoad: ({ params }) => {
const validSections = SITE_SECTION_IDS as unknown as string[]
if (!validSections.includes(params.section)) {
throw redirect({
to: '/system-settings/site/$section',
params: { section: SITE_DEFAULT_SECTION },
})
}
},
component: SiteSettings,
})
@@ -0,0 +1,11 @@
import { createFileRoute, redirect } from '@tanstack/react-router'
import { SITE_DEFAULT_SECTION } from '@/features/system-settings/site/section-registry.tsx'
export const Route = createFileRoute('/_authenticated/system-settings/site/')({
beforeLoad: () => {
throw redirect({
to: '/system-settings/site/$section',
params: { section: SITE_DEFAULT_SECTION },
})
},
})