import{A as a,l as e,a7 as t,av as s,aB as l,x as o,a4 as r,$ as i,ck as u,z as n,cl as d,cm as m,a2 as c,az as p}from"./utils-lib.js?v=20260328163632";import{B as _}from"./index91.js?v=20260328163632";import{_ as v}from"./index.vue_vue_type_script_setup_true_lang5.js?v=20260328163632";import{d as b}from"./database.js?v=20260328163632";import{r as f,k as h,w as g,o as y,V as j,_ as k,a3 as w,Y as V,O as D,N as x,a1 as C,j as z,Z as O}from"./base-lib.js?v=20260328163632";import{e as q,B as E}from"./naive-ui.js?v=20260328163632";const R=f("server"),A=f({}),B=f({}),P=()=>{a({title:e("添加数据库"),component:()=>t((()=>import("./add-gbase8s.js?v=20260328163632")),[],import.meta.url),area:530,showFooter:!0})},T=s=>{B.value=s,a({title:e("设置密码")+" [ ".concat(s.name," ]"),component:()=>t((()=>import("./set-pwd.js?v=20260328163632")),[],import.meta.url),area:530,showFooter:!0})},U=f({columns:[{title:e("数据库名称"),key:"name"},{title:e("用户名"),key:"username"},s({width:160,event:T}),l({minWidth:110,width:"auto",request:(a,t)=>{o({loading:e("正在修改备注信息，请稍后..."),request:b({id:a.id,ps:t}),message:!0,data:{status:Number},success:a=>{0===a.status&&L()}})}}),r([{onClick:T,title:e("改密")},{onClick:async a=>{await n({title:e("删除数据库")+" [ ".concat(a.name," ]"),content:e("删除该数据库，是否继续操作？")}),o({loading:e("正在删除数据库，请稍后..."),request:d({id:a.id}),message:!0,success:()=>{L()}})},title:e("删除")}])],data:[]}),[F,I]=i(U),L=()=>{o({request:u(),success:a=>{U.value.data=a.data.data||[]}})},N=a=>{switch(R.value=a,a){case"server":break;case"database":L()}},S=h({__name:"index",props:{compData:{default:{}}},setup(a){const t=a,s=f(!0),l=f({});return g((()=>l.value),(a=>{a&&(s.value=-1!==(null==a?void 0:a.status),s.value||"server"!==R.value||N("database"))}),{immediate:!0,deep:!0}),y((()=>{A.value=t.compData})),(a,t)=>{const o=q,r=E;return j(),k(V(p),{modelValue:V(R),"onUpdate:modelValue":t[2]||(t[2]=a=>x(R)?R.value=a:null),type:"card",placement:"left",onChange:V(N)},{default:w((()=>[V(s)?(j(),k(o,{key:0,name:"server",tab:V(m)(V(e)("服务")),"display-directive":"show:lazy"},{default:w((()=>[D(v,{tab:V(R),modelValue:V(A).status,"onUpdate:modelValue":t[0]||(t[0]=a=>V(A).status=a),name:"gbase8s",serviceData:V(l),"onUpdate:serviceData":t[1]||(t[1]=a=>x(l)?l.value=a:null)},null,8,["tab","modelValue","serviceData"])])),_:1},8,["tab"])):C("",!0),D(o,{name:"database",tab:V(m)(V(e)("数据库管理")),"display-directive":"show:lazy"},{default:w((()=>[D(V(c),null,{"header-left":w((()=>[D(r,{type:"primary",onClick:V(P)},{default:w((()=>[z(O(V(e)("添加数据库")),1)])),_:1},8,["onClick"])])),"header-right":w((()=>[D(V(_),{onRefresh:V(L)},null,8,["onRefresh"])])),content:w((()=>[D(V(F),{"max-height":450})])),_:1})])),_:1},8,["tab"])])),_:1},8,["modelValue","onChange"])}}}),M=Object.freeze(Object.defineProperty({__proto__:null,default:S},Symbol.toStringTag,{value:"Module"}));export{L as g,M as i,B as r};
