import{_ as e}from"./index.vue_vue_type_script_setup_true_lang5.js?v=1763625242172";import{_ as a}from"./index.vue_vue_type_script_setup_true_lang7.js?v=1763625242172";import{c as t,f as l,h as i}from"./public.js?v=1763625242172";import{x as s,bj as d,a9 as u,a6 as o,p as n,dL as r,c as p,y}from"./page_layout.js?v=1763625242172";import{f as _}from"./site3.js?v=1763625242172";import{b as m,s as c}from"./tools2.js?v=1763625242172";import{k as v,P as f,r as x,ae as b,y as g,R as h,S as M,X as S,a3 as j,F as k,O as w,j as W,a4 as L,V as z,aj as U,e as P,ay as D,U as N}from"./vue.js?v=1763625242172";import{dZ as R,dT as C}from"./naive.js?v=1763625242172";import{m as T}from"./common.js?v=1763625242172";import"./index.vue_vue_type_script_setup_true_lang6.js?v=1763625242172";import"./rules.js?v=1763625242172";import"./__commonjsHelpers__.js?v=1763625242172";const F={class:"flex"},H=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=d(e)?u(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=R,s=C,d=o;return h(),M("div",F,[S(s,{value:z(t),"onUpdate:value":[a[0]||(a[0]=e=>U(t)?t.value=e:null),r],size:"small",class:"bt-radio"},{default:j((()=>[(h(),M(k,null,w(n,(e=>S(i,{key:e.value,value:e.value},{default:j((()=>[W(L(e.label),1)])),_:2},1032,["value"]))),64))])),_:1},8,["value"]),S(d,{value:z(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"]]),I={class:"p-20px"},O=v({__name:"record",props:{siteName:{default:""},timeList:{default:()=>[]}},setup(d){const o=d,{t:n}=f(),{table:v,columns:x,setLoading:b}=t([{key:"time_localtime",title:n("Waf.Site.index_26"),width:140,render:e=>u(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:()=>{m(e,!1)}},{label:n("Waf.Site.index_34"),onClick:()=>{c(e)}}]})]),g=P({p:1,limit:15,date:"today",ip:"",serach_url:"",user_agent:""});let k=!0;const w=()=>{if(k)return k=!1,{start_time:o.timeList[0]};const{date:e}=g,a=new Date;let t="",l="";switch(e){case"today":t=u(a,"yyyy-MM-dd");break;case"yesterday":t=u(T(a,-1),"yyyy-MM-dd");break;case"l7":t=u(T(a,-7),"yyyy-MM-dd"),l=u(a,"yyyy-MM-dd");break;case"l30":t=u(T(a,-30),"yyyy-MM-dd"),l=u(a,"yyyy-MM-dd")}return s(e)&&(t=u(new Date(e[0]),"yyyy-MM-dd"),l=u(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,d=a,u=e;return h(),M("div",I,[S(u,null,D({toolsLeft:j((()=>[N("span",null,L(t.$t("Waf.Site.index_17")),1),S(H,{value:z(g).date,"onUpdate:value":[l[0]||(l[0]=e=>z(g).date=e),U]},null,8,["value"])])),table:j((()=>[S(s,{loading:z(v).loading,"max-height":420,data:z(v).data,columns:z(x)},null,8,["loading","data","columns"])])),pageRight:j((()=>[S(d,{page:z(g).p,"onUpdate:page":l[4]||(l[4]=e=>z(g).p=e),"page-size":z(g).limit,"onUpdate:pageSize":l[5]||(l[5]=e=>z(g).limit=e),"item-count":z(v).total,"page-sizes":[10,15],onRefresh:W},null,8,["page","page-size","item-count"])])),_:2},[void 0]),1024)])}}});export{O as default};
