feat: add DaisyUI theme option to default frontend settings
Docker Build / Build and Push Docker Image (push) Successful in 4m39s
Docker Build / Build and Push Docker Image (push) Successful in 4m39s
This commit is contained in:
@@ -53,7 +53,7 @@ import { useUpdateOption } from '../hooks/use-update-option'
|
||||
|
||||
const _systemInfoSchema = z.object({
|
||||
theme: z.object({
|
||||
frontend: z.enum(['default', 'classic']),
|
||||
frontend: z.enum(['default', 'classic', 'daisy']),
|
||||
}),
|
||||
SystemName: z.string().min(1),
|
||||
ServerAddress: z.string().optional(),
|
||||
@@ -85,7 +85,9 @@ export function SystemInfoSection({ defaultValues }: SystemInfoSectionProps) {
|
||||
const normalizedDefaults: SystemInfoFormValues = {
|
||||
theme: {
|
||||
frontend:
|
||||
defaultValues.theme?.frontend === 'classic' ? 'classic' : 'default',
|
||||
defaultValues.theme?.frontend === 'classic' || defaultValues.theme?.frontend === 'daisy'
|
||||
? defaultValues.theme.frontend
|
||||
: 'default',
|
||||
},
|
||||
SystemName: normalizeValue(defaultValues.SystemName),
|
||||
ServerAddress: normalizeValue(defaultValues.ServerAddress),
|
||||
@@ -101,7 +103,7 @@ export function SystemInfoSection({ defaultValues }: SystemInfoSectionProps) {
|
||||
|
||||
const systemInfoSchemaWithI18n = z.object({
|
||||
theme: z.object({
|
||||
frontend: z.enum(['default', 'classic']),
|
||||
frontend: z.enum(['default', 'classic', 'daisy']),
|
||||
}),
|
||||
SystemName: z.string().min(1, {
|
||||
error: () => t('System name is required'),
|
||||
@@ -170,6 +172,10 @@ export function SystemInfoSection({ defaultValues }: SystemInfoSectionProps) {
|
||||
value: 'classic',
|
||||
label: t('Classic (Legacy Frontend)'),
|
||||
},
|
||||
{
|
||||
value: 'daisy',
|
||||
label: t('Daisy (DaisyUI Frontend)'),
|
||||
},
|
||||
]}
|
||||
onValueChange={field.onChange}
|
||||
value={field.value}
|
||||
@@ -187,6 +193,9 @@ export function SystemInfoSection({ defaultValues }: SystemInfoSectionProps) {
|
||||
<SelectItem value='classic'>
|
||||
{t('Classic (Legacy Frontend)')}
|
||||
</SelectItem>
|
||||
<SelectItem value='daisy'>
|
||||
{t('Daisy (DaisyUI Frontend)')}
|
||||
</SelectItem>
|
||||
</SelectGroup>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
|
||||
@@ -37,7 +37,7 @@ const SITE_SECTIONS = [
|
||||
<SystemInfoSection
|
||||
defaultValues={{
|
||||
theme: {
|
||||
frontend: settings['theme.frontend'] as 'default' | 'classic',
|
||||
frontend: settings['theme.frontend'] as 'default' | 'classic' | 'daisy',
|
||||
},
|
||||
SystemName: settings.SystemName,
|
||||
Logo: settings.Logo,
|
||||
|
||||
Vendored
+1
@@ -711,6 +711,7 @@
|
||||
"Choose where to fetch upstream metadata.": "Choose where to fetch upstream metadata.",
|
||||
"Choose which charts are selected by default when opening model analytics.": "Choose which charts are selected by default when opening model analytics.",
|
||||
"Classic (Legacy Frontend)": "Classic (Legacy Frontend)",
|
||||
"Daisy (DaisyUI Frontend)": "Daisy (DaisyUI Frontend)",
|
||||
"Claude": "Claude",
|
||||
"Claude CLI Header Passthrough": "Claude CLI Header Passthrough",
|
||||
"Clean": "Clean",
|
||||
|
||||
Vendored
+1
@@ -711,6 +711,7 @@
|
||||
"Choose where to fetch upstream metadata.": "选择从何处获取上游元数据。",
|
||||
"Choose which charts are selected by default when opening model analytics.": "选择打开模型调用分析时默认选中的图表。",
|
||||
"Classic (Legacy Frontend)": "经典前端",
|
||||
"Daisy (DaisyUI Frontend)": "Daisy(DaisyUI 前端)",
|
||||
"Claude": "Claude",
|
||||
"Claude CLI Header Passthrough": "Claude CLI 请求头透传",
|
||||
"Clean": "无冲突",
|
||||
|
||||
Reference in New Issue
Block a user