import{K as a,jx as e,M as l,k as s}from"./utils-lib.js?v=1761009159";import{c as t,r,a6 as m,v as u,x as i,e as o,y as n,g as d,C as v}from"./base-lib.js?v=1761009159";import{u as c,a as p,g as b}from"./index66.js?v=1761009159";import{i as f,j,c as x,b as y,h as T,f as h}from"./form-item.js?v=1761009159";import{_ as w}from"./validator.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./index105.js?v=1761009159";import"./index219.js?v=1761009159";import"./column.js?v=1761009159";import"./index106.js?v=1761009159";const g={class:"p-[2rem]"},_=t({__name:"index",setup(t,{expose:_}){var C,q;const{isAlarmEdit:V,alarmRowData:P,nodeAlarmRefresh:R}=c(),U=r(0),k=r(V.value&&["222","223"].includes(null==(q=null==(C=P.value)?void 0:C.task_data)?void 0:q.tid)?"master":"clb"),A=["sms"],{BtForm:D,submit:H}=a({data:p,options:a=>d(()=>{var e,l;return[...V.value?[]:[f("告警类型","alarmType",[{label:"负载均衡",value:"clb"},{label:"主从复制",value:"master"}],{attrs:{onChange:a=>{k.value=a}}}),"clb"===k.value&&f("负载均衡类型","lcbType",[{label:"HTTP负载均衡",value:0},{label:"TCP/UDP负载均衡",value:1}],{attrs:{onChange:e=>{U.value=e,a.value.name=""}}})],..."master"===k.value?[f("主从复制类型","masterType",[{label:"Mysql",value:"222"},{label:"Redis",value:"223"}],{attrs:{disabled:V.value}})]:[],..."clb"===k.value?[j("负载均衡名称","name",0===U.value?null==(e=P.value)?void 0:e.clbList:null==(l=P.value)?void 0:l.tcpList,{attrs:{class:"!w-[32rem]",placeholder:"请选择负载均衡",filterable:!0,disabled:V.value},onChange:a=>{},rules:[{required:!0,message:"请选择负载均衡"}]}),...0===a.value.lcbType?[x("成功状态码","successCode",{attrs:{class:"!w-[32rem]",placeholder:"多个用逗号隔开，如：200,301,302,403,404"}})]:[y("连接失败次数","failTimes",{attrs:{class:"!w-[32rem]",placeholder:"如果n次后仍然无法正常连接则告警",rules:[{required:!0,message:"请输入连接失败次数"}]}})]]:[],T("配置发送次数",()=>o("div",{class:"flex items-center"},[o(s,{modelValue:a.value.sendTimes,"onUpdate:modelValue":e=>a.value.sendTimes=e,class:"!w-[8rem] mr-2",placeholder:"请输入发送次数",type:"text"},null),o("span",{class:"text-gray-400 text-small"},[v("次后停止推送，次日再次监控")])]),"sendTimes"),T("告警方式",()=>o("div",null,[o(w,{class:"!w-[32rem]",modelValue:a.value.type,"onUpdate:modelValue":e=>a.value.type=e,multiple:!0,limit:A,"is-show-api":!1,"all-alarm":!0},null)])),h(" ",[{content:"每隔1分钟进行检测异常后将发送告警"}])]}),submit:async(a,s,t)=>{await s();const r=b(a.value),m=await e(r);return l.request(m),R.value=!0,m.status}});return _({onConfirm:H}),m(()=>{P.value=[]}),(a,e)=>(u(),i("div",g,[o(n(D))]))}});export{_ as default};
