Files
aaPanel/BTPanel/static/vite/js/php2.js
T
2026-01-22 17:59:04 +08:00

2 lines
2.5 KiB
JavaScript

import{d as e,_ as s,u as t}from"./public.js?v=1769066082311";import{_ as a}from"./index.vue_vue_type_script_setup_true_lang.js?v=1769066082311";import{x as i,d as o,m as n}from"./page_layout.js?v=1769066082311";import{g as r,aM as l}from"./site.js?v=1769066082311";import{u}from"./index252.js?v=1769066082311";import{_ as d}from"./index.vue_vue_type_script_setup_true_lang13.js?v=1769066082311";import{k as m,P as p,e as _,r as c,R as v,V as f,W as P,a3 as h,S as g,U as x,a4 as S}from"./vue.js?v=1769066082311";import{dS as j,dW as w}from"./naive.js?v=1769066082311";import"./common.js?v=1769066082311";import"./__commonjsHelpers__.js?v=1769066082311";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}),W={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=w,o=j,n=a,r=s;return f(),v("div",H,[P(n,{model:x(U),rules:W},{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};