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