import{u as a,l as e,v as l,M as s,ar as o,aw as t,ax as n,_ as p,cm as r,az as i}from"./utils-lib.js?v=20260328163632";import{i as c,c as d,v as m,a as u,p as v,s as h,h as f,t as x,o as y}from"./service.vue_vue_type_style_index_0_scoped_073b5b46_lang.js?v=20260328163632";import{k as _,V as b,W as w,X as g,Z as k,Y as j,O as C,o as A,_ as M,a3 as P,N as z,j as V}from"./base-lib.js?v=20260328163632";import{e as H,n as I,B as U,b as q}from"./naive-ui.js?v=20260328163632";import"./__commonjsHelpers__.js?v=20260328163632";import"./env-lib.js?v=20260328163632";const N={class:"p-[16px]"},B={class:"flex items-center w-full mb-[16px]"},G={class:"relative w-[14rem] bg-[var(--bg-color-76)] h-[4.2rem] mr-[24px] rounded-[2px]"},O={class:"relative w-[14rem] bg-[var(--bg-color-76)] h-[4.2rem] rounded-[2px]"},S=p(_({__name:"service",setup(p){const{isAaPanel:r,plugin:i,serverIp:c,panel:d,getGlobalInfo:m}=a(),u=[{content:e("面板访问需要登录面板后，才能通过面板访问phpMyAdmin")},{content:e("如通过面板访问无响应，请使用通过公共访问进行访问phpmyadmin")},{content:e("如访问出现502，请检查php运行是否正常或尝试更换其他php版本进行访问")}],v=async a=>{let l=s.load(e("正在跳转phpMyAdmin，请稍后..."));try{const{data:l}=await o({sName:r.value?"phpMyAdmin":"phpmyadmin"});if(!1===(null==l?void 0:l.setup))return s.error(e("当前phpMyAdmin未安装，请先安装phpMyAdmin"));if(i.value.phpmyadmin.dir_path&&window.location.protocol===d.value.protocol||await m(),"panel"===a){const{port:a,protocol:e}=d.value,l="".concat(e,"://").concat(c.value,":").concat(a);await t("","root",i.value.mysql.root,l)}else{const{protocol:a,host:o,port:t,dir_path:p}=i.value.phpmyadmin,r="".concat(a,"://").concat(o,":").concat(t,"/").concat(p);if(null==l?void 0:l.status){const a=s.load(e("正在跳转phpMyAdmin，请稍后..."));await n("","root",i.value.mysql.root,r),a.close()}else s.error(e("未开启公共访问权限，请开启后再访问"))}}catch(p){}finally{l.close()}};return(a,s)=>(b(),w("div",N,[g("div",B,[g("div",G,[g("div",{class:"h-[4rem] leading-[4rem] text-center w-full cursor-pointer link-hover",onClick:s[0]||(s[0]=a=>v("panel"))},k(j(e)("通过面板访问")),1),s[2]||(s[2]=g("span",{class:"bg-contain inline-block recommend-bg absolute -top-[0.1rem] -left-[0.1rem]"},null,-1))]),g("div",O,[g("div",{class:"h-[4rem] leading-[4rem] text-center w-full cursor-pointer link-hover",onClick:s[1]||(s[1]=a=>v())},k(j(e)("通过公共访问")),1)])]),C(j(l),{options:u,class:"list-disc"})]))}}),[["__scopeId","data-v-073b5b46"]]),W={class:"flex text-[var(--text-color-2)] items-center"},X={class:"flex flex-col gap-4 text-[var(--text-color-2)]"},Y={class:"flex items-center"},Z={class:"flex justify-end items-center h-[30px] pr-[20px]"},D=_({__name:"index",setup:a=>(A(c),(a,s)=>{const o=H,t=I,n=U,p=q;return b(),M(j(i),{modelValue:j(x),"onUpdate:modelValue":s[2]||(s[2]=a=>z(x)?x.value=a:null),type:"card",placement:"left",onChange:j(y)},{default:P((()=>[C(o,{name:"phpService",tab:j(r)(j(e)("服务")),"display-directive":"show:lazy"},{default:P((()=>[C(S)])),_:1},8,["tab"]),C(o,{name:"version",tab:j(r)(j(e)("php版本")),"display-directive":"show:lazy"},{default:P((()=>[g("div",W,[g("span",null,k(j(e)("PHP版本")),1),C(t,{class:"mx-[12px] !w-160px",value:j(d),"onUpdate:value":s[0]||(s[0]=a=>z(d)?d.value=a:null),options:j(m),placeholder:j(e)("请选择PHP版本")},null,8,["value","options","placeholder"]),C(n,{type:"primary",onClick:j(u)},{default:P((()=>[V(k(j(e)("保存")),1)])),_:1},8,["onClick"])])])),_:1},8,["tab"]),C(o,{name:"config",tab:j(r)(j(e)("安全设置")),"display-directive":"show:lazy"},{default:P((()=>[g("div",X,[g("div",Y,[g("span",Z,k(j(e)("访问端口")),1),C(p,{class:"!w-160px mr-[12px]",value:j(v),"onUpdate:value":s[1]||(s[1]=a=>z(v)?v.value=a:null),placeholder:j(e)("请输入端口")},null,8,["value","placeholder"]),C(n,{type:"primary",onClick:j(h)},{default:P((()=>[V(k(j(e)("保存")),1)])),_:1},8,["onClick"])]),C(j(l),{class:"mt-20px",options:j(f)},null,8,["options"])])])),_:1},8,["tab"])])),_:1},8,["modelValue","onChange"])})});export{D as default};
