import{l as s,dd as t,de as a,aX as e,M as o}from"./utils-lib.js?v=20260328163632";import{B as r}from"./index118.js?v=20260328163632";import{k as l,r as i,b as c,o as m,V as n,W as u,O as p,Y as d}from"./base-lib.js?v=20260328163632";import"./naive-ui.js?v=20260328163632";import"./__commonjsHelpers__.js?v=20260328163632";import"./env-lib.js?v=20260328163632";const g={class:"p-2rem flex flex-col"},f=l({__name:"index",props:{compData:{default:()=>({type:"repair",logFile:""})}},setup(l){const f=l,b=i("");let j;const y=async()=>{try{j&&clearTimeout(j);const{logFile:r,type:l}=f.compData;if(r){const a=await t({path:r,orderby:!0});b.value=a.data.data.join("\n"),v(b.value.includes("Successfully"),{msg:s("repair"===l?"修复成功":"更新成功"),status:!0})}else{const{data:t}=await a();t.status||e(t.data)?(b.value=e(t.data)?t.data:t.msg||s("暂无日志"),v(e(t.data),t)):o.error(t.msg)}}catch(r){j&&clearTimeout(j),j=setTimeout((()=>{y()}),2e3)}},v=(t,a)=>{t?(o.msg({customClass:"bt-message-error-html",isHtml:!0,message:a.msg+"".concat(a.status?"<br>"+s("请按 Ctrl+F5 刷新缓存，或等待5s自动刷新！"):""),type:a.status?"success":"error",showClose:!a.status,duration:a.status?5e3:0}),a.status&&setTimeout((()=>{localStorage.clear(),sessionStorage.clear(),window.location.reload()}),5e3)):j=setTimeout((()=>{y()}),2e3)};return c((()=>{j&&clearInterval(j)})),m((()=>{y()})),(t,a)=>(n(),u("div",g,[p(r,{title:d(s)("全屏查看【{0}】日志",["repair"===t.compData.type?d(s)("修复"):d(s)("更新")]),content:d(b),isHtml:!0,class:"!h-410px"},null,8,["title","content"])]))}});export{f as default};
