fix(settings): move documentation link to site settings

This commit is contained in:
CaIon
2026-09-20 17:51:52 +08:00
parent 58a9eff4c8
commit 3fdf9083dc
7 changed files with 34 additions and 28 deletions
@@ -30,7 +30,6 @@ const defaultBillingSettings: BillingSettings = {
QuotaForInviter: 0,
QuotaForInvitee: 0,
TopUpLink: '',
'general_setting.docs_link': '',
'quota_setting.enable_free_model_pre_consume': true,
QuotaPerUnit: 500000,
USDExchangeRate: 7,
@@ -65,9 +65,6 @@ const BILLING_SECTIONS = [
QuotaForInviter: settings.QuotaForInviter,
QuotaForInvitee: settings.QuotaForInvitee,
TopUpLink: settings.TopUpLink,
general_setting: {
docs_link: settings['general_setting.docs_link'],
},
quota_setting: {
enable_free_model_pre_consume:
settings['quota_setting.enable_free_model_pre_consume'],
@@ -56,9 +56,6 @@ const quotaSchema = z.object({
QuotaForInviter: z.coerce.number().min(0),
QuotaForInvitee: z.coerce.number().min(0),
TopUpLink: z.string(),
general_setting: z.object({
docs_link: z.string(),
}),
quota_setting: z.object({
enable_free_model_pre_consume: z.boolean(),
}),
@@ -282,26 +279,6 @@ export function QuotaSettingsSection({
</FormItem>
)}
/>
<FormField
control={form.control}
name='general_setting.docs_link'
render={({ field }) => (
<FormItem>
<FormLabel>{t('Documentation Link')}</FormLabel>
<FormControl>
<Input
placeholder={t('https://docs.example.com')}
{...field}
/>
</FormControl>
<FormDescription>
{t('Link to your documentation site')}
</FormDescription>
<FormMessage />
</FormItem>
)}
/>
</SettingsFormGrid>
</SettingsForm>
</Form>
@@ -54,6 +54,9 @@ const _systemInfoSchema = z.object({
Footer: z.string().optional(),
About: z.string().optional(),
HomePageContent: z.string().optional(),
general_setting: z.object({
docs_link: z.string(),
}),
legal: z.object({
user_agreement: z.string().optional(),
privacy_policy: z.string().optional(),
@@ -83,6 +86,9 @@ export function SystemInfoSection({ defaultValues }: SystemInfoSectionProps) {
Footer: normalizeValue(defaultValues.Footer),
About: normalizeValue(defaultValues.About),
HomePageContent: normalizeValue(defaultValues.HomePageContent),
general_setting: {
docs_link: normalizeValue(defaultValues.general_setting?.docs_link),
},
legal: {
user_agreement: normalizeValue(defaultValues.legal?.user_agreement),
privacy_policy: normalizeValue(defaultValues.legal?.privacy_policy),
@@ -104,6 +110,9 @@ export function SystemInfoSection({ defaultValues }: SystemInfoSectionProps) {
Footer: z.string().optional(),
About: z.string().optional(),
HomePageContent: z.string().optional(),
general_setting: z.object({
docs_link: z.string(),
}),
legal: z.object({
user_agreement: z.string().optional(),
privacy_policy: z.string().optional(),
@@ -225,6 +234,26 @@ export function SystemInfoSection({ defaultValues }: SystemInfoSectionProps) {
)}
/>
<FormField
control={form.control}
name='general_setting.docs_link'
render={({ field }) => (
<FormItem>
<FormLabel>{t('Documentation Link')}</FormLabel>
<FormControl>
<Input
placeholder={t('https://docs.example.com')}
{...field}
/>
</FormControl>
<FormDescription>
{t('Link to your documentation site')}
</FormDescription>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={form.control}
name='Footer'
@@ -33,6 +33,7 @@ const defaultSiteSettings: SiteSettings = {
HomePageContent: '',
ServerAddress: '',
TaskPublicAddress: '',
'general_setting.docs_link': '',
'legal.user_agreement': '',
'legal.privacy_policy': '',
HeaderNavModules: '',
@@ -43,6 +43,9 @@ const SITE_SECTIONS = [
HomePageContent: settings.HomePageContent,
ServerAddress: settings.ServerAddress,
TaskPublicAddress: settings.TaskPublicAddress,
general_setting: {
docs_link: settings['general_setting.docs_link'],
},
legal: {
user_agreement: settings['legal.user_agreement'],
privacy_policy: settings['legal.privacy_policy'],
+1 -1
View File
@@ -149,6 +149,7 @@ export type SiteSettings = {
HomePageContent: string
ServerAddress: string
TaskPublicAddress: string
'general_setting.docs_link': string
'legal.user_agreement': string
'legal.privacy_policy': string
HeaderNavModules: string
@@ -275,7 +276,6 @@ export type BillingSettings = {
QuotaForInviter: number
QuotaForInvitee: number
TopUpLink: string
'general_setting.docs_link': string
'quota_setting.enable_free_model_pre_consume': boolean
QuotaPerUnit: number
USDExchangeRate: number