"use client" import { useState } from "react" import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from "@/components/ui/dialog" 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 { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs" import { Settings, Shield, Zap, Bell } from "lucide-react" interface APISettingsDialogProps { open: boolean onOpenChange: (open: boolean) => void api?: { name: string endpoint: string } } export function APISettingsDialog({ open, onOpenChange, api }: APISettingsDialogProps) { const [activeTab, setActiveTab] = useState("basic") return ( API设置 - {api?.name || "API服务"} 配置API服务的基本信息、限流策略和告警规则 基本信息 限流配置 认证授权 告警设置

启用API

关闭后API将返回503错误

限流策略

突发流量保护

自动识别并限制异常流量

认证方式

IP白名单

仅允许白名单IP访问

请求签名验证

验证请求签名防止篡改

告警规则

错误率告警

错误率超过阈值时告警

延迟告警

P99延迟超过阈值时告警

) }