"use client"; import { useState } from "react"; import { motion } from "motion/react"; import { Card, CardContent, CardHeader, CardTitle, } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Badge } from "@/components/ui/badge"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select"; import { Settings, User, Building2, Key, Bell, Palette, Save, CheckCircle, } from "lucide-react"; const settingsTabs = [ { key: "profile", label: "个人资料", icon: User }, { key: "company", label: "企业信息", icon: Building2 }, { key: "ai", label: "AI 配置", icon: Key }, { key: "notifications", label: "通知设置", icon: Bell }, { key: "appearance", label: "外观偏好", icon: Palette }, ]; export default function SettingsPage() { const [activeTab, setActiveTab] = useState("profile"); const [saving, setSaving] = useState(false); const [saved, setSaved] = useState(false); const [profile, setProfile] = useState({ name: "", email: "", phone: "", }); const [company, setCompany] = useState({ name: "", tax_id: "", contact: "", plan: "standard", }); const [aiConfig, setAiConfig] = useState({ provider: "zhipu", model: "glm-4", temperature: "0.3", max_tokens: "2000", }); const [notifications, setNotifications] = useState({ email_alert: true, exception_alert: true, weekly_report: false, cost_threshold: "10000", }); const [appearance, setAppearance] = useState({ theme: "system", density: "comfortable", language: "zh-CN", }); function handleSave() { setSaving(true); setTimeout(() => { setSaving(false); setSaved(true); setTimeout(() => setSaved(false), 2000); }, 800); } return (
管理个人资料、企业信息和系统配置
API Key 在 .env 文件中配置,不建议在此页面修改。
邮件通知
接收任务完成、异常提醒等邮件
异常提醒
检测到异常时发送通知
周报
每周一发送成本分析周报
当月成本超过此值时发送预警