import{h as L,x as N,gm as S,gn as V}from"./index-BTglIPU2.js?v=1773287522785";import{_ as q}from"./index-DIKmrNCq.js?v=1773287522785";import{_ as P}from"./index.vue_vue_type_script_setup_true_lang-DgjjuUjT.js?v=1773287522785";import{_ as T}from"./index.vue_vue_type_script_setup_true_lang-BeO8Hyma.js?v=1773287522785";import{R as _,a0 as n,k as A,a6 as I,e as j,c as G,$ as p,Z as b,a9 as d,S as s,j as M,aa as i,ak as U,_ as c}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{u as Z}from"./index-B5d4M70B.js?v=1773287522785";import{u as z}from"./useLoading-CZ2gSAW7.js?v=1773287522785";import{u as F}from"./useTableData-BmkIKQ_R.js?v=1773287522785";import{c as H,u as J}from"./useTableColumns-DDeyYvje.js?v=1773287522785";import{_ as K}from"./form.vue_vue_type_script_setup_true_lang-BCtdjtVc.js?v=1773287522785";import{B as O}from"./naive-ui--dJnpVcV.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-B7YvCBmY.js?v=1773287522785";import"./data-BVsViUMm.js?v=1773287522785";import"./index-S15tYq5l.js?v=1773287522785";import"./copy-D-wIKr0q.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-DeTfbeeM.js?v=1773287522785";import"./index-Cg6fMjw6.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import"./check-CNel7fTH.js?v=1773287522785";import"./index-DhnhmU-6.js?v=1773287522785";function Q(){const{t:l}=_();return{key:"db_password",title:l("Database.index_14"),width:160,render:a=>n(H,{value:a.db_password},null)}}function W(){const{t:l}=_();return{key:"ps",title:l("Database.tools.index_62")}}const X={class:"p-20px"},Y={key:0},kt=A({__name:"index",setup(l){const{t:e}=_(),a=Z(),{type:m,remoteList:f}=I(a),o=j({show:!1,title:e("Database.tools.index_41"),data:{row:void 0,isEdit:!1}}),y=()=>{o.data.row=void 0,o.data.isEdit=!1,o.title=e("Database.tools.index_41"),o.show=!0},D=t=>{o.data.row=t,o.data.isEdit=!0,o.title=e("Database.tools.index_58"),o.show=!0},h=async t=>{await S(m.value,{sid:t.id}),a.setRefresh(!0)},w=async t=>{await V(m.value,{id:t.id}),a.getRemote(),a.setRefresh(!0),a.setDelRemoteId(t.id)},x=G(()=>f.value.filter(t=>t.id!==0)),{columns:k}=F([{key:"db_host",title:e("Database.tools.index_42")},{key:"db_port",title:e("Docker.Container.create.index_7")},{key:"db_type",title:e("Database.tools.index_59")},{key:"db_user",title:e("Database.index_13")},Q(),W(),J({width:a.type==="mysql"?150:100,options:t=>[{label:"Get DB",show:t.db_type==="mysql",onClick:()=>{h(t)}},{label:e("Public.Btn.Edit"),onClick:()=>{D(t)}},{label:e("Public.Btn.Del"),onClick:()=>{L({title:"".concat(e("Database.tools.index_60")," [").concat(t.db_host,"]"),content:e("Database.tools.index_61"),onConfirm:async({hide:r})=>{await w(t),r()}})}}]})]),{loading:g,setLoading:u}=z();return(async()=>{try{u(!0),a.getRemote()}finally{u(!1)}})(),(t,r)=>{const $=O,R=T,C=P,v=q,B=N;return p(),b("div",X,[n(C,null,{toolsLeft:d(()=>[n($,{type:"primary",onClick:y},{default:d(()=>[M(i(t.$t("Database.tools.index_41")),1)]),_:1})]),table:d(()=>[n(R,{loading:s(g),columns:s(k),data:s(x)},null,8,["loading","columns","data"])]),_:1}),n(v,{class:"mt-24px"},{default:d(()=>[s(m)==="mysql"?(p(),b("li",Y,i(t.$t("Database.tools.index_49")),1)):U("",!0),c("li",null,i(t.$t("Database.tools.index_50")),1),c("li",null,i(t.$t("Database.tools.index_51")),1),c("li",null,i(t.$t("Database.tools.index_52")),1)]),_:1}),n(B,{show:s(o).show,"onUpdate:show":r[0]||(r[0]=E=>s(o).show=E),title:s(o).title,width:460,footer:!0,data:s(o).data,component:K},null,8,["show","title","data"])])}}});export{kt as default};
