"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, 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 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 (
管理平台的各項系統配置
啟用後,一般用戶將無法訪問網站
為管理員帳戶啟用額外的安全層
所有安全設定均已正確配置
啟用快取以提升系統響應速度
新用戶可以自行註冊帳戶
新用戶需要驗證郵箱才能使用
總用戶數
活躍用戶
本週新增
接收系統重要通知
通過郵件發送通知
最近24小時內發送了 12 條通知