import{l as a,M as e,u as l,q as s}from"./utils-lib.js?v=20260328163632";import{B as t}from"./index118.js?v=20260328163632";import{u as o}from"./index92.js?v=20260328163632";import{u as n}from"./store3.js?v=20260328163632";import{e as i,f as u}from"./logs.js?v=20260328163632";import{r,k as m,o as c,J as p,l as d,Y as v,V as g,W as f,O as j,a3 as x,H as _,U as b,N as h}from"./base-lib.js?v=20260328163632";import{au as y}from"./naive-ui.js?v=20260328163632";import"./__commonjsHelpers__.js?v=20260328163632";import"./env-lib.js?v=20260328163632";const{softTabActive:w}=n(),V=r(!1),H=r(""),L=r(""),O=r({count:0,limit:200,log_end:!0,maxPage:200,page:1}),{BtOperation:k}=o({options:[{active:!0,label:a("刷新日志"),onClick:async()=>{await B(),e.success(a("刷新成功"))}}]}),q=()=>{O.value.log_end||(O.value.page++,B(L.value+"\n"))},B=async(a="")=>{var e,l;try{""===a&&(O.value.page=1),V.value=!0;const s="mysqlErrorLog"===w.value?i:u,t=await s({p:O.value.page,limit:O.value.limit,search:H.value});-1===(null==(e=t.data)?void 0:e.status)&&(L.value=t.data.msg),(null==(l=t.data)?void 0:l.data)&&(L.value=a+t.data.data.join("\n"),O.value=t.data.page)}catch(s){}finally{V.value=!1}},P=()=>{S(),B()},S=()=>{H.value="",Object.assign(O.value,{count:0,limit:200,log_end:!0,maxPage:200,page:1})},U=m({__name:"index",setup(e,{expose:o}){const{mainHeight:n}=l();return c(P),p(S),o({init:P}),(e,l)=>{const o=y,i=b("bt-loading");return d((g(),f("div",null,[j(o,{justify:"space-between"},{default:x((()=>[j(v(k)),j(v(s),{modelValue:v(H),"onUpdate:modelValue":l[0]||(l[0]=a=>h(H)?H.value=a:null),placeholder:v(a)("请搜索日志"),class:"!w-[220px]",onSearch:l[1]||(l[1]=()=>v(B)())},null,8,["modelValue","placeholder"])])),_:1}),j(t,{class:"mt-10px",content:v(L),autoScroll:!1,onLoad:v(q),style:_("height:".concat(v(n)-240,"px"))},null,8,["content","onLoad","style"])])),[[i,v(V)]])}}});export{U as default};
