From 0f9f094a48d5b4e048976899ea03ca08127a6f41 Mon Sep 17 00:00:00 2001 From: CaIon Date: Wed, 6 May 2026 16:24:06 +0800 Subject: [PATCH] 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. --- .../layout/components/workspace-switcher.tsx | 2 +- .../layout/config/system-settings.config.ts | 50 +- .../src/components/profile-dropdown.tsx | 4 +- .../src/features/errors/general-error.tsx | 21 +- .../components/deployment-access-guard.tsx | 5 +- .../drawers/model-mutate-drawer.tsx | 7 + .../system-settings/billing/index.tsx | 102 ++ .../billing/section-registry.tsx | 202 ++++ .../system-settings/general/index.tsx | 89 -- .../general/section-registry.tsx | 148 --- .../general/system-info-section.tsx | 28 - .../system-settings/integrations/index.tsx | 88 -- .../integrations/section-registry.tsx | 160 --- .../system-settings/maintenance/config.ts | 21 - .../system-settings/maintenance/index.tsx | 54 - .../maintenance/section-registry.tsx | 137 --- .../features/system-settings/models/index.tsx | 7 + .../models/model-pricing-sheet.tsx | 1032 +++++++++++++++++ .../models/model-ratio-dialog.tsx | 656 ----------- .../models/model-ratio-visual-editor.tsx | 714 ++++++++---- .../models/ratio-settings-card.tsx | 129 ++- .../models/section-registry.tsx | 56 +- .../models/tiered-pricing-editor.tsx | 396 ++++--- .../system-settings/operations/index.tsx | 95 ++ .../operations/section-registry.tsx | 163 +++ .../{request-limits => security}/index.tsx | 18 +- .../section-registry.tsx | 40 +- .../features/system-settings/site/index.tsx | 32 + .../system-settings/site/section-registry.tsx | 93 ++ .../src/features/system-settings/types.ts | 202 ++-- .../system-settings/utils/route-config.ts | 12 +- web/default/src/hooks/use-sidebar-config.ts | 2 +- web/default/src/hooks/use-sidebar-data.ts | 2 +- .../i18n/locales/_reports/_sync-report.json | 8 +- .../locales/_reports/fr.untranslated.json | 3 +- .../locales/_reports/ja.untranslated.json | 2 + .../locales/_reports/ru.untranslated.json | 15 +- .../locales/_reports/vi.untranslated.json | 5 +- web/default/src/i18n/locales/en.json | 95 +- web/default/src/i18n/locales/fr.json | 95 +- web/default/src/i18n/locales/ja.json | 95 +- web/default/src/i18n/locales/ru.json | 97 +- web/default/src/i18n/locales/vi.json | 97 +- web/default/src/i18n/locales/zh.json | 95 +- web/default/src/routeTree.gen.ts | 352 +++--- .../system-settings/billing/$section.tsx | 21 + .../system-settings/billing/index.tsx | 13 + .../system-settings/general/$section.tsx | 21 - .../system-settings/general/index.tsx | 13 - .../_authenticated/system-settings/index.tsx | 2 +- .../system-settings/integrations/$section.tsx | 21 - .../system-settings/integrations/index.tsx | 13 - .../system-settings/maintenance/$section.tsx | 21 - .../system-settings/maintenance/index.tsx | 13 - .../system-settings/operations/$section.tsx | 21 + .../system-settings/operations/index.tsx | 13 + .../request-limits/$section.tsx | 21 - .../system-settings/request-limits/index.tsx | 13 - .../system-settings/security/$section.tsx | 21 + .../system-settings/security/index.tsx | 13 + .../system-settings/site/$section.tsx | 21 + .../system-settings/site/index.tsx | 11 + 62 files changed, 3655 insertions(+), 2343 deletions(-) create mode 100644 web/default/src/features/system-settings/billing/index.tsx create mode 100644 web/default/src/features/system-settings/billing/section-registry.tsx delete mode 100644 web/default/src/features/system-settings/general/index.tsx delete mode 100644 web/default/src/features/system-settings/general/section-registry.tsx delete mode 100644 web/default/src/features/system-settings/integrations/index.tsx delete mode 100644 web/default/src/features/system-settings/integrations/section-registry.tsx delete mode 100644 web/default/src/features/system-settings/maintenance/index.tsx delete mode 100644 web/default/src/features/system-settings/maintenance/section-registry.tsx create mode 100644 web/default/src/features/system-settings/models/model-pricing-sheet.tsx delete mode 100644 web/default/src/features/system-settings/models/model-ratio-dialog.tsx create mode 100644 web/default/src/features/system-settings/operations/index.tsx create mode 100644 web/default/src/features/system-settings/operations/section-registry.tsx rename web/default/src/features/system-settings/{request-limits => security}/index.tsx (62%) rename web/default/src/features/system-settings/{request-limits => security}/section-registry.tsx (68%) create mode 100644 web/default/src/features/system-settings/site/index.tsx create mode 100644 web/default/src/features/system-settings/site/section-registry.tsx create mode 100644 web/default/src/routes/_authenticated/system-settings/billing/$section.tsx create mode 100644 web/default/src/routes/_authenticated/system-settings/billing/index.tsx delete mode 100644 web/default/src/routes/_authenticated/system-settings/general/$section.tsx delete mode 100644 web/default/src/routes/_authenticated/system-settings/general/index.tsx delete mode 100644 web/default/src/routes/_authenticated/system-settings/integrations/$section.tsx delete mode 100644 web/default/src/routes/_authenticated/system-settings/integrations/index.tsx delete mode 100644 web/default/src/routes/_authenticated/system-settings/maintenance/$section.tsx delete mode 100644 web/default/src/routes/_authenticated/system-settings/maintenance/index.tsx create mode 100644 web/default/src/routes/_authenticated/system-settings/operations/$section.tsx create mode 100644 web/default/src/routes/_authenticated/system-settings/operations/index.tsx delete mode 100644 web/default/src/routes/_authenticated/system-settings/request-limits/$section.tsx delete mode 100644 web/default/src/routes/_authenticated/system-settings/request-limits/index.tsx create mode 100644 web/default/src/routes/_authenticated/system-settings/security/$section.tsx create mode 100644 web/default/src/routes/_authenticated/system-settings/security/index.tsx create mode 100644 web/default/src/routes/_authenticated/system-settings/site/$section.tsx create mode 100644 web/default/src/routes/_authenticated/system-settings/site/index.tsx diff --git a/web/default/src/components/layout/components/workspace-switcher.tsx b/web/default/src/components/layout/components/workspace-switcher.tsx index a9003392..f7252afe 100644 --- a/web/default/src/components/layout/components/workspace-switcher.tsx +++ b/web/default/src/components/layout/components/workspace-switcher.tsx @@ -119,7 +119,7 @@ export function WorkspaceSwitcher({ // Only navigate, let useEffect synchronize workspace state based on new pathname // This avoids race conditions and context loss issues if (workspace.id === WORKSPACE_IDS.SYSTEM_SETTINGS) { - navigate({ to: '/system-settings/general' }) + navigate({ to: '/system-settings/site' }) } else { navigate({ to: '/dashboard' }) } diff --git a/web/default/src/components/layout/config/system-settings.config.ts b/web/default/src/components/layout/config/system-settings.config.ts index acba76e4..aab74acf 100644 --- a/web/default/src/components/layout/config/system-settings.config.ts +++ b/web/default/src/components/layout/config/system-settings.config.ts @@ -1,20 +1,20 @@ import { type TFunction } from 'i18next' import { + Box, + CreditCard, + Layout, Settings, Shield, ShieldAlert, - Layout, - Plug, - Box, Wrench, } from 'lucide-react' import { getAuthSectionNavItems } from '@/features/system-settings/auth/section-registry.tsx' +import { getBillingSectionNavItems } from '@/features/system-settings/billing/section-registry.tsx' import { getContentSectionNavItems } from '@/features/system-settings/content/section-registry.tsx' -import { getGeneralSectionNavItems } from '@/features/system-settings/general/section-registry.tsx' -import { getIntegrationsSectionNavItems } from '@/features/system-settings/integrations/section-registry.tsx' -import { getMaintenanceSectionNavItems } from '@/features/system-settings/maintenance/section-registry.tsx' import { getModelsSectionNavItems } from '@/features/system-settings/models/section-registry.tsx' -import { getRequestLimitsSectionNavItems } from '@/features/system-settings/request-limits/section-registry.tsx' +import { getOperationsSectionNavItems } from '@/features/system-settings/operations/section-registry.tsx' +import { getSecuritySectionNavItems } from '@/features/system-settings/security/section-registry.tsx' +import { getSiteSectionNavItems } from '@/features/system-settings/site/section-registry.tsx' import { type NavGroup } from '../types' /** @@ -30,9 +30,9 @@ export function getSystemSettingsNavGroups(t: TFunction): NavGroup[] { title: t('System Administration'), items: [ { - title: t('General'), + title: t('Site & Branding'), icon: Settings, - items: getGeneralSectionNavItems(t), + items: getSiteSectionNavItems(t), }, { title: t('Authentication'), @@ -40,29 +40,29 @@ export function getSystemSettingsNavGroups(t: TFunction): NavGroup[] { items: getAuthSectionNavItems(t), }, { - title: t('Request Limits'), - icon: ShieldAlert, - items: getRequestLimitsSectionNavItems(t), + title: t('Billing & Payment'), + icon: CreditCard, + items: getBillingSectionNavItems(t), }, { - title: t('Content'), - icon: Layout, - items: getContentSectionNavItems(t), - }, - { - title: t('Integrations'), - icon: Plug, - items: getIntegrationsSectionNavItems(t), - }, - { - title: t('Models'), + title: t('Models & Routing'), icon: Box, items: getModelsSectionNavItems(t), }, { - title: t('Maintenance'), + title: t('Security & Limits'), + icon: ShieldAlert, + items: getSecuritySectionNavItems(t), + }, + { + title: t('Console Content'), + icon: Layout, + items: getContentSectionNavItems(t), + }, + { + title: t('Operations'), icon: Wrench, - items: getMaintenanceSectionNavItems(t), + items: getOperationsSectionNavItems(t), }, ], }, diff --git a/web/default/src/components/profile-dropdown.tsx b/web/default/src/components/profile-dropdown.tsx index 526fb1c0..5c1d0b5c 100644 --- a/web/default/src/components/profile-dropdown.tsx +++ b/web/default/src/components/profile-dropdown.tsx @@ -100,8 +100,8 @@ export function ProfileDropdown() { navigate({ - to: '/system-settings/general', - search: { section: 'system-info' }, + to: '/system-settings/site/$section', + params: { section: 'system-info' }, }) } > diff --git a/web/default/src/features/errors/general-error.tsx b/web/default/src/features/errors/general-error.tsx index 5619ac57..f6208661 100644 --- a/web/default/src/features/errors/general-error.tsx +++ b/web/default/src/features/errors/general-error.tsx @@ -3,6 +3,8 @@ import { useTranslation } from 'react-i18next' import { cn } from '@/lib/utils' import { Button } from '@/components/ui/button' +const FEEDBACK_URL = 'https://github.com/QuantumNous/new-api/issues' + type GeneralErrorProps = React.HTMLAttributes & { minimal?: boolean } @@ -28,10 +30,27 @@ export function GeneralError({ {t('Please try again later.')}

{!minimal && ( -
+

+ {t('If this keeps happening, please report it on GitHub Issues.')} +

+ )} + {!minimal && ( +
+ diff --git a/web/default/src/features/models/components/deployment-access-guard.tsx b/web/default/src/features/models/components/deployment-access-guard.tsx index 726f5079..189c7e03 100644 --- a/web/default/src/features/models/components/deployment-access-guard.tsx +++ b/web/default/src/features/models/components/deployment-access-guard.tsx @@ -87,7 +87,10 @@ export function DeploymentAccessGuard({ const navigate = useNavigate() const handleGoToSettings = () => { - navigate({ to: '/system-settings/integrations' }) + navigate({ + to: '/system-settings/models/$section', + params: { section: 'model-deployment' }, + }) } // Combined loading state with step indicator diff --git a/web/default/src/features/models/components/drawers/model-mutate-drawer.tsx b/web/default/src/features/models/components/drawers/model-mutate-drawer.tsx index 8ee6bc61..9028ba10 100644 --- a/web/default/src/features/models/components/drawers/model-mutate-drawer.tsx +++ b/web/default/src/features/models/components/drawers/model-mutate-drawer.tsx @@ -168,6 +168,13 @@ export function ModelMutateDrawer({ 'group_ratio_setting.group_special_usable_group': '{}', 'grok.violation_deduction_enabled': false, 'grok.violation_deduction_amount': 0, + 'channel_affinity_setting.enabled': false, + 'channel_affinity_setting.switch_on_success': true, + 'channel_affinity_setting.max_entries': 100000, + 'channel_affinity_setting.default_ttl_seconds': 3600, + 'channel_affinity_setting.rules': '[]', + 'model_deployment.ionet.api_key': '', + 'model_deployment.ionet.enabled': false, } return getOptionValue(systemOptionsData.data, defaultModelSettings) }, [systemOptionsData]) diff --git a/web/default/src/features/system-settings/billing/index.tsx b/web/default/src/features/system-settings/billing/index.tsx new file mode 100644 index 00000000..f9f4b389 --- /dev/null +++ b/web/default/src/features/system-settings/billing/index.tsx @@ -0,0 +1,102 @@ +import { SettingsPage } from '../components/settings-page' +import type { BillingSettings } from '../types' +import { + BILLING_DEFAULT_SECTION, + getBillingSectionContent, +} from './section-registry.tsx' + +const defaultBillingSettings: BillingSettings = { + QuotaForNewUser: 0, + PreConsumedQuota: 0, + QuotaForInviter: 0, + QuotaForInvitee: 0, + TopUpLink: '', + 'general_setting.docs_link': '', + 'quota_setting.enable_free_model_pre_consume': true, + QuotaPerUnit: 500000, + USDExchangeRate: 7, + 'general_setting.quota_display_type': 'USD', + 'general_setting.custom_currency_symbol': '¤', + 'general_setting.custom_currency_exchange_rate': 1, + DisplayInCurrencyEnabled: true, + DisplayTokenStatEnabled: true, + ModelPrice: '', + ModelRatio: '', + CacheRatio: '', + CreateCacheRatio: '', + CompletionRatio: '', + ImageRatio: '', + AudioRatio: '', + AudioCompletionRatio: '', + ExposeRatioEnabled: false, + 'billing_setting.billing_mode': '{}', + 'billing_setting.billing_expr': '{}', + 'tool_price_setting.prices': '{}', + TopupGroupRatio: '', + GroupRatio: '', + UserUsableGroups: '', + GroupGroupRatio: '', + AutoGroups: '', + DefaultUseAutoGroup: false, + 'group_ratio_setting.group_special_usable_group': '{}', + PayAddress: '', + EpayId: '', + EpayKey: '', + Price: 7.3, + MinTopUp: 1, + CustomCallbackAddress: '', + PayMethods: '', + 'payment_setting.amount_options': '', + 'payment_setting.amount_discount': '', + StripeApiSecret: '', + StripeWebhookSecret: '', + StripePriceId: '', + StripeUnitPrice: 8.0, + StripeMinTopUp: 1, + StripePromotionCodesEnabled: false, + CreemApiKey: '', + CreemWebhookSecret: '', + CreemTestMode: false, + CreemProducts: '[]', + WaffoEnabled: false, + WaffoApiKey: '', + WaffoPrivateKey: '', + WaffoPublicCert: '', + WaffoSandboxPublicCert: '', + WaffoSandboxApiKey: '', + WaffoSandboxPrivateKey: '', + WaffoSandbox: false, + WaffoMerchantId: '', + WaffoCurrency: 'USD', + WaffoUnitPrice: 1, + WaffoMinTopUp: 1, + WaffoNotifyUrl: '', + WaffoReturnUrl: '', + WaffoPayMethods: '[]', + WaffoPancakeEnabled: false, + WaffoPancakeSandbox: false, + WaffoPancakeMerchantID: '', + WaffoPancakePrivateKey: '', + WaffoPancakeWebhookPublicKey: '', + WaffoPancakeWebhookTestKey: '', + WaffoPancakeStoreID: '', + WaffoPancakeProductID: '', + WaffoPancakeReturnURL: '', + WaffoPancakeCurrency: 'USD', + WaffoPancakeUnitPrice: 1, + WaffoPancakeMinTopUp: 1, + 'checkin_setting.enabled': false, + 'checkin_setting.min_quota': 1000, + 'checkin_setting.max_quota': 10000, +} + +export function BillingSettings() { + return ( + + ) +} diff --git a/web/default/src/features/system-settings/billing/section-registry.tsx b/web/default/src/features/system-settings/billing/section-registry.tsx new file mode 100644 index 00000000..54c7ea61 --- /dev/null +++ b/web/default/src/features/system-settings/billing/section-registry.tsx @@ -0,0 +1,202 @@ +import { parseCurrencyDisplayType } from '@/lib/currency' +import type { BillingSettings } from '../types' +import { createSectionRegistry } from '../utils/section-registry' +import { CheckinSettingsSection } from '../general/checkin-settings-section' +import { PricingSection } from '../general/pricing-section' +import { QuotaSettingsSection } from '../general/quota-settings-section' +import { PaymentSettingsSection } from '../integrations/payment-settings-section' +import { RatioSettingsCard } from '../models/ratio-settings-card' + +const getModelDefaults = (settings: BillingSettings) => ({ + ModelPrice: settings.ModelPrice, + ModelRatio: settings.ModelRatio, + CacheRatio: settings.CacheRatio, + CreateCacheRatio: settings.CreateCacheRatio, + CompletionRatio: settings.CompletionRatio, + ImageRatio: settings.ImageRatio, + AudioRatio: settings.AudioRatio, + AudioCompletionRatio: settings.AudioCompletionRatio, + ExposeRatioEnabled: settings.ExposeRatioEnabled, + BillingMode: settings['billing_setting.billing_mode'], + BillingExpr: settings['billing_setting.billing_expr'], +}) + +const getGroupDefaults = (settings: BillingSettings) => ({ + TopupGroupRatio: settings.TopupGroupRatio, + GroupRatio: settings.GroupRatio, + UserUsableGroups: settings.UserUsableGroups, + GroupGroupRatio: settings.GroupGroupRatio, + AutoGroups: settings.AutoGroups, + DefaultUseAutoGroup: settings.DefaultUseAutoGroup, + GroupSpecialUsableGroup: + settings['group_ratio_setting.group_special_usable_group'], +}) + +const BILLING_SECTIONS = [ + { + id: 'quota', + titleKey: 'Quota Settings', + descriptionKey: 'Configure user quota allocation and rewards', + build: (settings: BillingSettings) => ( + + ), + }, + { + id: 'currency', + titleKey: 'Currency & Display', + descriptionKey: 'Configure currency conversion and quota display options', + build: (settings: BillingSettings) => ( + + ), + }, + { + id: 'model-pricing', + titleKey: 'Model Pricing', + descriptionKey: 'Configure model pricing ratios and tool prices', + build: (settings: BillingSettings) => ( + + ), + }, + { + id: 'group-pricing', + titleKey: 'Group Pricing', + descriptionKey: 'Configure group ratios and group-specific pricing rules', + build: (settings: BillingSettings) => ( + + ), + }, + { + id: 'payment', + titleKey: 'Payment Gateway', + descriptionKey: 'Configure payment gateway integrations', + build: (settings: BillingSettings) => ( + + ), + }, + { + id: 'checkin', + titleKey: 'Check-in Rewards', + descriptionKey: 'Configure daily check-in rewards for users', + build: (settings: BillingSettings) => ( + + ), + }, +] as const + +export type BillingSectionId = (typeof BILLING_SECTIONS)[number]['id'] + +const billingRegistry = createSectionRegistry( + { + sections: BILLING_SECTIONS, + defaultSection: 'quota', + basePath: '/system-settings/billing', + urlStyle: 'path', + } +) + +export const BILLING_SECTION_IDS = billingRegistry.sectionIds +export const BILLING_DEFAULT_SECTION = billingRegistry.defaultSection +export const getBillingSectionNavItems = billingRegistry.getSectionNavItems +export const getBillingSectionContent = billingRegistry.getSectionContent diff --git a/web/default/src/features/system-settings/general/index.tsx b/web/default/src/features/system-settings/general/index.tsx deleted file mode 100644 index 054a3f86..00000000 --- a/web/default/src/features/system-settings/general/index.tsx +++ /dev/null @@ -1,89 +0,0 @@ -import { useParams } from '@tanstack/react-router' -import { useTranslation } from 'react-i18next' -import { parseCurrencyDisplayType } from '@/lib/currency' -import { useSystemOptions, getOptionValue } from '../hooks/use-system-options' -import type { GeneralSettings } from '../types' -import { - GENERAL_DEFAULT_SECTION, - getGeneralSectionContent, -} from './section-registry.tsx' - -const defaultGeneralSettings: GeneralSettings = { - 'theme.frontend': 'default', - Notice: '', - SystemName: 'New API', - Logo: '', - Footer: '', - About: '', - HomePageContent: '', - ServerAddress: '', - 'legal.user_agreement': '', - 'legal.privacy_policy': '', - QuotaForNewUser: 0, - PreConsumedQuota: 0, - QuotaForInviter: 0, - QuotaForInvitee: 0, - TopUpLink: '', - 'general_setting.docs_link': '', - 'quota_setting.enable_free_model_pre_consume': true, - QuotaPerUnit: 500000, - USDExchangeRate: 7, - 'general_setting.quota_display_type': 'USD', - 'general_setting.custom_currency_symbol': '¤', - 'general_setting.custom_currency_exchange_rate': 1, - RetryTimes: 0, - DisplayInCurrencyEnabled: true, - DisplayTokenStatEnabled: true, - DefaultCollapseSidebar: false, - DemoSiteEnabled: false, - SelfUseModeEnabled: false, - 'checkin_setting.enabled': false, - 'checkin_setting.min_quota': 1000, - 'checkin_setting.max_quota': 10000, - 'channel_affinity_setting.enabled': false, - 'channel_affinity_setting.switch_on_success': true, - 'channel_affinity_setting.max_entries': 100000, - 'channel_affinity_setting.default_ttl_seconds': 3600, - 'channel_affinity_setting.rules': '[]', -} - -export function GeneralSettings() { - const { t } = useTranslation() - const { data, isLoading } = useSystemOptions() - const params = useParams({ - from: '/_authenticated/system-settings/general/$section', - }) - - if (isLoading) { - return ( -
-
{t('Loading settings...')}
-
- ) - } - - const settings = getOptionValue(data?.data, defaultGeneralSettings) - const quotaDisplayType = parseCurrencyDisplayType( - settings['general_setting.quota_display_type'] - ) - const activeSection = (params?.section ?? GENERAL_DEFAULT_SECTION) as - | 'system-info' - | 'quota' - | 'pricing' - | 'checkin' - | 'behavior' - | 'channel-affinity' - const sectionContent = getGeneralSectionContent( - activeSection, - settings, - quotaDisplayType - ) - - return ( -
-
-
{sectionContent}
-
-
- ) -} diff --git a/web/default/src/features/system-settings/general/section-registry.tsx b/web/default/src/features/system-settings/general/section-registry.tsx deleted file mode 100644 index f79c042a..00000000 --- a/web/default/src/features/system-settings/general/section-registry.tsx +++ /dev/null @@ -1,148 +0,0 @@ -import type { GeneralSettings } from '../types' -import { createSectionRegistry } from '../utils/section-registry' -import { ChannelAffinitySection } from './channel-affinity' -import { CheckinSettingsSection } from './checkin-settings-section' -import { PricingSection } from './pricing-section' -import { QuotaSettingsSection } from './quota-settings-section' -import { SystemBehaviorSection } from './system-behavior-section' -import { SystemInfoSection } from './system-info-section' - -const GENERAL_SECTIONS = [ - { - id: 'system-info', - titleKey: 'System Information', - descriptionKey: 'Configure basic system information and branding', - build: (settings: GeneralSettings) => ( - - ), - }, - { - id: 'quota', - titleKey: 'Quota Settings', - descriptionKey: 'Configure user quota allocation and rewards', - build: (settings: GeneralSettings) => ( - - ), - }, - { - id: 'pricing', - titleKey: 'Pricing & Display', - descriptionKey: 'Configure pricing model and display options', - build: ( - settings: GeneralSettings, - quotaDisplayType: 'USD' | 'CNY' | 'TOKENS' | 'CUSTOM' - ) => ( - - ), - }, - { - id: 'checkin', - titleKey: 'Check-in Settings', - descriptionKey: 'Configure daily check-in rewards for users', - build: (settings: GeneralSettings) => ( - - ), - }, - { - id: 'behavior', - titleKey: 'System Behavior', - descriptionKey: 'Configure system-wide behavior and defaults', - build: (settings: GeneralSettings) => ( - - ), - }, - { - id: 'channel-affinity', - titleKey: 'Channel Affinity', - descriptionKey: 'Configure channel affinity (sticky routing) rules', - build: (settings: GeneralSettings) => ( - - ), - }, -] as const - -export type GeneralSectionId = (typeof GENERAL_SECTIONS)[number]['id'] - -const generalRegistry = createSectionRegistry< - GeneralSectionId, - GeneralSettings, - ['USD' | 'CNY' | 'TOKENS' | 'CUSTOM'] ->({ - sections: GENERAL_SECTIONS, - defaultSection: 'system-info', - basePath: '/system-settings/general', - urlStyle: 'path', -}) - -export const GENERAL_SECTION_IDS = generalRegistry.sectionIds -export const GENERAL_DEFAULT_SECTION = generalRegistry.defaultSection -export const getGeneralSectionNavItems = generalRegistry.getSectionNavItems -export const getGeneralSectionContent = generalRegistry.getSectionContent diff --git a/web/default/src/features/system-settings/general/system-info-section.tsx b/web/default/src/features/system-settings/general/system-info-section.tsx index ff5064a7..255af00b 100644 --- a/web/default/src/features/system-settings/general/system-info-section.tsx +++ b/web/default/src/features/system-settings/general/system-info-section.tsx @@ -32,7 +32,6 @@ const _systemInfoSchema = z.object({ theme: z.object({ frontend: z.enum(['default', 'classic']), }), - Notice: z.string().optional(), SystemName: z.string().min(1), ServerAddress: z.string().optional(), Logo: z.string().url().optional().or(z.literal('')), @@ -65,7 +64,6 @@ export function SystemInfoSection({ defaultValues }: SystemInfoSectionProps) { frontend: defaultValues.theme?.frontend === 'classic' ? 'classic' : 'default', }, - Notice: normalizeValue(defaultValues.Notice), SystemName: normalizeValue(defaultValues.SystemName), ServerAddress: normalizeValue(defaultValues.ServerAddress), Logo: normalizeValue(defaultValues.Logo), @@ -82,7 +80,6 @@ export function SystemInfoSection({ defaultValues }: SystemInfoSectionProps) { theme: z.object({ frontend: z.enum(['default', 'classic']), }), - Notice: z.string().optional(), SystemName: z.string().min(1, { error: () => t('System name is required'), }), @@ -161,31 +158,6 @@ export function SystemInfoSection({ defaultValues }: SystemInfoSectionProps) { )} /> - ( - - {t('Notice')} - -