import{c as a,r as e,o as s,q as t,H as l,I as o,y as i,v as c,x as u,e as n,B as r,C as _,U as d,ae as m,ab as p,G as f,a9 as v}from"./base-lib.js?v=1761009159";import{aK as L,P as S,$ as T}from"./utils-lib.js?v=1761009159";import{getSslProtocol as h,setSslProtocol as k}from"./site.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";const y={class:"p-[20px]"},b=a({__name:"tls-setting",setup(a){const b=e(),g=s({checkList:["选中且禁用"]}),j=e(!1),x=e([{content:"请注意，TLS 1.0和1.1版本存在安全风险。如果您的应用程序不会出现兼容性问题，请不要勾选此选项。"},{content:"修改后只会对后续部署证书的站点进行设置，已部署证书的站点不会因此改变"},{content:"仅支持PHP项目"}]),q={checkList:[{required:!0,message:"请选择TLS设置",trigger:"change"}]},w=async()=>{j.value=!0;try{const{data:a}=await h();let e=[];for(let s in a)a[s]&&e.push(s);g.checkList=e}catch(a){L(a)}finally{j.value=!1}},H=async()=>{await b.value.validate();(await S({loading:"正在设置，请稍后...",request:k({use_protocols:g.checkList.join(",")}),message:!0})).status&&w()};return t(()=>{w()}),(a,e)=>{const s=d,t=m,L=p,S=f,h=T,k=v,w=l("bt-loading");return o((c(),u("div",y,[n(k,{ref_key:"formRef",ref:b,model:i(g),rules:q,"label-position":"left"},{default:r(()=>[n(L,{label:"TLS设置",prop:"checkList"},{default:r(()=>[n(t,{modelValue:i(g).checkList,"onUpdate:modelValue":e[0]||(e[0]=a=>i(g).checkList=a)},{default:r(()=>[n(s,{value:"TLSv1"},{default:r(()=>e[1]||(e[1]=[_("TLSv1",-1)])),_:1,__:[1]}),n(s,{value:"TLSv1.1"},{default:r(()=>e[2]||(e[2]=[_("TLSv1.1",-1)])),_:1,__:[2]}),n(s,{value:"TLSv1.2"},{default:r(()=>e[3]||(e[3]=[_("TLSv1.2",-1)])),_:1,__:[3]}),n(s,{value:"TLSv1.3"},{default:r(()=>e[4]||(e[4]=[_("TLSv1.3",-1)])),_:1,__:[4]})]),_:1},8,["modelValue"])]),_:1}),n(L,{label:" "},{default:r(()=>[n(S,{type:"primary",onClick:H},{default:r(()=>e[5]||(e[5]=[_("保存",-1)])),_:1,__:[5]})]),_:1}),n(h,{class:"ml-[20px] my-[20px]",options:i(x)},null,8,["options"])]),_:1},8,["model"])])),[[w,i(j)]])}}});export{b as default};
