import{n as a,Q as e,P as l,M as t,l as s,$ as o,k as n,aC as r,W as i,_ as u}from"./utils-lib.js?v=1761009159";import{c as m,r as d,o as p,q as c,H as g,v as _,x as f,e as b,B as v,z as h,y,Q as w,I as x,P as V,C as j,an as I,aC as P,G as C}from"./base-lib.js?v=1761009159";import{_ as k}from"./index105.js?v=1761009159";import{b4 as q,b5 as D,b6 as z,b7 as A,b8 as E}from"./firewall.js?v=1761009159";import{u as F}from"./column.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./index106.js?v=1761009159";const T={class:"flex items-center"},U=u(m({__name:"login-alert-setting",props:{compData:{default:()=>({alertStatus:"",refreshFn:()=>""})}},setup(u){const m=u,U=d("login"),H=d(""),Q=d([]),S=d(!1),B=d("");d([]);const G=d({}),K=d(0),L=d(!1),M=d([]),O=p({p:1,p_size:8}),R=[{content:"只有root用户登录才会触发告警"}],W=async()=>{a({title:"登录告警设置",component:()=>e(()=>import("./alert-setting-dialog.js?v=1761009159"),__vite__mapDeps([]),import.meta.url),area:50,compData:{...G.value,refreshEvent:J},showFooter:!0})},$=async(a,e)=>{a?W():(await l({loading:L,request:q({task_id:G.value.id,status:0}),message:!0}),J())},J=async()=>{var a;const e=await(null==(a=m.compData)?void 0:a.refreshFn());B.value=e.status,G.value=e},N=a=>{var e;"white"===a?Y():(B.value=null==(e=m.compData)?void 0:e.alertStatus,J(),(async()=>{await l({loading:L,request:E({...O}),data:{data:[Array,M],page:i(K)}})})())},X=async()=>{H.value?(await l({loading:"正在添加IP白名单，请稍后...",request:D({ip:H.value}),message:!0}),H.value="",Y()):t.error("请输入正确的IP地址")},Y=async(a=1)=>{await l({loading:S,request:z(),data:{msg:[Array,Q]}})},Z=[{label:"IP地址",render:a=>a},F([{onClick:a=>(async a=>{await l({loading:"正在删除IP白名单，请稍后...",request:A({ip:a}),message:!0}),Y()})(a),title:"删除"}])],aa=[{label:"详情",prop:"log"},{label:"添加时间",prop:"addtime",align:"right",width:160}];return c(async()=>{N(U.value)}),(a,e)=>{const l=I,t=s,i=k,u=o,m=P,d=n,p=C,c=r,q=g("bt-loading");return _(),f("div",null,[b(c,{class:"!h-[580px]",modelValue:y(U),"onUpdate:modelValue":e[2]||(e[2]=a=>w(U)?U.value=a:null),type:"left-bg-card",position:"left",onChange:N},{default:v(()=>[b(m,{label:"登录日志",name:"login"},{default:v(()=>[b(i,null,{"header-left":v(()=>[h("span",T,[e[3]||(e[3]=h("span",{class:"mr-[1rem]"},"登录告警",-1)),b(l,{size:"small",class:"!mb-0",modelValue:y(B),"onUpdate:modelValue":e[0]||(e[0]=a=>w(B)?B.value=a:null),onChange:$},null,8,["modelValue"]),h("span",{class:"bt-link ml-8px",onClick:W}," 告警通道设置 ")])]),content:v(()=>[x(b(t,{"max-height":"450",ref:"portTable",column:aa,data:y(M)},null,8,["data"]),[[q,y(L)],[q,"正在加载列表，请稍后...","title"]])]),"footer-right":v(()=>e[4]||(e[4]=[])),_:1}),b(u,{options:R,class:"mt-[1rem] mx-[1rem]"})]),_:1}),b(m,{label:"IP白名单",name:"white"},{default:v(()=>[b(i,null,{"header-left":v(()=>[b(d,{class:"mr-4",modelValue:y(H),"onUpdate:modelValue":e[1]||(e[1]=a=>w(H)?H.value=a:null),width:"20rem",placeholder:"请输入IP",onKeyup:V(X,["enter","native"]),clearable:""},null,8,["modelValue"]),b(p,{type:"primary",onClick:X},{default:v(()=>e[5]||(e[5]=[j("添加",-1)])),_:1,__:[5]})]),content:v(()=>[x(b(t,{"max-height":"500",ref:"portTable",column:Z,data:y(Q)},null,8,["data"]),[[q,y(S)]])]),default:v(()=>[b(u,{options:R})]),_:1})]),_:1})]),_:1},8,["modelValue"])])}}}),[["__scopeId","data-v-8885db45"]]);export{U as default};
function __vite__mapDeps(indexes) {
  if (!__vite__mapDeps.viteFileDeps) {
    __vite__mapDeps.viteFileDeps = []
  }
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}
