File: /www/server/panel/BTPanel/static/js/intercept-record.js
import{_ as w}from"./index109.js?v=1777008528";import{b as P,ag as k,P as V}from"./utils-lib.js?v=1777008528";import{c as A,x as D,O as R,C as r,e as c,D as f,A as E,z as o}from"./base-lib.js?v=1777008528";import{a as L}from"./hooks2.js?v=1777008528";import{D as N}from"./index431.js?v=1777008528";import{T as O,t as i,b as S,f as U,a as F,c as G,h as j,d as q,e as z}from"./view-model.js?v=1777008528";import{i as H,a as M}from"./columns.js?v=1777008528";import{a as W}from"./use-log-detail.js?v=1777008528";import"./__commonjsHelpers__.js?v=1777008528";import"./index432.js?v=1777008528";import"./constants.js?v=1777008528";import"./column.js?v=1777008528";import"./index110.js?v=1777008528";const J={class:"flex w-[550px] justify-between"},it=A({__name:"intercept-record",setup(K){const{mainHeight:b}=P(),p=O.slice(0,-1).map(t=>({label:t.label,getValue:()=>null})),d=()=>s.refresh(),B=k([{label:"拉黑IP",value:"block_ip",event:async(t,e,a,m,n)=>{await t({title:"批量拉黑IP",content:"即将拉黑所选IP,是否继续?",column:M,onConfirm:async()=>{const l=a.value.map(u=>u.ip),h=await W(l);return await e(async u=>{const _=h[u.ip];return{...u,batchStatus:_?1:2,msg:_?"操作成功":"操作失败"}}),n==null||n(),s.refresh(),!1}})}}]),s=L({name:"_table_intercept_record",request:async t=>{const e=i.value.intercept_record,a=e.customTime?[e.customTime,e.customTime]:[],m=S(e.activeIndex,a),n=await U({p:t.p,limit:t.limit,...t.search?{keyword:t.search}:{},...m});return{data:n.list.map((l,h)=>({...l,id:h})),total:n.total}},columns:H(j,t=>G(t,d),t=>F(t,d)),extension:[B]}),I=s.BtTable,g=s.BtPage,x=s.BtSearch,T=s.BtBatch;function y(t,e){if(e>=p.length){const a=Array.isArray(t)?t[0]:t;i.value.intercept_record.customTime=a,i.value.intercept_record.activeIndex=p.length}else i.value.intercept_record.activeIndex=e,i.value.intercept_record.customTime="";s.refresh()}async function C(){await q()}async function v(){await z(d)}return(t,e)=>{const a=V,m=w;return D(),R(m,null,{"header-left":r(()=>[c(a,{onClick:C},{default:r(()=>[...e[1]||(e[1]=[f("导出",-1)])]),_:1}),c(a,{onClick:v},{default:r(()=>[...e[2]||(e[2]=[f("清空日志",-1)])]),_:1})]),"header-right":r(()=>[E("div",J,[c(N,{buttons:o(p),type:"date","default-index":o(i).intercept_record.activeIndex,"custom-time-value":o(i).intercept_record.customTime,onChange:e[0]||(e[0]=(n,l)=>y(n,l))},null,8,["buttons","default-index","custom-time-value"]),c(o(x),{placeholder:"输入域名/IP/URL/User-Agent/归属地",class:"!w-[27rem]"})])]),content:r(()=>[c(o(I),{"max-height":o(b)-280},null,8,["max-height"])]),"footer-left":r(()=>[c(o(T))]),"footer-right":r(()=>[c(o(g))]),_:1})}}});export{it as default};