import{B as a}from"./index146.js?v=20260328163632";import{l as e,$ as t,M as s,x as l,q as i}from"./utils-lib.js?v=20260328163632";import{u as o}from"./index92.js?v=20260328163632";import{i as n}from"./logs.js?v=20260328163632";import{r as u,k as p,o as d,J as r,V as m,W as c,O as g,a3 as v,Y as j,X as x,N as f}from"./base-lib.js?v=20260328163632";import{ax as y}from"./naive-ui.js?v=20260328163632";import"./__commonjsHelpers__.js?v=20260328163632";import"./env-lib.js?v=20260328163632";const _=u(""),h=u({columns:[{title:e("操作时间"),key:"date",width:180},{title:e("IP:端口"),key:"ip",width:200},{title:e("请求类型"),key:"method",minWidth:100},{title:e("URI"),key:"uri"},{title:e("浏览器标识"),key:"user-agent"}],data:[]}),w=u({count:0,limit:20,log_end:!0,maxPage:200,page:1}),[b,k]=t(h),{BtOperation:O}=o({options:[{active:!0,label:e("刷新日志"),onClick:async()=>{await U(),s.success(e("刷新日志"))}}]}),P=()=>{w.value.page=1,U()},U=(a={search:_.value,p:w.value.page,limit:w.value.limit})=>{l({loading:e("正在获取日志，请稍后..."),request:n(a),success:a=>{var e;if(Array.isArray(null==(e=a.data)?void 0:e.data)){h.value.data=a.data.data||[];const{count:e,log_end:t,maxPage:s}=a.data.page;Object.assign(w.value,{count:e,log_end:t,maxPage:s})}}})},V=()=>{C(),U()},C=()=>{_.value="",Object.assign(w.value,{page:1,itemCount:0})},q=p({__name:"index",setup:(t,{expose:s})=>(d(V),r(C),s({init:V}),(t,s)=>{const l=y;return m(),c("div",null,[g(l,{justify:"space-between"},{default:v((()=>[g(j(O),{class:"gap-10px"}),x("div",null,[g(j(i),{modelValue:j(_),"onUpdate:modelValue":s[0]||(s[0]=a=>f(_)?_.value=a:null),placeholder:j(e)("搜索日志"),class:"!w-[220px]",onSearch:j(P)},null,8,["modelValue","placeholder","onSearch"])])])),_:1}),g(j(b),{class:"py-10px"}),g(l,{justify:"end"},{default:v((()=>[g(j(a),{type:"unknown",total:j(w).count,page:j(w).page,"onUpdate:page":s[1]||(s[1]=a=>j(w).page=a),row:j(w).limit,"onUpdate:row":s[2]||(s[2]=a=>j(w).limit=a),isEnd:j(w).log_end,onChange:s[3]||(s[3]=()=>j(U)())},null,8,["total","page","row","isEnd"])])),_:1})])})});export{q as default};
