"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, Bell, Users, Clock } from "lucide-react" import { Checkbox } from "@/components/ui/checkbox" interface AlertRuleSettingsDialogProps { open: boolean onOpenChange: (open: boolean) => void rule?: { name: string condition: string severity: string } } export function AlertRuleSettingsDialog({ open, onOpenChange, rule }: AlertRuleSettingsDialogProps) { const [activeTab, setActiveTab] = useState("condition") return ( 规则设置 - {rule?.name || "告警规则"} 配置告警触发条件、通知方式和处理策略 触发条件 通知设置 抑制规则 处理动作
通知渠道
{[ { id: "email", label: "邮件通知", checked: true }, { id: "sms", label: "短信通知", checked: true }, { id: "webhook", label: "Webhook", checked: false }, { id: "dingtalk", label: "钉钉群", checked: true }, { id: "wechat", label: "企业微信", checked: false }, ].map((channel) => (
{channel.label}
))}
告警抑制

重复告警抑制

相同告警在一定时间内不重复发送

夜间静默

夜间时段不发送低级别告警

自动扩容

触发告警时自动增加实例数

自动重启

服务异常时自动重启

自动降级

负载过高时自动降低服务级别

) }