import{d as e,_ as s,u as t}from"./public.js?v=1763625242172";import{_ as a}from"./index.vue_vue_type_script_setup_true_lang.js?v=1763625242172";import{x as i,c as o,m as n}from"./page_layout.js?v=1763625242172";import{g as r,aM as l}from"./site.js?v=1763625242172";import{u}from"./index238.js?v=1763625242172";import{_ as d}from"./index.vue_vue_type_script_setup_true_lang14.js?v=1763625242172";import{k as m,P as p,e as _,r as c,R as v,S as f,X as P,a3 as h,U as g,V as x,a4 as S}from"./vue.js?v=1763625242172";import{dV as j,dP as w}from"./naive.js?v=1763625242172";import"./common.js?v=1763625242172";import"./__commonjsHelpers__.js?v=1763625242172";const H={class:"p-20px"},y={class:"w-200px"},b=m({__name:"php",props:{rows:{},showStatic:{type:Boolean,default:!0},refresh:{}},setup(m,{expose:b}){const{t:E}=p(),$=m,{rows:M,showStatic:R,refresh:k}=$,q=u(),U=_({version:null}),V={version:{trigger:"change",validator:()=>null!==U.version||new Error(E("Site.PHP.add_site_27"))}},B=c([]),{loading:C,setLoading:L}=e();(async()=>{try{L(!0);const{message:e}=await r();if(i(e)&&e.length>0){const s=R?e:e.filter((e=>"00"!==e.version));B.value=s.map((e=>({label:e.name,value:e.version}))),U.version=s[0].version}else U.version=null,B.value=[]}finally{L(!1)}})();return b({onConfirm:async({hide:e})=>{const{message:s}=await l((()=>{const{version:e}=U;if(null===e)throw n.error(E("Site.PHP.index_67")),new Error(E("Site.PHP.index_67"));return{version:e,sites_id:M.map((e=>e.id)).join(",")}})());q.setRefresh(!0),null==k||k(),o(s)&&(e=>{const{success:s,error:a}=e,i=[];s.forEach((e=>{const s=M.find((s=>s.name===e));s&&i.push({name:s.name,batchStatus:"success",reqMsg:E("Site.PHP.index_64")})})),Object.entries(a).forEach((([e,s])=>{const t=M.find((s=>s.name===e));t&&i.push({name:t.name,batchStatus:"error",reqMsg:s})})),t({title:E("Site.PHP.index_65"),width:440,footer:!0,component:d,data:{title:E("Site.PHP.index_66"),data:i,status:"done",columns:[{key:"name",title:E("Site.TableRow.index_1"),ellipsis:{tooltip:{width:"trigger"}}}]}})})(s),e()}}),(e,t)=>{const i=j,o=w,n=a,r=s;return v(),f("div",H,[P(n,{model:x(U),rules:V},{default:h((()=>[P(o,{label:e.$t("Site.PHP.add_site_21"),path:"version"},{default:h((()=>[g("div",y,[P(i,{value:x(U).version,"onUpdate:value":t[0]||(t[0]=e=>x(U).version=e),loading:x(C),options:x(B)},null,8,["value","loading","options"])])])),_:1},8,["label"])])),_:1},8,["model"]),P(r,{class:"mt-8px"},{default:h((()=>[g("li",null,S(e.$t("Site.PHP.index_61")),1),g("li",null,S(e.$t("Site.PHP.index_62")),1),g("li",null,S(e.$t("Site.PHP.index_63")),1)])),_:1})])}}});export{b as default};
