mirror of
https://github.com/Buriburizaem0n/admin-frontend-domain.git
synced 2026-06-21 10:30:14 +00:00
feat: add inputs for custom branding and background images in Settings
This commit is contained in:
@@ -52,6 +52,11 @@ const settingFormSchema = z.object({
|
||||
tls: asOptionalField(z.boolean()),
|
||||
enable_ip_change_notification: asOptionalField(z.boolean()),
|
||||
enable_plain_ip_in_notification: asOptionalField(z.boolean()),
|
||||
custom_logo: asOptionalField(z.string()),
|
||||
custom_description: asOptionalField(z.string()),
|
||||
custom_links: asOptionalField(z.string()),
|
||||
background_image_day: asOptionalField(z.string()),
|
||||
background_image_night: asOptionalField(z.string()),
|
||||
})
|
||||
|
||||
export default function SettingsPage() {
|
||||
@@ -139,6 +144,71 @@ export default function SettingsPage() {
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="custom_logo"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Custom Logo URL</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="https://example.com/logo.png" {...field} />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="custom_description"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Custom Description / Subtitle</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="My monitoring dashboard" {...field} />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="custom_links"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Custom Links (JSON Array)</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder='[{"link":"https://loohui.com/","name":"Blog","blank":false}]' {...field} />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="background_image_day"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Background Image (Day)</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="https://example.com/day.jpg" {...field} />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="background_image_night"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Background Image (Night)</FormLabel>
|
||||
<FormControl>
|
||||
<Input placeholder="https://example.com/night.jpg" {...field} />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="language"
|
||||
|
||||
+15
-2
@@ -667,8 +667,12 @@ export interface ModelSetting {
|
||||
/** 用于前端判断生成的安装命令是否启用 TLS */
|
||||
tls?: boolean;
|
||||
user_template?: string;
|
||||
/** 前端真实IP */
|
||||
web_real_ip_header?: string;
|
||||
custom_logo?: string;
|
||||
custom_description?: string;
|
||||
custom_links?: string;
|
||||
background_image_day?: string;
|
||||
background_image_night?: string;
|
||||
}
|
||||
|
||||
export interface ModelSettingForm {
|
||||
@@ -690,8 +694,17 @@ export interface ModelSettingForm {
|
||||
site_name?: string;
|
||||
tls?: boolean;
|
||||
user_template?: string;
|
||||
/** 前端真实IP */
|
||||
web_real_ip_header?: string;
|
||||
/** 自定义Logo链接 */
|
||||
custom_logo?: string;
|
||||
/** 自定义描述/副标题 */
|
||||
custom_description?: string;
|
||||
/** 自定义导航链接 (JSON) */
|
||||
custom_links?: string;
|
||||
/** 白天背景图链接 */
|
||||
background_image_day?: string;
|
||||
/** 夜间背景图链接 */
|
||||
background_image_night?: string;
|
||||
}
|
||||
|
||||
export interface ModelSettingResponse {
|
||||
|
||||
Reference in New Issue
Block a user