import{t as G,v as M,w as O,x as W,y as q,i as T,m as A,z as E,A as X,p as Z,B as F}from"./index-BTglIPU2.js?v=1773287522785";import{_ as J}from"./index-DIKmrNCq.js?v=1773287522785";import{g as K}from"./soft-Cjyfamvm.js?v=1773287522785";import{_ as Q,a as Y,L as tt}from"./log-update-rZODp78q.js?v=1773287522785";import{k as et,a0 as at,B as nt,a6 as ot}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{k as st,R as lt,r,S as a,$ as k,Z as it,a0 as l,a9 as m,_ as p,L as pt,aa as i,a8 as B,j as b,ak as L,X as mt}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-DgjjuUjT.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-B7YvCBmY.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-BeO8Hyma.js?v=1773287522785";import"./data-BVsViUMm.js?v=1773287522785";import"./useTableData-BmkIKQ_R.js?v=1773287522785";import"./useTableColumns-DDeyYvje.js?v=1773287522785";import"./index-S15tYq5l.js?v=1773287522785";import"./copy-D-wIKr0q.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-DeTfbeeM.js?v=1773287522785";import"./index-Cg6fMjw6.js?v=1773287522785";import"./useLoading-CZ2gSAW7.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import"./index-Cy3Gp9Hk.js?v=1773287522785";import"./theme-monokai-Bqt0uTuQ.js?v=1773287522785";import"./ace-CNnfDSio.js?v=1773287522785";import"./file-B5PwfK2h.js?v=1773287522785";const ut={key:0,class:"p-30px"},rt=["src"],ct=["title"],dt={class:"font-600 mt-30px"},_t=["innerHTML"],Rt=st({__name:"index",props:{name:{},callback:{},hide:{}},setup(U){const{t:w}=lt(),V=G(),s=U,H=["nginx","apache","mysql","php"],x=t=>H.includes(t)||t.startsWith("php-"),u=r(),y=r(""),$=r(),S=r(),f=r(),N=(t,e)=>{y.value=e.ps,$.value=e.time},g=r(5),n=r(),C=async(t=1)=>{var e;try{if(n.value){g.value!==5&&(c.data={plugin_title:n.value.title,plugin_name:n.value.name},c.show=!0);const{message:o}=await q({sName:n.value.name,version:u.value,type:t},g.value===5);if(T(o)){if(o.result){A.success(o.result),V.taskCount+=1,(e=s.callback)==null||e.call(s),s.hide(),E();return}await X({name:o.name,tmp_path:o.tmp_path,title:w("Soft.index_21")},()=>{var d;(d=s.callback)==null||d.call(s)})}s.hide()}}catch(o){s.hide()}},P=()=>{v.show=!0},j=()=>{C(0)},v=M(w("Home.Install.index_7"),{name:s.name,callback:j}),c=M(""),z=()=>{var t,e;Z({title:"".concat((t=n.value)==null?void 0:t.title," - ").concat(w("Update Log")),width:600,data:{title:(e=n.value)==null?void 0:e.title,updateLogList:S.value},component:tt})};return(async()=>{const{message:t}=await F({sName:s.name},!0);T(t)&&(n.value=t,f.value=t.versions.map(e=>{const o=e.m_version+"."+e.version;return{label:t.type===5?e.m_version:o||e.m_version,value:t.type===5?e.m_version:o||e.m_version,ps:e.update_msg,time:e.create_time}}),u.value=f.value[0].value,y.value=f.value[0].ps,$.value=f.value[0].time,g.value=t.type,S.value=t.versions)})(),(t,e)=>{const o=at,d=nt,h=et,R=ot,D=J,I=W;return a(n)?(k(),it("div",ut,[l(h,{class:"justify-between! items-center"},{default:m(()=>[l(h,{class:"items-center"},{default:m(()=>[p("img",{class:"w-40px",src:a(K)(a(n).name)},null,8,rt),p("div",null,[p("p",{class:pt(["font-600 text-18px max-w-290px pb-5px",{"max-w-190px!":x(a(n).name)}]),title:"".concat(a(n).title," ").concat(a(u))},i(a(n).title)+" "+i(a(n).title.indexOf("PHP-")>-1?"":a(u)),11,ct),a(g)!==5?(k(),B(h,{key:0,class:"text-font3",size:0},{default:m(()=>[p("span",null,i(t.$t("Update time"))+": "+i(a(O)(a($),"yyyy/MM/dd")),1),l(o,{vertical:""}),l(d,{type:"primary",text:"",onClick:z},{default:m(()=>[b(i(t.$t("Update Log")),1)]),_:1})]),_:1})):L("",!0)])]),_:1}),l(h,null,{default:m(()=>[l(R,{class:"w-100px!",value:a(u),"onUpdate:value":[e[0]||(e[0]=_=>mt(u)?u.value=_:null),N],options:a(f),"consistent-menu-width":!1},null,8,["value","options"]),x(a(n).name)?(k(),B(d,{key:0,onClick:P},{default:m(()=>[b(i(t.$t("Home.Install.index_7")),1)]),_:1})):L("",!0),l(d,{type:"primary",onClick:e[1]||(e[1]=_=>C(1))},{default:m(()=>[b(i(x(a(n).name)?t.$t("Home.Install.index_5"):t.$t("Soft.index_34")),1)]),_:1})]),_:1}),l(o)]),_:1}),p("div",dt,i(t.$t("Soft.index_39"))+"：",1),p("span",{class:"py-10px inline-block leading-20px text-font2",innerHTML:a(y)},null,8,_t),l(D,null,{default:m(()=>[p("li",null,i(t.$t("Soft.index_35")),1),p("li",null,i(t.$t("Soft.index_36")),1),p("li",null,i(t.$t("Soft.index_37")),1)]),_:1}),l(I,{show:a(v).show,"onUpdate:show":e[2]||(e[2]=_=>a(v).show=_),title:a(v).title,data:a(v).data,width:480,footer:!0,"confirm-text":t.$t("WP.TableRow.index_13"),component:Q},null,8,["show","title","data","confirm-text"]),l(I,{show:a(c).show,"onUpdate:show":e[3]||(e[3]=_=>a(c).show=_),title:a(c).title,data:a(c).data,width:480,component:Y},null,8,["show","title","data"])])):L("",!0)}}});export{Rt as default};
