import{$ as t,l as a,A as e,a7 as s,M as o,a4 as i,z as l,x as r,a2 as n}from"./utils-lib.js?v=20260328163632";import{u as d}from"./index92.js?v=20260328163632";import{u as p}from"./store.js?v=20260328163632";import{o as m}from"./database.js?v=20260328163632";import{k as u}from"./useMethod2.js?v=20260328163632";import{r as c,k as _,o as b,J as f,V as h,_ as k,a3 as y,Y as g,O as j}from"./base-lib.js?v=20260328163632";const{tabActive:v,refreshTableList:w}=p(),x=c(null),O=t=>{x.value=t||null,e({title:a("{0}远程数据库",[a(t?"编辑":"添加")]),area:"auto",showFooter:!0,component:()=>s((()=>import("./index200.js?v=20260328163632")),[],import.meta.url)})},A=async t=>{await l({title:a("删除【{0}】远程数据库",[t.db_host]),content:a("该操作仅删除管理关系以及面板中的数据库记录，不会删除远程数据库中的数据,是否继续？"),icon:"warning-filled"}),await r({loading:a("正在删除中，请稍后..."),request:m({id:t.id}),message:!0}),E(),w()},C=c({columns:[],data:[]}),[M,T]=t(C),{BtOperation:z}=d({options:[{active:!0,label:a("添加远程数据库"),onClick:()=>O()}]}),E=async()=>{const t=o.load(a("正在获取远程数据库列表，请稍候...")),e=await u();C.value.data=e.filter((t=>0!==t.id)),t.close()},L=()=>{P(),C.value.columns=[{title:a("服务器地址"),key:"db_host",width:120},{title:a("数据库端口"),key:"db_port"},{title:a("数据库类型"),key:"db_type"},..."redis"!==v.value?[{title:a("管理员名称"),key:"db_user"}]:[],{title:a("管理员密码"),key:"db_password",width:150},{title:a("备注"),key:"ps"},i([{onClick:O,title:a("编辑")},{onClick:A,title:a("删除")}])],E()},P=()=>{C.value.data=[]},S=_({__name:"index",setup:t=>(b(L),f(P),(t,a)=>(h(),k(g(n),{class:"p-20px"},{"header-left":y((()=>[j(g(z),{class:"gap-10px"})])),"header-right":y((()=>a[0]||(a[0]=[]))),content:y((()=>[j(g(M),{"max-height":300})])),"footer-left":y((()=>a[1]||(a[1]=[]))),"footer-right":y((()=>a[2]||(a[2]=[]))),_:1})))}),V=Object.freeze(Object.defineProperty({__proto__:null,default:S},Symbol.toStringTag,{value:"Module"}));export{E as g,V as i,x as r};
