import{c as a,r as s,w as t,q as e,a6 as r,v as l,x as o,e as i,B as n,C as c,z as p,y as m,n as u,G as d}from"./base-lib.js?v=1761009159";import{p as _,P as f,aK as y,b as v}from"./utils-lib.js?v=1761009159";import{clearCrontabLog as g,getCrontabLog as x}from"./site.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";const b={class:"p-[20px]"},w={class:"pre-box bg-darkPrimary mt-[12px] text-white h-[48rem] overflow-auto p-[20px]"},j=["innerHTML"],h=a({__name:"log-detail",props:{compData:{default:{}}},setup(a){const h=v(),q=a,{id:H}=q.compData,k=s("正在获取中...."),C=s(null),D=async()=>{await _({title:"提示",content:"确定清空日志吗？",icon:"warning-filled"}),f({loading:"正在清空日志，请稍后...",request:g({id:H}),message:!0,success:T})},T=async a=>{try{const s=await x({id:H});k.value=s.msg,I(),a&&h.request({status:s.status,msg:s.status?"刷新成功":"刷新失败"})}catch(s){y(s)}},I=()=>{u(()=>{const a=document.querySelector(".pre-box");a.scrollTop=a.scrollHeight})};return t(()=>q.compData,()=>{T()},{immediate:!0}),e(()=>{C.value=setInterval(async()=>{await T()},2e3)}),r(()=>{clearInterval(C.value)}),(a,s)=>{const t=d;return l(),o("div",b,[i(t,{type:"primary",onClick:s[0]||(s[0]=a=>T(!0))},{default:n(()=>s[1]||(s[1]=[c("刷新日志",-1)])),_:1,__:[1]}),i(t,{onClick:D,type:"default"},{default:n(()=>s[2]||(s[2]=[c("清空日志",-1)])),_:1,__:[2]}),p("div",w,[p("pre",{innerHTML:m(k)},null,8,j)])])}}});export{h as default};
