import{_ as e}from"./index.vue_vue_type_script_setup_true_lang4.js?v=1753954525509";import{_ as a}from"./index.vue_vue_type_script_setup_true_lang5.js?v=1753954525509";import{b as t,h as l,f as i}from"./public.js?v=1753954525509";import{w as s,aZ as u,X as d,T as o,e as n,cY as r,c as p,x as y}from"./page_layout.js?v=1753954525509";import{f as _}from"./site3.js?v=1753954525509";import{b as c,s as m}from"./tools2.js?v=1753954525509";import{k as v,P as f,r as x,ac as b,y as g,U as h,V as M,Q as S,a2 as k,F as j,O as w,j as W,a3 as z,X as L,ah as U,e as P,ax as D,W as N}from"./vue.js?v=1753954525509";import{cJ as C,cE as R}from"./naive.js?v=1753954525509";import{m as T}from"./common.js?v=1753954525509";import"./index.vue_vue_type_script_setup_true_lang7.js?v=1753954525509";import"./rules.js?v=1753954525509";import"./__commonjsHelpers__.js?v=1753954525509";const X={class:"flex"},Y=n(v({__name:"date",props:{value:{default:"today"},valueModifiers:{}},emits:["update:value"],setup(e){const{t:a}=f(),t=x("today"),l=x(null),i=b(e,"value"),n=[{label:a("Public.Search.Today"),value:"today"},{label:a("Public.Search.Yesterday"),value:"yesterday"},{label:a("Public.Search.Last7"),value:"l7"},{label:a("Public.Search.Last30"),value:"l30"}],r=e=>{l.value=null,i.value=e},p=e=>{t.value=e?"":"today",i.value=u(e)?d(e,"yyyy-MM-dd"):"today"};return g((()=>{s(i.value)?(t.value="",l.value=i.value):(t.value=i.value,l.value=null)})),(e,a)=>{const i=C,s=R,u=o;return h(),M("div",X,[S(s,{value:L(t),"onUpdate:value":[a[0]||(a[0]=e=>U(t)?t.value=e:null),r],size:"small",class:"bt-radio"},{default:k((()=>[(h(),M(j,null,w(n,(e=>S(i,{key:e.value,value:e.value},{default:k((()=>[W(z(e.label),1)])),_:2},1032,["value"]))),64))])),_:1},8,["value"]),S(u,{value:L(l),"onUpdate:value":[a[1]||(a[1]=e=>U(l)?l.value=e:null),p],type:"daterange",size:"small",class:"bt-date-picker w-214px",clearable:!0},null,8,["value"])])}}}),[["__scopeId","data-v-9d115305"]]),E={class:"p-20px"},F=v({__name:"record",props:{siteName:{default:""},timeList:{default:()=>[]}},setup(u){const o=u,{t:n}=f(),{table:v,columns:x,setLoading:b}=t([{key:"time_localtime",title:n("Waf.Site.index_26"),width:140,render:e=>d(e.time_localtime)},{key:"ip",title:n("Waf.Site.index_27"),width:120,ellipsis:{tooltip:!0}},{key:"type",title:n("Waf.Site.index_15"),width:70,ellipsis:{tooltip:!0}},{key:"uri",title:n("Waf.Site.index_28"),ellipsis:{tooltip:{contentStyle:{maxWidth:"500px"}}},render:e=>r(e.uri)},{key:"status",title:n("Waf.Site.index_12"),width:90,render:()=>n("Waf.Site.index_29")},{key:"ip_country",title:n("Waf.Site.index_30"),width:140,ellipsis:{tooltip:!0},render:e=>e.ip_country===n("Waf.Site.index_31")?e.ip_country:(e=>e.ip_country)(e)},{key:"filter_rule",title:n("Waf.Site.index_32"),width:120,ellipsis:{tooltip:!0}},l({width:140,options:e=>[{label:n("Waf.Site.index_33"),onClick:()=>{c(e,!1)}},{label:n("Waf.Site.index_34"),onClick:()=>{m(e)}}]})]),g=P({p:1,limit:15,date:"today",ip:"",serach_url:"",user_agent:""});let j=!0;const w=()=>{if(j)return j=!1,{start_time:o.timeList[0]};const{date:e}=g,a=new Date;let t="",l="";switch(e){case"today":t=d(a,"yyyy-MM-dd");break;case"yesterday":t=d(T(a,-1),"yyyy-MM-dd");break;case"l7":t=d(T(a,-7),"yyyy-MM-dd"),l=d(a,"yyyy-MM-dd");break;case"l30":t=d(T(a,-30),"yyyy-MM-dd"),l=d(a,"yyyy-MM-dd")}return s(e)&&(t=d(new Date(e[0]),"yyyy-MM-dd"),l=d(new Date(e[1]),"yyyy-MM-dd")),{start_time:t,...l?{end_time:l}:{}}},W=async()=>{try{b(!0);const{message:e}=await _({siteName:o.siteName,p:g.p,limit:g.limit,...w()});p(e)&&(v.data=s(e.data)?e.data:[],v.total=y(e.page))}finally{b(!1)}},U=()=>{g.p=1,W()};return W(),(t,l)=>{const s=i,u=a,d=e;return h(),M("div",E,[S(d,null,D({toolsLeft:k((()=>[N("span",null,z(t.$t("Waf.Site.index_17")),1),S(Y,{value:L(g).date,"onUpdate:value":[l[0]||(l[0]=e=>L(g).date=e),U]},null,8,["value"])])),table:k((()=>[S(s,{loading:L(v).loading,"max-height":420,data:L(v).data,columns:L(x)},null,8,["loading","data","columns"])])),pageRight:k((()=>[S(u,{page:L(g).p,"onUpdate:page":l[4]||(l[4]=e=>L(g).p=e),"page-size":L(g).limit,"onUpdate:pageSize":l[5]||(l[5]=e=>L(g).limit=e),"item-count":L(v).total,"page-sizes":[10,15],onRefresh:W},null,8,["page","page-size","item-count"])])),_:2},[void 0]),1024)])}}});export{F as default};
