import{_ as e}from"./index105.js?v=1761009159";import{p as t,P as a,b as s,l as o,ah as i}from"./utils-lib.js?v=1761009159";import{aR as n,aS as l}from"./firewall.js?v=1761009159";import{c as r,r as c,e as u,C as p,w as m,v as f,N as d,B as b,y as w}from"./base-lib.js?v=1761009159";import{a as j,u as k,c as v}from"./column.js?v=1761009159";import{g as _}from"./useStore5.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./index106.js?v=1761009159";const y=r({__name:"index",setup(r){const{refs:{networkActive:y}}=_(),g=c(),x=[j({key:"ip"}),{label:"IP",prop:"ip",width:200},{label:"封锁来源",render:e=>{const t=e.source||"Nginx防火墙";return u("div",{title:t},[t])}},{label:"封禁原因",render:e=>{const t=e.reason||"IP扫描过于频繁";return t.length>20?u("div",{title:t},[t.slice(0,20),p("...")]):u("div",{title:t},[t])}},k([{onClick:async e=>{await t({title:"解封IP",content:"解封后将允许【".concat(e.ip,"】进行访问，是否继续操作？")}),await a({loading:"正在解封，请稍后...",request:n({ip:e.ip,timeout:86400}),success:()=>{s().success("解封成功"),I()}})},title:"解封"}])],h=c([]),P=[{label:"解封",value:"unlock",event:async(e,t,a,s)=>{const o=async(e,t)=>{const{ip:a}=e,s=new Map([["unlock",n]]).get(l);if("unlock"===l)if(s)return await s({ip:a,timeout:86400})},{label:i,value:l}=s;await e({title:"批量".concat(i),content:"即将批量".concat(i,"选中的IP，是否继续操作?"),column:[{label:"批量解封",prop:"ip"},v()],onConfirm:async()=>(await t(o),I(),!1)})}}],I=async()=>{const{data:e}=await l();h.value=e.map(e=>({ip:e,reason:"",source:""}))};return m(y,e=>{"blockde"===e&&I()},{immediate:!0}),(t,a)=>{const s=o,n=i,l=e;return f(),d(l,null,{content:b(()=>[u(s,{ref_key:"lockListRef",ref:g,column:x,data:w(h),"max-height":"700"},null,8,["data"])]),"footer-left":b(()=>[u(n,{"table-ref":w(g),options:P},null,8,["table-ref"])]),_:1})}}});export{y as default};
