import{c as e,_ as s,u as t}from"./public.js?v=1753954525509";import{_ as a}from"./index.vue_vue_type_script_setup_true_lang.js?v=1753954525509";import{w as i,c as n,m as o}from"./page_layout.js?v=1753954525509";import{at as r,aM as l}from"./site.js?v=1753954525509";import{u}from"./index225.js?v=1753954525509";import{_ as d}from"./index.vue_vue_type_script_setup_true_lang13.js?v=1753954525509";import{k as m,P as p,e as _,r as c,U as v,V as f,Q as P,a2 as g,W as x,X as h,a3 as j}from"./vue.js?v=1753954525509";import{cG as S,cA as w}from"./naive.js?v=1753954525509";import"./common.js?v=1753954525509";import"./__commonjsHelpers__.js?v=1753954525509";const H={class:"p-20px"},b={class:"w-200px"},y=m({__name:"php",props:{data:{}},setup(m,{expose:y}){const{t:E}=p(),$=m,{rows:M}=$.data,k=u(),q=_({version:null}),R={version:{trigger:"change",validator:()=>null!==q.version||new Error(E("Site.PHP.add_site_27"))}},U=c([]),{loading:A,setLoading:C}=e();(async()=>{try{C(!0);const{message:e}=await r();i(e)&&e.length>0?(U.value=e.map((e=>({label:e.name,value:e.version}))),q.version=e[0].version):(q.version=null,U.value=[])}finally{C(!1)}})();return y({onConfirm:async({hide:e})=>{const{message:s}=await l((()=>{const{version:e}=q;if(null===e)throw o.error(E("Site.PHP.index_67")),new Error(E("Site.PHP.index_67"));return{version:e,sites_id:M.map((e=>e.id)).join(",")}})());k.setRefresh(!0),n(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=S,n=w,o=a,r=s;return v(),f("div",H,[P(o,{model:h(q),rules:R},{default:g((()=>[P(n,{label:e.$t("Site.PHP.add_site_21"),path:"version"},{default:g((()=>[x("div",b,[P(i,{value:h(q).version,"onUpdate:value":t[0]||(t[0]=e=>h(q).version=e),loading:h(A),options:h(U)},null,8,["value","loading","options"])])])),_:1},8,["label"])])),_:1},8,["model"]),P(r,{class:"mt-8px"},{default:g((()=>[x("li",null,j(e.$t("Site.PHP.index_61")),1),x("li",null,j(e.$t("Site.PHP.index_62")),1),x("li",null,j(e.$t("Site.PHP.index_63")),1)])),_:1})])}}});export{y as default};
