import{u as a,m as e,eN as s,d as n,X as t,c as l}from"./page_layout.js?v=1764233927359";import{p as i}from"./soft.js?v=1764233927359";import{d as o,a as r}from"./public.js?v=1764233927359";import{k as u,P as p,a0 as m,r as v,a2 as c,V as d,a3 as _,S as f,W as g,a4 as x,U as y,ak as j,j as P}from"./vue.js?v=1764233927359";import{dV as k,aC as C,da as S}from"./naive.js?v=1764233927359";const b=u({__name:"index",setup(u,{expose:b}){const{t:w}=p(),{multiService:F}=m(a()),N=v(),U=v(),V=v([]),$=()=>{U.value!==N.value?r({title:w("Public.Btn.Install"),content:w("Plugin.Ftp.index_12",[i.title,N.value]),onConfirm:()=>{h()}}):e.error(w("Plugin.Ftp.index_11"))},h=async(a=1)=>{const{message:e}=await s({sName:i.name,version:N.value,type:a,id:50,Skip:!!F.value||null});n(e)&&e.result&&t()},{loading:B,setLoading:I}=o(),L=async()=>{try{I(!0);const{message:a}=await l({sName:"pure-ftpd"===i.name?"pureftpd":i.name});n(a)&&(V.value=a.versions.map(e=>(1==e.m_version.length?N.value=a.version.split(".")[0]:N.value=a.version.split(".")[0]+"."+a.version.split(".")[1],U.value=N.value,{label:"".concat(a.name," ").concat(e.m_version),value:e.m_version})))}finally{I(!1)}};return L(),b({init:L}),(a,e)=>{const s=k,n=C,t=S;return d(),c(t,{class:"items-center"},{default:_(()=>[f("span",null,x(a.$t("Plugin.Ftp.index_9")),1),g(s,{class:"w-200px",loading:y(B),value:y(N),"onUpdate:value":e[0]||(e[0]=a=>j(N)?N.value=a:null),options:y(V)},null,8,["loading","value","options"]),g(n,{type:"primary",onClick:$},{default:_(()=>[P(x(a.$t("Site.Cert.index_61")),1)]),_:1})]),_:1})}}});export{b as _};
