import{_ as a}from"./index105.js?v=1761009159";import{gn as e,P as s,M as l,c8 as r,k as t,l as o}from"./utils-lib.js?v=1761009159";import{c as n,r as i,q as d,H as u,v as m,x as p,e as c,B as _,y as f,Q as v,P,C as j,I as y,G as I}from"./base-lib.js?v=1761009159";import{aK as b,aL as g,aM as w}from"./firewall.js?v=1761009159";import{u as x}from"./column.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./index106.js?v=1761009159";const q=n({__name:"index",setup(n){const q=i(""),h=i(!1),k=i(),C=async()=>{await s({loading:h,request:b(),data:[Array,k]})},V=async()=>q.value?r(q.value)?(await s({loading:"正在添加IP地址，请稍后...",request:g({ip:q.value}),message:!0}),q.value="",void C()):l.error("请输入正确的IP地址"):l.error("请输入IP地址"),H=[{label:"名称",prop:"address"},{label:"封锁时间",prop:"end",render:a=>0==a.end?"永久封禁":e(a.end-a.start)},x([{onClick:async a=>{await s({loading:"正在解封IP地址，请稍后...",request:w({ip:a.address}),message:!0}),C()},title:"立即解封",width:70}])];return d(()=>C()),(e,s)=>{const l=t,r=I,n=o,i=a,d=u("bt-loading");return m(),p("div",null,[c(i,null,{"header-left":_(()=>[c(l,{modelValue:f(q),"onUpdate:modelValue":s[0]||(s[0]=a=>v(q)?q.value=a:null),placeholder:"IP地址",onKeyup:P(V,["enter","native"])},null,8,["modelValue"]),c(r,{class:"!ml-[.4rem]",type:"primary",onClick:V},{default:_(()=>s[1]||(s[1]=[j(" 添加 ",-1)])),_:1,__:[1]})]),content:_(()=>[y(c(n,{ref:"table",column:H,data:f(k),description:"封锁IP列表为空"},null,8,["data"]),[[d,f(h)],[d,"正在加载封锁IP列表，请稍后...","title"]])]),popup:_(()=>s[2]||(s[2]=[])),_:1})])}}});export{q as default};
