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