"use client" import { useState } from "react" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" import { Button } from "@/components/ui/button" import { Input } from "@/components/ui/input" import { Label } from "@/components/ui/label" import { Switch } from "@/components/ui/switch" import { Textarea } from "@/components/ui/textarea" import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" import { Badge } from "@/components/ui/badge" import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs" import { Settings, Shield, Mail, Server, Users, Bell, Save, Eye, EyeOff, Lock, TestTube, CheckCircle, HardDrive, Clock, Globe, } from "lucide-react" export function SystemSettings() { const [settings, setSettings] = useState({ // 一般設定 siteName: "AI應用展示平台", siteDescription: "展示和分享AI應用的專業平台", timezone: "Asia/Taipei", language: "zh-TW", maintenanceMode: false, // 安全設定 twoFactorAuth: true, sessionTimeout: 30, maxLoginAttempts: 5, passwordMinLength: 8, // 郵件設定 smtpHost: "smtp.gmail.com", smtpPort: "587", smtpUser: "", smtpPassword: "", smtpEncryption: "tls", // 系統性能 cacheEnabled: true, cacheTimeout: 3600, maxFileSize: 10, maxUploadSize: 50, // 用戶管理 allowRegistration: true, emailVerification: true, defaultUserRole: "user", // 通知設定 systemNotifications: true, emailNotifications: true, slackWebhook: "", notificationFrequency: "immediate", }) const [activeTab, setActiveTab] = useState("general") const [saveStatus, setSaveStatus] = useState<"idle" | "saving" | "saved" | "error">("idle") const [showSmtpPassword, setShowSmtpPassword] = useState(false) const handleSave = async () => { setSaveStatus("saving") // 模擬保存過程 setTimeout(() => { setSaveStatus("saved") setTimeout(() => setSaveStatus("idle"), 2000) }, 1000) } const handleTestEmail = () => { // 測試郵件功能 alert("測試郵件已發送!") } const updateSetting = (key: string, value: any) => { setSettings((prev) => ({ ...prev, [key]: value })) } return (

系統設定

管理平台的各項系統配置

一般設定 安全設定 郵件設定 系統性能 用戶管理 通知設定 {/* 一般設定 */} 網站基本資訊
updateSetting("siteName", e.target.value)} />