2 lines
8.5 KiB
JavaScript
2 lines
8.5 KiB
JavaScript
import{_ as R}from"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import{_ as oe}from"./index.vue_vue_type_script_setup_true_lang-BeO8Hyma.js?v=1773287522785";import{_ as L}from"./index-DIKmrNCq.js?v=1773287522785";import{f2 as se,t as j,l as ae,m as le,f3 as ie,z as ue,c as W,h as M,aw as re,_ as pe,p as z,i as ce}from"./index-BTglIPU2.js?v=1773287522785";import{k as B,e as F,r as C,$ as V,Z as H,a0 as t,a9 as s,S as n,_ as l,aa as u,a6 as q,R as G,o as _e,n as de,b as me,j as y,X as fe,c as D,w as ve,ab as ge,a8 as be,F as xe,ak as we}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{u as Se}from"./useLoading-CZ2gSAW7.js?v=1773287522785";import{u as he}from"./useTableData-BmkIKQ_R.js?v=1773287522785";import{u as $e}from"./useTableColumns-DDeyYvje.js?v=1773287522785";import{l as ye,m as E,n as Pe}from"./php-D3q5Oj7O.js?v=1773287522785";import{a1 as X,a6 as U,k as Z,e as ke,a4 as Ce,a3 as Ve,a8 as Ne,a0 as Ie,a9 as Le}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{u as Be}from"./index-Cg6fMjw6.js?v=1773287522785";import{L as He}from"./leader-line-vue-C5rdSrUw.js?v=1773287522785";const Ue={class:"p-16px"},Oe=B({__name:"server-select",props:{callBack:{type:Function,default:()=>{}}},setup(N,{expose:w}){const i=N,f=F({webServer:"nginx"}),S=C([{label:"Nginx",value:"nginx"},{label:"Apache",value:"apache"},{label:"Openlitespeed",value:"openlitespeed"}]);return w({onConfirm:async()=>{await se({status:"disable",reserve:f.webServer}),i.callBack()}}),(_,o)=>{const c=U,b=X,g=R,k=L;return V(),H("div",Ue,[t(g,{class:"my-16px",model:n(f)},{default:s(()=>[t(b,{label:_.$t("Soft.Plugin.index_8")},{default:s(()=>[t(c,{class:"w-300px!",value:n(f).webServer,"onUpdate:value":o[0]||(o[0]=a=>n(f).webServer=a),options:n(S)},null,8,["value","options"])]),_:1},8,["label"])]),_:1},8,["model"]),t(k,null,{default:s(()=>[l("li",null,u(_.$t("Soft.Plugin.index_18")),1)]),_:1})])}}}),Ae={class:"p-16px"},Te={class:"border-view mb-20px",id:"nginx-select"},Me={class:"border-view",id:"proxy-select"},ze={class:"flex items-center my-20px"},De={class:"mr-10px"},Ee={class:"w-280px"},Re={class:"w-280px"},je=B({__name:"version-select",setup(N,{expose:w}){const i=Be(),{webserver:f}=q(i),{t:S}=G(),P=j(),_=C(1),o=C([{name:"Nginx",icon:"nginx",value:"1.24",version:[{label:"Nginx 1.24",value:"1.24"},{label:"Nginx 1.25",value:"1.25"},{label:"Nginx 1.26",value:"1.26"},{label:"Nginx 1.27",value:"1.27"},{label:"Nginx 1.28",value:"1.28"},{label:"Nginx 1.29",value:"1.29"}],disabled:!1},{name:"Apache",icon:"apache",value:"2.4",version:[{label:"Apache 2.4",value:"2.4"}],disabled:!1},{name:"Openlitespeed",icon:"openlitespeed",value:"1.8",version:[{label:"Openlitespeed 1.8",value:"1.8"}],disabled:!1}]);let c=null;const b=()=>{const a=document.getElementById("nginx-select"),r=document.getElementById("proxy-select");if(!a||!r){console.warn("Elements not found, will retry on mounted");return}c=He.setLine(a,r,{color:"var(--color-border)",size:2,path:"grid",startSocket:"right",endSocket:"right"})},g=()=>{o.value.forEach(a=>{a.icon===f.value&&(a.disabled=!0)})};return _e(async()=>{await i.getPHPConfig(),await de(),g(),setTimeout(()=>{b()},500)}),me(()=>{c&&c.remove()}),w({onConfirm:async()=>{const a=le.loading(S("Home.Install.index_13"));try{const r=o.value.filter(d=>d.disabled);for(const d of o.value)r.includes(d)||await ie({sName:d.icon,version:d.value,type:_.value,id:50,Skip:!0});await ue(),P.getConfigSimple()}finally{a.close()}}}),(a,r)=>{const d=ae,h=U,x=Z,$=Ce,v=ke,e=Ve,p=L;return V(),H("div",Ae,[l("div",Te,[t(x,{class:"flex-nowrap! items-center"},{default:s(()=>[t(d,{name:"soft-".concat(n(o)[0].icon),size:"32"},null,8,["name"]),t(h,{value:n(o)[0].value,"onUpdate:value":r[0]||(r[0]=m=>n(o)[0].value=m),options:n(o)[0].version,disabled:n(o)[0].disabled},null,8,["value","options","disabled"])]),_:1})]),l("div",Me,[t(x,{class:"flex-nowrap! items-center"},{default:s(()=>[t(d,{name:"soft-".concat(n(o)[1].icon),size:"32"},null,8,["name"]),t(h,{value:n(o)[1].value,"onUpdate:value":r[1]||(r[1]=m=>n(o)[1].value=m),options:n(o)[1].version,disabled:n(o)[1].disabled},null,8,["value","options","disabled"])]),_:1}),t(x,{class:"flex-nowrap! items-center mt-12px"},{default:s(()=>[t(d,{name:"soft-".concat(n(o)[2].icon),size:"32"},null,8,["name"]),t(h,{value:n(o)[2].value,"onUpdate:value":r[2]||(r[2]=m=>n(o)[2].value=m),options:n(o)[2].version,disabled:n(o)[2].disabled},null,8,["value","options","disabled"])]),_:1})]),l("div",ze,[l("span",De,u(a.$t("Home.Install.index_4")),1),t(e,{value:n(_),"onUpdate:value":r[3]||(r[3]=m=>fe(_)?_.value=m:null)},{default:s(()=>[t(v,{trigger:"hover"},{trigger:s(()=>[t($,{value:1},{default:s(()=>[y(u(a.$t("Home.Install.index_5")),1)]),_:1})]),default:s(()=>[l("div",Ee,u(a.$t("Home.Install.index_6")),1)]),_:1}),t(v,{trigger:"hover"},{trigger:s(()=>[t($,{value:0},{default:s(()=>[y(u(a.$t("Home.Install.index_7")),1)]),_:1})]),default:s(()=>[l("div",Re,u(a.$t("Home.Install.index_8")),1)]),_:1})]),_:1},8,["value"])]),t(p,{class:"mt-10px"},{default:s(()=>[l("li",null,u(a.$t("Soft.Plugin.index_19")),1)]),_:1})])}}}),We=W(je,[["__scopeId","data-v-79e877a1"]]),Fe={class:"font-bold text-14px my-16px block"},qe=B({__name:"index",setup(N,{expose:w}){const{t:i}=G(),f=j(),{isMultiServiceInstall:S,taskCount:P}=q(f),_=C(!1),o=D(()=>P.value>0&&S.value),c=F({phpValue:"nginx",wordpressValue:"nginx"}),b=D(()=>g.data.map(e=>({label:e.name,value:e.name}))),{table:g,columns:k}=he([{key:"webserver",title:i("Soft.Plugin.index_8")},{key:"status",title:i("Soft.Plugin.index_9"),render:e=>t("span",{class:e.status?"text-primary":"text-error"},[e.status?i("Soft.Plugin.index_10"):i("Soft.Plugin.index_11")])},$e({width:190,options:e=>[{label:i("Home.index_7"),onClick:()=>{M({title:i("Home.index_7"),content:i("The restart process will make the website inaccessible. Do you want to continue?"),onConfirm:async()=>{await re({name:e.name,type:"restart"})}})}},{label:i("Soft.Plugin.index_12"),onClick:()=>{r(e.name)}}]})]),a=async e=>{if(!e){z({title:i("Soft.Plugin.index_13"),width:480,footer:!0,data:{callBack:()=>{v(),f.getConfigSimple()}},component:Oe});return}z({title:i("Soft.Plugin.index_14"),width:400,footer:!0,component:We})},r=async e=>{M({title:i("Soft.Plugin.index_15"),content:i("Soft.Plugin.index_16"),onConfirm:async()=>{await ye({server:e})}})},d=async e=>{await E({default_php:e,default_wp:c.wordpressValue}),v()},h=async e=>{await E({default_php:c.phpValue,default_wp:e}),v()},{loading:x,setLoading:$}=Se();ve(()=>o.value,e=>{e||v()});const v=async()=>{try{$(!0);const{message:e}=await Pe();ce(e)&&(_.value=e.status,g.data=Object.entries(e).filter(([p])=>p!=="status"&&p!=="default").map(([p,m])=>({webserver:p.charAt(0).toUpperCase()+p.slice(1),name:p,status:m})),c.phpValue=e.default.php,c.wordpressValue=e.default.wp)}finally{$(!1)}};return v(),w({init:v}),(e,p)=>{const m=Ne,J=Z,K=ge("i18n-t"),Q=pe,O=L,Y=oe,ee=Ie,A=U,T=X,ne=R,te=Le;return V(),be(te,{show:n(x)||n(o),description:n(o)?e.$t("Soft.Plugin.index_2"):""},{default:s(()=>[t(J,{class:"items-center mt-10px"},{default:s(()=>[l("span",null,u(e.$t("Soft.Plugin.index_17")),1),t(m,{value:n(_),"onUpdate:value":a,disabled:n(o)},null,8,["value","disabled"])]),_:1}),t(O,{class:"my-16px"},{default:s(()=>[l("li",null,[y(u(e.$t("Soft.Plugin.index_3"))+" ",1),p[2]||(p[2]=l("span",{class:"text-warning"},"8188, 8189, 8190, 8288, 8289, 8290, 80, 443",-1))]),l("li",null,u(e.$t("Soft.Plugin.index_4")),1),l("li",null,u(e.$t("Soft.Plugin.index_5")),1),t(K,{keypath:"If one of the services fails to start, click {repair} to repair it",scope:"global",tag:"li"},{repair:s(()=>[l("b",null,u(e.$t("Public.Btn.Repair")),1)]),_:1}),l("li",null,[y(u(e.$t("Soft.Plugin.index_6")),1),t(Q,{class:"ml-5px",target:"_blank",href:"https://www.yakpanel.com/docs/faq/multi-webserver_hosting.html"},{default:s(()=>[y(u(e.$t("Soft.Plugin.index_7")),1)]),_:1})])]),_:1}),n(_)?(V(),H(xe,{key:0},[t(Y,{data:n(g).data,columns:n(k),loading:n(x)},null,8,["data","columns","loading"]),l("div",null,[l("span",Fe,u(e.$t("Set website default service")),1),t(ee,{class:"my-16px!"}),t(ne,{"label-width":"auto"},{default:s(()=>[t(T,{label:"PHP Project"},{default:s(()=>[t(A,{class:"w-150px",options:n(b),value:n(c).phpValue,"onUpdate:value":[p[0]||(p[0]=I=>n(c).phpValue=I),d]},null,8,["options","value"])]),_:1}),t(T,{label:"WP Toolkit"},{default:s(()=>[t(A,{class:"w-150px",options:n(b),value:n(c).wordpressValue,"onUpdate:value":[p[1]||(p[1]=I=>n(c).wordpressValue=I),h]},null,8,["options","value"])]),_:1})]),_:1})]),t(O,null,{default:s(()=>[l("li",null,u(e.$t("New websites will use the above services by default")),1)]),_:1})],64)):we("",!0)]),_:1},8,["show","description"])}}}),an=W(qe,[["__scopeId","data-v-94b73019"]]);export{an as O};
|