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