import{n as a,Q as t,P as e,l as s,p as l}from"./utils-lib.js?v=1761009159";import{_ as o}from"./index105.js?v=1761009159";import{c as r,r as i,q as n,v as p,x as d,e as m,B as c,C as u,y as _,z as b,A as v,D as f,F as y,b0 as h,G as g}from"./base-lib.js?v=1761009159";import{getMysqlCloudServer as j,getModulesCloudServer as x,removeServer as w,removeModuleServer as k}from"./database.js?v=1761009159";import{g as q}from"./useStore2.js?v=1761009159";import{u as A}from"./column.js?v=1761009159";import{q as C}from"./useMethod4.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./index106.js?v=1761009159";import"./validator.js?v=1761009159";const S={class:"p-[20px]"},D={class:"ml-20px mt-12px leading-8 text-small list-disc"},E={key:0},O={key:1},F=r({__name:"index",setup(r){const{refs:{tabActive:F,isHaveServer:H},refreshTableList:J}=q(),L=i([]),N=[{content:"支持阿里云、腾讯云等云厂商的云数据库"},{content:"注意1：请确保本服务器有访问数据库的权限"},{content:"注意2：请确保填写的管理员帐号具备足够的权限"}],P=e=>{a({title:"".concat(e?"编辑":"添加","远程数据库"),area:[42],compData:{row:e,refreshEvent:()=>T()},showFooter:!0,component:()=>t(()=>import("./add-cloud-server.js?v=1761009159"),__vite__mapDeps([]),import.meta.url)})},T=async()=>{const a=await e({loading:"正在获取数据中，请稍后...",request:"mysql"===F.value?j():x({data:JSON.stringify({type:F.value})},F.value),data:[Array,a=>a.filter(a=>0!==a.id)]});return L.value=a||[],H.value=a.length,a},z=[{prop:"db_host",label:"服务器地址",width:120},{prop:"db_port",label:"数据库端口"},{prop:"db_type",label:"数据库类型"},{prop:"db_user",label:"管理员名称"},{prop:"db_password",label:"管理员密码",width:150},{label:"备注",prop:"ps"},A([{onClick:a=>P(a),title:"编辑"},{onClick:a=>(async a=>{await l({title:"删除【".concat(a.db_host,"】远程数据库"),content:"该操作仅删除管理关系以及面板中的数据库记录，不会删除远程数据库中的数据,是否继续？",icon:"warning-filled"}),await e({loading:"正在删除中，请稍后...",request:"mysql"===F.value?w({id:a.id}):k({data:JSON.stringify({id:a.id})},F.value),message:!0}),T(),J()})(a),title:"删除"}])];return n(()=>{T()}),(a,t)=>{var e,l;const r=g,i=s,n=o;return p(),d("div",S,[m(n,null,{"header-left":c(()=>[m(r,{type:"primary",onClick:t[0]||(t[0]=a=>P())},{default:c(()=>t[1]||(t[1]=[u("添加远程数据库",-1)])),_:1,__:[1]})]),content:c(()=>[m(i,{column:_(z),data:_(L),"max-height":300},null,8,["column","data"])]),_:1}),b("ul",D,[(null==(e=_(C))?void 0:e.length)&&_(C)[0]?(p(),d("li",E,v(_(C)[0]),1)):f("",!0),(p(),d(y,null,h(N,(a,t)=>b("li",{key:t},v(a.content),1)),64)),(null==(l=_(C))?void 0:l.length)&&_(C)[1]?(p(),d("li",O,v(_(C)[1]),1)):f("",!0)])])}}});export{F as default};
function __vite__mapDeps(indexes) {
  if (!__vite__mapDeps.viteFileDeps) {
    __vite__mapDeps.viteFileDeps = []
  }
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}
