import{t as b,m as w,h as I,eO as t,f3 as N,i as c,z as P,B as V}from"./index-BTglIPU2.js?v=1773287522785";import{u as $}from"./useLoading-CZ2gSAW7.js?v=1773287522785";import{k as h,R as F,a6 as R,r as o,$ as j,a8 as L,a9 as m,_ as O,aa as _,a0 as f,S as i,X as T,j as z}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{a6 as D,B as G,k as M}from"./naive-ui--dJnpVcV.js?v=1773287522785";const H=h({__name:"index",setup(U,{expose:v}){const{t:a}=F(),{multiService:d}=R(b()),n=o(),l=o(),r=o([]),g=()=>{if(l.value===n.value){w.error(a("Plugin.Ftp.index_11"));return}I({title:a("Public.Btn.Install"),content:a("Plugin.Ftp.index_12",[t.title,n.value]),onConfirm:()=>{x()}})},x=async(e=1)=>{const{message:s}=await N({sName:t.name,version:n.value,type:e,id:50,Skip:d.value?!0:null});c(s)&&s.result&&P()},{loading:y,setLoading:u}=$(),p=async()=>{try{u(!0);const{message:e}=await V({sName:t.name==="pure-ftpd"?"pureftpd":t.name});c(e)&&(r.value=e.versions.map(s=>(s.m_version.length==1?n.value=e.version.split(".")[0]:n.value=e.version.split(".")[0]+"."+e.version.split(".")[1],l.value=n.value,{label:"".concat(e.name," ").concat(s.m_version),value:s.m_version})))}finally{u(!1)}};return p(),v({init:p}),(e,s)=>{const S=D,B=G,k=M;return j(),L(k,{class:"items-center"},{default:m(()=>[O("span",null,_(e.$t("Plugin.Ftp.index_9")),1),f(S,{class:"w-200px",loading:i(y),value:i(n),"onUpdate:value":s[0]||(s[0]=C=>T(n)?n.value=C:null),options:i(r)},null,8,["loading","value","options"]),f(B,{type:"primary",onClick:g},{default:m(()=>[z(_(e.$t("Site.Cert.index_61")),1)]),_:1})]),_:1})}}});export{H as _};
