import{_ as a}from"./index105.js?v=1761009159";import{_ as e}from"./index114.js?v=1761009159";import{M as t,bF as r,aA as l,aK as o,V as s,n,Q as i,p as c,P as d,l as p}from"./utils-lib.js?v=1761009159";import{r as m,o as u,V as f,e as g,c as _,q as h,H as v,v as w,x as b,B as y,I as j,y as A}from"./base-lib.js?v=1761009159";import{u as C}from"./column.js?v=1761009159";import{u as I}from"./useStore4.js?v=1761009159";import{getPhpSiteSafeLog as B,addPhpSiteIpWhite as P,addPhpSiteSafeWhite as k}from"./site.js?v=1761009159";const{siteInfo:O}=I();m();const x=m(),T=m(),L=u({list:[],p:1,limit:10,total:100,load:!1}),R=async a=>{await c({title:"加入IP白名单",width:"35rem",icon:"warning-filled",content:"是否将【".concat(a.address,"】添加到IP白名单？")}),d({loading:"正在加入IP白名单，请稍后...",request:P({start_ip:a.address,end_ip:a.address}),message:!0})},U=async a=>{await c({title:"加入URL白名单",width:"35rem",icon:"warning-filled",content:"加入URL白名单后此URL将不再进行防御，是否继续操作？"}),d({loading:"正在加入URL白名单，请稍后...",request:k({url_rule:a.url}),message:!0})},E=async()=>{L.load=!1;try{L.load=!0;const a=await B({siteName:O.value.name,p:L.p,rows:L.limit});a.status||t.error(a.msg),L.list=r(a.data.data,"array",[]),L.total=l(a.data.page)}catch(a){o(a)}finally{L.load=!1}},S=f([{label:"时间",prop:"addtime",render:a=>g("div",{class:"flex !items-center inline-block truncate"},[s(a.addtime)])},{label:"用户IP",prop:"address",render:a=>g("div",{class:"bt-link truncate",onClick:()=>{R(a)}},[a.address])},{label:"恶意类型",prop:"intercept"},{label:"url地址",prop:"url",width:270},C([{onClick:a=>{U(a)},title:"URL加白",width:80},{onClick:async a=>{T.value={data:a},n({title:"【".concat(a.address,"】详情"),area:60,isAsync:!0,component:()=>i(()=>import("./log-detail4.js?v=1761009159"),__vite__mapDeps([]),import.meta.url),showFooter:!1})},title:"详情"},{onClick:async a=>{T.value={data:a},n({title:"【".concat(a.address,"】HTTP详情"),area:80,isAsync:!0,component:()=>i(()=>import("./http-detail.js?v=1761009159"),__vite__mapDeps([]),import.meta.url),showFooter:!1})},title:"HTTP"}])]),$=m(""),D=()=>{$.value=((a,e)=>{let t=null,r="",l=0;return(e=e||{}).newlineAfterColonIfBeforeBraceOrBracket=!0===e.newlineAfterColonIfBeforeBraceOrBracket,e.spaceAfterColon=!1!==e.spaceAfterColon,"string"!=typeof a||(a=JSON.parse(a)),t=/([\{\}])/g,a=(a=JSON.stringify(a)).replace(t,"\r\n$1\r\n"),t=/([\[\]])/g,a=a.replace(t,"\r\n$1\r\n"),t=/(\,)/g,a=a.replace(t,"$1\r\n"),t=/(\r\n\r\n)/g,a=a.replace(t,"\r\n"),t=/\r\n\,/g,a=a.replace(t,","),e.newlineAfterColonIfBeforeBraceOrBracket||(t=/\:\r\n\{/g,a=a.replace(t,":{"),t=/\:\r\n\[/g,a=a.replace(t,":[")),e.spaceAfterColon&&(t=/\:/g,a=a.replace(t,": ")),a.split("\r\n").forEach(function(a,e){var t=0,o=0,s="";for(a.match(/\{$/)||a.match(/\[$/)?o=1:a.match(/\}/)||a.match(/\]/)?0!==l&&(l-=1):o=0,t=0;t<l;t++)s+="  ";r+=s+a+"\r\n",l+=o}),r})(T.value.data)},V=m({}),q=()=>{V.value=T.value.data},F={class:"relative p-[16px]"},H=_({__name:"index",props:{compData:{default:()=>({})}},setup(t){const r=t;return h(()=>{var a,e;a=r.compData,x.value=a,L.list=(null==(e=x.value)?void 0:e.data)||[],L.total=l(x.value.page)}),(t,r)=>{const l=p,o=e,s=a,n=v("bt-loading");return w(),b("div",F,[g(s,null,{"header-left":y(()=>r[3]||(r[3]=[])),"header-right":y(()=>r[4]||(r[4]=[])),content:y(()=>[j(g(l,{ref:"ftpTable",column:A(S),"max-height":360,data:A(L).list,description:"暂无数据"},null,8,["column","data"]),[[n,A(L).load],[n,"正在加载中，请稍后...","title"]])]),"footer-right":y(()=>[g(o,{page:A(L).p,"onUpdate:page":r[0]||(r[0]=a=>A(L).p=a),row:A(L).limit,"onUpdate:row":r[1]||(r[1]=a=>A(L).limit=a),total:A(L).total,onChange:r[2]||(r[2]=a=>A(E)())},null,8,["page","row","total"])]),_:1})])}}}),N=Object.freeze(Object.defineProperty({__proto__:null,default:H},Symbol.toStringTag,{value:"Module"}));export{R as a,T as b,U as c,D as d,$ as e,N as f,q as i,V as l};
function __vite__mapDeps(indexes) {
  if (!__vite__mapDeps.viteFileDeps) {
    __vite__mapDeps.viteFileDeps = []
  }
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}
