import{P as e,bI as a,$ as l,k as s,aC as t}from"./utils-lib.js?v=1761009159";import{r as n,c as o,q as i,H as r,v as c,N as m,B as u,e as p,z as d,I as f,y as _,Q as v,C as b,x as g,F as y,b0 as x,D as C,aC as S,G as k,an as V,aS as h,ab as w,a9 as j}from"./base-lib.js?v=1761009159";import{B as L}from"./index115.js?v=1761009159";import{S as z,_ as G}from"./index.vue_vue_type_script_setup_true_lang7.js?v=1761009159";import{a1 as q,a2 as T,V as U}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 H=z(),P=n({}),I={enableGzipCompress:"为静态和动态响应启用GZIP/Brotli压缩.",gzipCompressLevel:"指定应用于动态内容的GZIP压缩级别。范围从1（最低）到9（最高）.",maxSSLConnections:"指定服务器将接受的最大并发SSL连接数<br/>\t\t\t#因为总的并发SSL和非SSL连接不能超过“Max connections”指定的限制,<br>\t\t\t#允许的并发SSL连接的实际数目必须低于此限制.",maxConnections:"指定服务器可以接受的最大并发连接数.<br/>\t\t\t#这包括纯TCP连接和SSL连接",connTimeout:"指定在处理一个请求期间允许的最大连接空闲时间（秒）.",maxKeepAliveReq:"指定可通过保持活动（持久）会话服务的最大请求数."},B=n("service"),D=n(""),M=n(!1),E=n(!1),F=n([]),N=[{content:"此处为openlitespeed主配置文件,若您不了解配置规则,请勿随意修改"}],O=async()=>{await e({loading:E,request:q(),success:e=>{F.value=[],Object.keys(e.data).forEach(a=>{F.value.push({name:a,ps:I[a],value:"enableGzipCompress"===a?"1"===e.data[a][0]:e.data[a][0]})})}})},Z=async()=>{await e({loading:"正在保存中，请稍后...",request:a({path:"/usr/local/lsws/conf/httpd_config.conf",data:D.value,encoding:"utf-8"}),message:!0})},A=async()=>{let a={};F.value.forEach(e=>{a[e.name]="enableGzipCompress"===e.name?e.value?"1":"0":e.value}),await e({loading:"正在保存中，请稍后...",request:T({array:JSON.stringify(a)}),message:!0})},J=({props:{name:a}})=>{switch(a){case"service":K();break;case"config":(async()=>{await e({loading:M,request:U({path:"/usr/local/lsws/conf/httpd_config.conf"}),data:{data:[String,D]}})})();break;case"setting":O()}},K=e=>{B.value="service",e&&(P.value=e),H.init(P.value)},Q={class:"my-[12px]"},R={class:"flex flex-col text-secondary performance"},$={class:"flex items-center"},W={key:1},X=["innerHTML"],Y=o({__name:"index",props:{compData:{default:{}}},setup(e){const a=e;return i(()=>{K(a.compData)}),(e,a)=>{const n=S,o=L,i=k,z=l,q=s,T=V,U=h,H=w,P=j,I=t,K=r("bt-loading");return c(),m(I,{modelValue:_(B),"onUpdate:modelValue":a[1]||(a[1]=e=>v(B)?B.value=e:null),type:"left-bg-card",onTabClick:_(J)},{default:u(()=>[p(n,{label:"服务",name:"service"},{default:u(()=>[p(G)]),_:1}),p(n,{label:"配置文件",name:"config"},{default:u(()=>[a[3]||(a[3]=d("span",{class:"my-[4px] text-secondary"},"提示：Ctrl+F 搜索关键字，Ctrl+S 保存，Ctrl+H 查找替换",-1)),d("div",Q,[f(p(o,{class:"!h-[36rem] !w-[50rem]",modelValue:_(D),"onUpdate:modelValue":a[0]||(a[0]=e=>v(D)?D.value=e:null),id:"configContent",filePath:"/usr/local/lsws/conf/httpd_config.conf"},null,8,["modelValue"]),[[K,_(M)]])]),p(i,{type:"primary",onClick:_(Z)},{default:u(()=>a[2]||(a[2]=[b("保存",-1)])),_:1,__:[2]},8,["onClick"]),p(z,{options:_(N),class:"ml-[20px] mt-[20px]"},null,8,["options"])]),_:1,__:[3]}),f((c(),m(n,{label:"参数设置",name:"setting"},{default:u(()=>[d("div",R,[p(P,{"label-position":"right","label-width":"186px"},{default:u(()=>[(c(!0),g(y,null,x(_(F),(e,l)=>(c(),m(H,{label:e.name,key:l},{default:u(()=>[d("div",$,["enableGzipCompress"!==e.name?(c(),m(q,{key:0,modelValue:e.value,"onUpdate:modelValue":a=>e.value=a,width:"16rem"},null,8,["modelValue","onUpdate:modelValue"])):(c(),g("div",W,[p(T,{modelValue:e.value,"onUpdate:modelValue":a=>e.value=a,class:"w-[16rem]"},null,8,["modelValue","onUpdate:modelValue"])])),"rollingSize"!=e.name?(c(),m(U,{key:2,class:"item",effect:"dark",placement:"top-start"},{content:u(()=>[d("div",{innerHTML:e.ps},null,8,X)]),default:u(()=>[a[4]||(a[4]=d("i",{class:"svgtofont-el-warning text-orange text-medium ml-[8px]"},null,-1))]),_:2,__:[4]},1024)):C("",!0)])]),_:2},1032,["label"]))),128)),p(H,{label:" "},{default:u(()=>[p(i,{type:"primary",onClick:_(O)},{default:u(()=>a[5]||(a[5]=[b("刷新",-1)])),_:1,__:[5]},8,["onClick"]),p(i,{type:"primary",onClick:_(A)},{default:u(()=>a[6]||(a[6]=[b("保存",-1)])),_:1,__:[6]},8,["onClick"])]),_:1})]),_:1})])]),_:1})),[[K,_(E)]])]),_:1},8,["modelValue","onTabClick"])}}});export{Y as default};
