import{t as D,v as S,w as F,x as G,p as O,B as R,i as L,y as W,m as q,z as A,A as E}from"./index-BTglIPU2.js?v=1773287522785";import{_ as Z}from"./index-DIKmrNCq.js?v=1773287522785";import{g as J}from"./soft-Cjyfamvm.js?v=1773287522785";import{_ as K,a as Q,L as X}from"./log-update-rZODp78q.js?v=1773287522785";import{k as Y,aa as tt,a0 as et,B as ot}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{k as at,R as nt,r as f,S as t,$ as C,Z as M,a0 as a,a9 as p,_ as i,aa as n,F as st,j as T,ak as U}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 it={key:0,class:"p-30px"},lt=["src"],pt=["title"],mt={class:"font-600 mt-30px"},rt=["innerHTML"],Ht=at({__name:"app-update",props:{row:{},callback:{},hide:{}},setup(B){const{t:r}=nt(),I=D(),s=B,{row:e}=s,N=["nginx","apache","mysql","php"],V=o=>N.includes(o)||o.startsWith("php-"),w=f(),g=f(),v=f(),y=f(),c=f(),b=async(o=1)=>{var m;try{c.value!==5&&(u.data={plugin_title:e.title,plugin_name:e.name},u.show=!0);const{message:l}=await W({sName:e.name,version:c.value===5?e.m_version:g.value,upgrade:c.value===5?e.m_version:g.value,type:o},c.value===5);if(L(l)){if(l.result){q.success(l.result),I.taskCount+=1,(m=s.callback)==null||m.call(s),s.hide(),A();return}await E({name:l.name,tmp_path:l.tmp_path,title:r("Soft.index_21")},()=>{var _;(_=s.callback)==null||_.call(s)})}s.hide()}catch(l){s.hide()}},H=()=>{if(V(e.name)){d.show=!0;return}b(1)},j=()=>{b(0)},d=S(r("Home.Install.index_7"),{name:e.name,callback:j}),u=S(""),P=()=>{O({title:"".concat(e.title," - ").concat(r("Update Log")),width:600,data:{title:e.title,updateLogList:y.value},component:X})};return(async()=>{const{message:o}=await R({sName:e.name},!0);L(o)&&(c.value=o.type,g.value=e.m_version+"."+e.version,v.value=e.create_time,w.value=o.version,y.value=o.versions)})(),(o,m)=>{const l=tt,_=et,k=ot,h=Y,z=Z,$=G;return t(e)?(C(),M("div",it,[a(h,{class:"justify-between! items-center"},{default:p(()=>[a(h,{class:"items-center"},{default:p(()=>[i("img",{class:"w-40px",src:t(J)(t(e).name)},null,8,lt),i("div",null,[i("p",{class:"font-600 text-18px max-w-290px truncate pb-5px",title:"".concat(t(e).title," ").concat(t(w))},n(t(e).title)+" "+n(t(e).title.indexOf("PHP-")>-1?"":t(w)),9,pt),a(h,{class:"text-font3",size:0},{default:p(()=>[a(l,{dot:"",offset:[4,0]},{default:p(()=>[i("p",null,n(o.$t("Soft.index_51"))+": "+n(t(g)),1)]),_:1}),t(c)!==5?(C(),M(st,{key:0},[a(_,{vertical:""}),i("span",null,n(o.$t("Update time"))+": "+n(t(F)(t(v),"yyyy/MM/dd")),1),a(_,{vertical:""}),a(k,{type:"primary",text:"",onClick:P},{default:p(()=>[T(n(o.$t("Update Log")),1)]),_:1})],64)):U("",!0)]),_:1})])]),_:1}),a(h,null,{default:p(()=>[a(k,{type:"primary",onClick:H},{default:p(()=>[T(n(o.$t("Home.Update.index_19")),1)]),_:1})]),_:1}),a(_)]),_:1}),i("div",mt,n(t(r)("Soft.index_52"))+"：",1),i("span",{class:"py-10px inline-block leading-20px text-font2",innerHTML:t(e).update_msg},null,8,rt),a(z,null,{default:p(()=>[i("li",null,n(o.$t("Soft.index_35")),1),i("li",null,n(t(r)("Soft.index_53")),1),i("li",null,n(t(r)("Soft.index_54")),1)]),_:1}),a($,{show:t(d).show,"onUpdate:show":m[0]||(m[0]=x=>t(d).show=x),title:t(d).title,data:t(d).data,width:480,footer:!0,"confirm-text":o.$t("WP.TableRow.index_13"),component:K},null,8,["show","title","data","confirm-text"]),a($,{show:t(u).show,"onUpdate:show":m[1]||(m[1]=x=>t(u).show=x),title:t(u).title,data:t(u).data,width:480,component:Q},null,8,["show","title","data"])])):U("",!0)}}});export{Ht as default};
