← Back
Editing: index299.js
import{_ as e}from"./index103.js?v=VERSION_NUMBER";import{p as t,K as a,b as s,l as o,a0 as i}from"./utils-lib.js?v=VERSION_NUMBER";import{aR as n,aS as l}from"./firewall.js?v=VERSION_NUMBER";import{c as r,r as c,e as u,B as p,w as m,q as f,M as d,A as b,x as w}from"./base-lib.js?v=VERSION_NUMBER";import{a as j,u as k,c as _}from"./column.js?v=VERSION_NUMBER";import{g as v}from"./useStore5.js?v=VERSION_NUMBER";import"./__commonjsHelpers__.js?v=VERSION_NUMBER";import"./index104.js?v=VERSION_NUMBER";const x=r({__name:"index",setup(r){const{refs:{networkActive:x}}=v(),y=c(),g=[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("解封成功"),P()}})},title:"解封"}])],h=c([]),I=[{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"},_()],onConfirm:async()=>(await t(o),P(),!1)})}}],P=async()=>{const{data:e}=await l();h.value=e.map((e=>({ip:e,reason:"",source:""})))};return m(x,(e=>{"blockde"===e&&P()}),{immediate:!0}),(t,a)=>{const s=o,n=i,l=e;return f(),d(l,null,{content:b((()=>[u(s,{ref_key:"lockListRef",ref:y,column:g,data:w(h),"max-height":"700"},null,8,["data"])])),"footer-left":b((()=>[u(n,{"table-ref":w(y),options:I},null,8,["table-ref"])])),_:1})}}});export{x as default};
Save File
Cancel