2026-03-17 13:17:02 +08:00

477 lines
22 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { DashboardShell } from "@/components/dashboard-shell"
import { DashboardHeader } from "@/components/dashboard-header"
import { Button } from "@/components/ui/button"
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card"
import { Input } from "@/components/ui/input"
import { Label } from "@/components/ui/label"
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"
import { Textarea } from "@/components/ui/textarea"
import { Switch } from "@/components/ui/switch"
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"
import { Save, RefreshCw, Database, Shield, Bell, Sparkles } from "lucide-react"
export default function SettingsPage() {
return (
<DashboardShell>
<DashboardHeader heading="系统设置" text="管理系统配置和参数">
<Button className="bg-gradient-to-r from-pink-500 to-purple-600 hover:from-pink-600 hover:to-purple-700 transition-all duration-300 shadow-md hover:shadow-lg">
<Save className="mr-2 h-4 w-4" />
</Button>
</DashboardHeader>
<Tabs defaultValue="general" className="space-y-4">
<TabsList className="bg-white p-1 shadow-md rounded-lg border">
<TabsTrigger
value="general"
className="data-[state=active]:bg-gradient-to-r data-[state=active]:from-pink-500 data-[state=active]:to-purple-600 data-[state=active]:text-white rounded-md transition-all duration-300"
>
</TabsTrigger>
<TabsTrigger
value="database"
className="data-[state=active]:bg-gradient-to-r data-[state=active]:from-pink-500 data-[state=active]:to-purple-600 data-[state=active]:text-white rounded-md transition-all duration-300"
>
</TabsTrigger>
<TabsTrigger
value="security"
className="data-[state=active]:bg-gradient-to-r data-[state=active]:from-pink-500 data-[state=active]:to-purple-600 data-[state=active]:text-white rounded-md transition-all duration-300"
>
</TabsTrigger>
<TabsTrigger
value="notifications"
className="data-[state=active]:bg-gradient-to-r data-[state=active]:from-pink-500 data-[state=active]:to-purple-600 data-[state=active]:text-white rounded-md transition-all duration-300"
>
</TabsTrigger>
</TabsList>
<TabsContent value="general" className="space-y-4">
<Card className="border-none shadow-lg bg-gradient-to-br from-white to-purple-50">
<CardHeader>
<CardTitle className="text-xl font-bold flex items-center">
<span className="bg-clip-text text-transparent bg-gradient-to-r from-purple-600 to-pink-600">
</span>
<div className="ml-2 h-1 w-10 bg-gradient-to-r from-purple-600 to-pink-600 rounded-full"></div>
</CardTitle>
<CardDescription></CardDescription>
</CardHeader>
<CardContent className="space-y-4">
<div className="grid grid-cols-2 gap-4">
<div className="space-y-2">
<Label htmlFor="system-name"></Label>
<Input
id="system-name"
defaultValue="洛天依管理系统"
className="border-gray-300 focus-visible:ring-pink-500"
/>
</div>
<div className="space-y-2">
<Label htmlFor="system-version"></Label>
<Input
id="system-version"
defaultValue="1.0.0"
className="border-gray-300 focus-visible:ring-pink-500"
disabled
/>
</div>
</div>
<div className="space-y-2">
<Label htmlFor="system-description"></Label>
<Textarea
id="system-description"
defaultValue="洛天依APP管理系统用于管理洛天依的AI模型、服装、道具等内容。"
className="min-h-[100px] border-gray-300 focus-visible:ring-pink-500"
/>
</div>
<div className="grid grid-cols-2 gap-4">
<div className="space-y-2">
<Label htmlFor="language"></Label>
<Select defaultValue="zh-CN">
<SelectTrigger className="border-gray-300 focus:ring-pink-500">
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value="zh-CN"></SelectItem>
<SelectItem value="en-US">English</SelectItem>
<SelectItem value="ja-JP"></SelectItem>
</SelectContent>
</Select>
</div>
<div className="space-y-2">
<Label htmlFor="timezone"></Label>
<Select defaultValue="Asia/Shanghai">
<SelectTrigger className="border-gray-300 focus:ring-pink-500">
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value="Asia/Shanghai"> (UTC+8)</SelectItem>
<SelectItem value="America/New_York"> (UTC-5)</SelectItem>
<SelectItem value="Europe/London"> (UTC+0)</SelectItem>
<SelectItem value="Asia/Tokyo"> (UTC+9)</SelectItem>
</SelectContent>
</Select>
</div>
</div>
<div className="flex items-center space-x-2 pt-2">
<Switch id="maintenance-mode" />
<Label htmlFor="maintenance-mode" className="cursor-pointer">
</Label>
</div>
</CardContent>
<CardFooter className="flex justify-between">
<Button variant="outline" className="hover:bg-pink-50 hover:text-pink-700 transition-all duration-200">
<RefreshCw className="mr-2 h-4 w-4" />
</Button>
<Button className="bg-gradient-to-r from-pink-500 to-purple-600 hover:from-pink-600 hover:to-purple-700 transition-all duration-300 shadow-md hover:shadow-lg">
<Save className="mr-2 h-4 w-4" />
</Button>
</CardFooter>
</Card>
<Card className="border-none shadow-lg bg-gradient-to-br from-white to-blue-50">
<CardHeader>
<CardTitle className="text-xl font-bold flex items-center">
<span className="bg-clip-text text-transparent bg-gradient-to-r from-blue-600 to-teal-600">
</span>
<div className="ml-2 h-1 w-10 bg-gradient-to-r from-blue-600 to-teal-600 rounded-full"></div>
</CardTitle>
<CardDescription></CardDescription>
</CardHeader>
<CardContent className="space-y-4">
<div className="grid grid-cols-2 gap-4">
<div className="space-y-2">
<Label htmlFor="theme"></Label>
<Select defaultValue="light">
<SelectTrigger className="border-gray-300 focus:ring-blue-500">
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value="light"></SelectItem>
<SelectItem value="dark"></SelectItem>
<SelectItem value="system"></SelectItem>
</SelectContent>
</Select>
</div>
<div className="space-y-2">
<Label htmlFor="primary-color"></Label>
<Select defaultValue="pink-purple">
<SelectTrigger className="border-gray-300 focus:ring-blue-500">
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value="pink-purple"></SelectItem>
<SelectItem value="blue-teal"></SelectItem>
<SelectItem value="orange-red"></SelectItem>
<SelectItem value="green-teal">绿</SelectItem>
</SelectContent>
</Select>
</div>
</div>
<div className="flex items-center space-x-2 pt-2">
<Switch id="animations" defaultChecked />
<Label htmlFor="animations" className="cursor-pointer">
</Label>
</div>
</CardContent>
<CardFooter className="flex justify-end">
<Button className="bg-gradient-to-r from-blue-500 to-teal-600 hover:from-blue-600 hover:to-teal-700 transition-all duration-300 shadow-md hover:shadow-lg">
<Sparkles className="mr-2 h-4 w-4" />
</Button>
</CardFooter>
</Card>
</TabsContent>
<TabsContent value="database" className="space-y-4">
<Card className="border-none shadow-lg bg-gradient-to-br from-white to-purple-50">
<CardHeader>
<CardTitle className="text-xl font-bold flex items-center">
<span className="bg-clip-text text-transparent bg-gradient-to-r from-purple-600 to-pink-600">
</span>
<div className="ml-2 h-1 w-10 bg-gradient-to-r from-purple-600 to-pink-600 rounded-full"></div>
</CardTitle>
<CardDescription></CardDescription>
</CardHeader>
<CardContent className="space-y-4">
<div className="grid grid-cols-2 gap-4">
<div className="space-y-2">
<Label htmlFor="db-type"></Label>
<Select defaultValue="mysql">
<SelectTrigger className="border-gray-300 focus:ring-pink-500">
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value="mysql">MySQL</SelectItem>
<SelectItem value="postgresql">PostgreSQL</SelectItem>
<SelectItem value="mongodb">MongoDB</SelectItem>
</SelectContent>
</Select>
</div>
<div className="space-y-2">
<Label htmlFor="db-host"></Label>
<Input
id="db-host"
defaultValue="localhost"
className="border-gray-300 focus-visible:ring-pink-500"
/>
</div>
</div>
<div className="grid grid-cols-2 gap-4">
<div className="space-y-2">
<Label htmlFor="db-port"></Label>
<Input id="db-port" defaultValue="3306" className="border-gray-300 focus-visible:ring-pink-500" />
</div>
<div className="space-y-2">
<Label htmlFor="db-name"></Label>
<Input
id="db-name"
defaultValue="luo_tianyi_app"
className="border-gray-300 focus-visible:ring-pink-500"
/>
</div>
</div>
<div className="grid grid-cols-2 gap-4">
<div className="space-y-2">
<Label htmlFor="db-user"></Label>
<Input id="db-user" defaultValue="admin" className="border-gray-300 focus-visible:ring-pink-500" />
</div>
<div className="space-y-2">
<Label htmlFor="db-password"></Label>
<Input
id="db-password"
type="password"
defaultValue="********"
className="border-gray-300 focus-visible:ring-pink-500"
/>
</div>
</div>
<div className="flex items-center space-x-2 pt-2">
<Switch id="db-ssl" defaultChecked />
<Label htmlFor="db-ssl" className="cursor-pointer">
SSL连接
</Label>
</div>
</CardContent>
<CardFooter className="flex justify-between">
<Button variant="outline" className="hover:bg-pink-50 hover:text-pink-700 transition-all duration-200">
<Database className="mr-2 h-4 w-4" />
</Button>
<Button className="bg-gradient-to-r from-pink-500 to-purple-600 hover:from-pink-600 hover:to-purple-700 transition-all duration-300 shadow-md hover:shadow-lg">
<Save className="mr-2 h-4 w-4" />
</Button>
</CardFooter>
</Card>
</TabsContent>
<TabsContent value="security" className="space-y-4">
<Card className="border-none shadow-lg bg-gradient-to-br from-white to-purple-50">
<CardHeader>
<CardTitle className="text-xl font-bold flex items-center">
<span className="bg-clip-text text-transparent bg-gradient-to-r from-purple-600 to-pink-600">
</span>
<div className="ml-2 h-1 w-10 bg-gradient-to-r from-purple-600 to-pink-600 rounded-full"></div>
</CardTitle>
<CardDescription></CardDescription>
</CardHeader>
<CardContent className="space-y-4">
<div className="grid grid-cols-2 gap-4">
<div className="space-y-2">
<Label htmlFor="session-timeout"></Label>
<Input
id="session-timeout"
type="number"
defaultValue="30"
className="border-gray-300 focus-visible:ring-pink-500"
/>
</div>
<div className="space-y-2">
<Label htmlFor="max-login-attempts"></Label>
<Input
id="max-login-attempts"
type="number"
defaultValue="5"
className="border-gray-300 focus-visible:ring-pink-500"
/>
</div>
</div>
<div className="grid grid-cols-2 gap-4">
<div className="space-y-2">
<Label htmlFor="password-policy"></Label>
<Select defaultValue="strong">
<SelectTrigger className="border-gray-300 focus:ring-pink-500">
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value="basic">8</SelectItem>
<SelectItem value="medium">8</SelectItem>
<SelectItem value="strong">8</SelectItem>
</SelectContent>
</Select>
</div>
<div className="space-y-2">
<Label htmlFor="password-expiry"></Label>
<Input
id="password-expiry"
type="number"
defaultValue="90"
className="border-gray-300 focus-visible:ring-pink-500"
/>
</div>
</div>
<div className="flex items-center space-x-2 pt-2">
<Switch id="two-factor-auth" defaultChecked />
<Label htmlFor="two-factor-auth" className="cursor-pointer">
</Label>
</div>
<div className="flex items-center space-x-2 pt-2">
<Switch id="ip-restriction" />
<Label htmlFor="ip-restriction" className="cursor-pointer">
IP限制
</Label>
</div>
</CardContent>
<CardFooter className="flex justify-between">
<Button variant="outline" className="hover:bg-pink-50 hover:text-pink-700 transition-all duration-200">
<RefreshCw className="mr-2 h-4 w-4" />
</Button>
<Button className="bg-gradient-to-r from-pink-500 to-purple-600 hover:from-pink-600 hover:to-purple-700 transition-all duration-300 shadow-md hover:shadow-lg">
<Shield className="mr-2 h-4 w-4" />
</Button>
</CardFooter>
</Card>
</TabsContent>
<TabsContent value="notifications" className="space-y-4">
<Card className="border-none shadow-lg bg-gradient-to-br from-white to-purple-50">
<CardHeader>
<CardTitle className="text-xl font-bold flex items-center">
<span className="bg-clip-text text-transparent bg-gradient-to-r from-purple-600 to-pink-600">
</span>
<div className="ml-2 h-1 w-10 bg-gradient-to-r from-purple-600 to-pink-600 rounded-full"></div>
</CardTitle>
<CardDescription></CardDescription>
</CardHeader>
<CardContent className="space-y-4">
<div className="space-y-2">
<Label htmlFor="email-server"></Label>
<Input
id="email-server"
defaultValue="smtp.example.com"
className="border-gray-300 focus-visible:ring-pink-500"
/>
</div>
<div className="grid grid-cols-2 gap-4">
<div className="space-y-2">
<Label htmlFor="email-port"></Label>
<Input id="email-port" defaultValue="587" className="border-gray-300 focus-visible:ring-pink-500" />
</div>
<div className="space-y-2">
<Label htmlFor="email-encryption"></Label>
<Select defaultValue="tls">
<SelectTrigger className="border-gray-300 focus:ring-pink-500">
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectItem value="none"></SelectItem>
<SelectItem value="ssl">SSL</SelectItem>
<SelectItem value="tls">TLS</SelectItem>
</SelectContent>
</Select>
</div>
</div>
<div className="grid grid-cols-2 gap-4">
<div className="space-y-2">
<Label htmlFor="email-username"></Label>
<Input
id="email-username"
defaultValue="noreply@example.com"
className="border-gray-300 focus-visible:ring-pink-500"
/>
</div>
<div className="space-y-2">
<Label htmlFor="email-password"></Label>
<Input
id="email-password"
type="password"
defaultValue="********"
className="border-gray-300 focus-visible:ring-pink-500"
/>
</div>
</div>
<div className="space-y-2">
<Label></Label>
<div className="space-y-2">
<div className="flex items-center space-x-2">
<Switch id="notify-login" defaultChecked />
<Label htmlFor="notify-login" className="cursor-pointer">
</Label>
</div>
<div className="flex items-center space-x-2">
<Switch id="notify-content" defaultChecked />
<Label htmlFor="notify-content" className="cursor-pointer">
</Label>
</div>
<div className="flex items-center space-x-2">
<Switch id="notify-system" defaultChecked />
<Label htmlFor="notify-system" className="cursor-pointer">
</Label>
</div>
<div className="flex items-center space-x-2">
<Switch id="notify-security" defaultChecked />
<Label htmlFor="notify-security" className="cursor-pointer">
</Label>
</div>
</div>
</div>
</CardContent>
<CardFooter className="flex justify-between">
<Button variant="outline" className="hover:bg-pink-50 hover:text-pink-700 transition-all duration-200">
<RefreshCw className="mr-2 h-4 w-4" />
</Button>
<Button className="bg-gradient-to-r from-pink-500 to-purple-600 hover:from-pink-600 hover:to-purple-700 transition-all duration-300 shadow-md hover:shadow-lg">
<Bell className="mr-2 h-4 w-4" />
</Button>
</CardFooter>
</Card>
</TabsContent>
</Tabs>
</DashboardShell>
)
}