import{e as l,P as e,aC as a,b as s,$ as n}from"./utils-lib.js?v=1761009159";import{B as o}from"./index115.js?v=1761009159";import{c as t,r,e as i,C as u,F as m,q as d,H as p,v as c,x as g,y as v,Q as f,z as x,B as j,I as y,N as L,D as b,G as _}from"./base-lib.js?v=1761009159";import{u as C,S as V}from"./useStore4.js?v=1761009159";import{getSiteAccessLogs as z,getSiteErrorLog as N,getProjectLog as h,getSetupLog as k}from"./site.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./ace.js?v=1761009159";const q={class:"h-full"},B={class:"mt-1rem"},E=t({__name:"index",setup(t){const E=s(),{siteInfo:S}=C(),{jumpTabEvent:w}=V(),H=r(!1),I=r("nginxLogs"),O=r(""),U=r([{label:"Nginx日志",name:"nginxLogs",lazy:!0,render:()=>i("span",null,null)},{label:"Nginx错误日志",name:"nginxErrorLogs",lazy:!0,render:()=>i("span",null,null)},{label:"项目日志",name:"projectLogs",lazy:!0,render:()=>i("span",null,null)},{label:"依赖安装日志",name:"installLogs",lazy:!0,render:()=>i("span",null,null)}]),D=[{content:i(m,null,[i("div",{class:"flex items-center"},[u("若依赖安装出现问题，可以前往 "),i(l,{onClick:()=>w("composer")},{default:()=>[u("Composer")]}),u(" 自定义安装")])])}],F=async(l=!1)=>{const{name:a}=S.value,s=new Map([["nginxLogs",z],["nginxErrorLogs",N],["projectLogs",h],["installLogs",k]]).get(I.value),n={projectLogs:{sitename:a},installLogs:{sitename:a,type:"install"},default:{siteName:a}},o=n[I.value]||n.default;s&&e({loading:H,request:s(o),success:e=>{var a,s;O.value=(null==(a=null==e?void 0:e.data)?void 0:a.data)||(null==(s=null==e?void 0:e.data)?void 0:s.msg)||e.msg,l&&E.success("刷新成功")}})},G=l=>{I.value=l,F()};return d(()=>F()),(l,e)=>{const s=a,t=_,r=o,m=n,d=p("bt-loading");return c(),g("div",null,[i(s,{type:"card",modelValue:v(I),"onUpdate:modelValue":e[0]||(e[0]=l=>f(I)?I.value=l:null),options:v(U),onChange:G},null,8,["modelValue","options"]),x("div",q,[i(t,{type:"primary",onClick:e[1]||(e[1]=l=>F(!0))},{default:j(()=>e[3]||(e[3]=[u("刷新日志",-1)])),_:1,__:[3]}),x("div",B,[y(i(r,{class:"!h-[40rem] !w-full",modelValue:v(O),"onUpdate:modelValue":e[2]||(e[2]=l=>f(O)?O.value=l:null),id:"configContent",request:!1,isScrollBottom:!0,editorOption:{readOnly:!0,mode:"ace/mode/text"}},null,8,["modelValue"]),[[d,v(H)]])]),"installLogs"===v(I)?(c(),L(m,{key:0,class:"px-2rem",options:D})):b("",!0)])])}}});export{E as default};
