import{B as a}from"./index118.js?v=20260328163632";import{x as e,a0 as l,l as s,M as t,u as n,q as o,_ as u}from"./utils-lib.js?v=20260328163632";import{j as i}from"./logs.js?v=20260328163632";import{r as c,k as d,o as r,J as p,V as m,W as v,X as g,O as x,Y as f,N as h,H as y,F as _,L as b,a3 as j,K as k,Z as w,j as V}from"./base-lib.js?v=20260328163632";import{aw as S,au as C,B as q}from"./naive-ui.js?v=20260328163632";import"./__commonjsHelpers__.js?v=20260328163632";import"./env-lib.js?v=20260328163632";const H=c(""),L=c(""),A=c([]),B=c(""),N=c(""),O=c({count:0,limit:200,log_end:!0,maxPage:200,page:1}),P=async()=>{await e({request:l({table:"crontab",search:H.value,limit:999999}),success:a=>{var e;A.value=Array.isArray(null==(e=a.data)?void 0:e.data)?a.data.data:[]}})},U=a=>{L.value="",B.value=a.id.toString(),N.value="",I()},F=async()=>{await I(),t.success(s("刷新成功"))},I=async(a="")=>{if(!A.value.length)return;""===a&&(O.value.page=1);const{page:l,limit:t}=O.value;e({loading:s("正在获取日志，请稍后..."),request:i({id:Number(B.value),p:l,limit:t,search:L.value}),success:e=>{const{data:l,page:s}=e.data;N.value=a+l.join("\n"),O.value=s}})},J=()=>{O.value.log_end||(O.value.page++,I(N.value+"\n"))},K=async()=>{M(),await P(),A.value.length&&U(A.value[0])},M=()=>{H.value="",B.value="",L.value="",N.value="",Object.assign(O.value,{count:0,limit:200,log_end:!0,maxPage:200,page:1})},W={class:"flex"},X={class:"w-240px"},Y=["onClick","tabindex"],Z={key:1,class:"menu p-[20px] bg-[#f1f1f120] !h-[90%]"},z={class:"flex-1 pl-16px"},D=u(d({__name:"index",setup(e,{expose:l}){const{mainHeight:t}=n();return r(K),p(M),l({init:K}),(e,l)=>{const n=S,u=q,i=C;return m(),v("div",W,[g("div",X,[x(f(o),{modelValue:f(H),"onUpdate:modelValue":l[0]||(l[0]=a=>h(H)?H.value=a:null),placeholder:f(s)("请搜索计划任务"),class:"!w-full mb-8px",onSearch:f(P)},null,8,["modelValue","placeholder","onSearch"]),f(A).length>0?(m(),v("div",{key:0,class:"menu",style:y("height:".concat(f(t)-240,"px"))},[(m(!0),v(_,null,b(f(A),((a,e)=>(m(),v("span",{onClick:e=>f(U)(a),tabindex:e,key:e,class:k("menu-hover ".concat(String(a.id)===f(B)?"activeClass":""))},w(a.name),11,Y)))),128))],4)):(m(),v("span",Z,[x(n,null,{icon:j((()=>l[3]||(l[3]=[g("i",{class:"svgtofont-empty !text-[4.8rem] text-#999"},null,-1)]))),default:j((()=>[V(w(f(s)("暂无数据")),1)])),_:1})]))]),g("div",z,[x(i,{justify:"space-between"},{default:j((()=>[x(u,{type:"default",onClick:f(F)},{default:j((()=>[V(w(f(s)("刷新日志")),1)])),_:1},8,["onClick"]),x(f(o),{modelValue:f(L),"onUpdate:modelValue":l[1]||(l[1]=a=>h(L)?L.value=a:null),placeholder:f(s)("请搜索日志"),class:"!w-[220px]",onSearch:l[2]||(l[2]=()=>f(I)())},null,8,["modelValue","placeholder"])])),_:1}),x(a,{class:"mt-10px",content:f(N),autoScroll:!1,onLoad:f(J),style:y("height:".concat(f(t)-240,"px"))},null,8,["content","onLoad","style"])])])}}}),[["__scopeId","data-v-d699b089"]]);export{D as default};
