import{P as a,bI as e,M as l,aC as s}from"./utils-lib.js?v=1761009159";import{r as t,c as o,q as r,H as n,v as i,N as m,B as u,e as c,z as d,I as p,y as v,Q as _,C as f,x as w,F as x,b0 as g,A as b,aC as y,G as C,ak as j,al as V}from"./base-lib.js?v=1761009159";import{B as h}from"./index115.js?v=1761009159";import{S as k,_ as q}from"./index.vue_vue_type_script_setup_true_lang7.js?v=1761009159";import{U as S,m as U,V as D,W as H}from"./validator.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./ace.js?v=1761009159";import"./column.js?v=1761009159";import"./index106.js?v=1761009159";const B=k(),F=t({}),I=t("service"),N=t(""),P=t(!1),T=t(""),z=t(""),A=t([]),G=async()=>{await a({loading:"正在保存中，请稍后...",request:e({path:"/www/server/tomcat/conf/server.xml",data:N.value,encoding:"utf-8"}),message:!0})},M=async a=>{let[e]=a.version.split(".");if(z.value!==e)try{await S({sName:"tomcat",version:z.value,min_version:""}),U()}catch(s){}else l.error("当前版本与选择版本一致")},Q=({props:{name:e}})=>{switch(e){case"config":(async()=>{await a({loading:P,request:D({path:"/www/server/tomcat/conf/server.xml"}),data:{data:[String,N]}})})();break;case"logs":(async()=>{await a({loading:P,request:H({path:"/www/wwwlogs/nginx_error.log"}),data:{msg:[String,T]}})})()}},W={class:"my-[12px]"},E={class:"flex text-secondary items-center"},J={class:"pre-box bg-[#333] text-white h-[50rem] overflow-auto p-[12px] rounded-small"},K=o({__name:"index",props:{compData:{default:{}}},setup(a){const e=a;return r(()=>{var a;a=e.compData,I.value="service",a&&(F.value=a),B.init(F.value),z.value=F.value.version[0],A.value=F.value.versions}),(a,e)=>{const l=y,t=h,o=C,r=j,k=V,S=s,U=n("bt-loading"),D=n("scroll-bottom");return i(),m(S,{modelValue:v(I),"onUpdate:modelValue":e[3]||(e[3]=a=>_(I)?I.value=a:null),type:"left-bg-card",onTabClick:v(Q)},{default:u(()=>[c(l,{label:"服务",name:"service"},{default:u(()=>[c(q)]),_:1}),c(l,{label:"配置文件",name:"config"},{default:u(()=>[e[5]||(e[5]=d("span",{class:"my-[4px] text-secondary"},"提示：Ctrl+F 搜索关键字，Ctrl+S 保存，Ctrl+H 查找替换",-1)),d("div",W,[p(c(t,{class:"!h-[36rem] !w-[full]",modelValue:v(N),"onUpdate:modelValue":e[0]||(e[0]=a=>_(N)?N.value=a:null),id:"configContent",filePath:"/www/server/tomcat/conf/server.xml"},null,8,["modelValue"]),[[U,v(P)]])]),c(o,{onClick:v(G),type:"primary"},{default:u(()=>e[4]||(e[4]=[f("保存",-1)])),_:1,__:[4]},8,["onClick"]),e[6]||(e[6]=d("ul",{class:"leading-8 mt-20px text-small list-disc ml-[20px]"},[d("li",null,"此处为tomcat主配置文件,若您不了解配置规则,请勿随意修改")],-1))]),_:1,__:[5,6]}),c(l,{label:"版本切换",name:"version"},{default:u(()=>[d("div",E,[e[8]||(e[8]=d("span",null,"选择版本",-1)),c(k,{class:"mx-[12px] !w-[18rem]",modelValue:v(z),"onUpdate:modelValue":e[1]||(e[1]=a=>_(z)?z.value=a:null)},{default:u(()=>[(i(!0),w(x,null,g(v(A),(a,e)=>(i(),m(r,{key:e,label:"tomcat"+a.m_version,value:a.m_version},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),c(o,{type:"primary",onClick:e[2]||(e[2]=e=>v(M)(a.compData))},{default:u(()=>e[7]||(e[7]=[f("切换",-1)])),_:1,__:[7]})])]),_:1}),c(l,{label:"运行日志",name:"logs"},{default:u(()=>[p((i(),w("div",J,[f(b(v(T)||"暂无日志"),1)])),[[U,v(P)],[D]])]),_:1})]),_:1},8,["modelValue","onTabClick"])}}});export{K as default};
