import{_ as t}from"./index.js?v=1763625242172";import{s as a,c as e,f as s,a as o,d as i,h as l,_ as n}from"./public.js?v=1763625242172";import{_ as d}from"./index.vue_vue_type_script_setup_true_lang5.js?v=1763625242172";import{P as _,X as r,k as u,a0 as p,e as c,c as m,R as b,S as y,a3 as x,j as f,a4 as w,V as D,an as h,U as v}from"./vue.js?v=1763625242172";import{bn as j,fG as k,fH as g}from"./page_layout.js?v=1763625242172";import{_ as C}from"./form.vue_vue_type_script_setup_true_lang.js?v=1763625242172";import{aC as R}from"./naive.js?v=1763625242172";import"./common.js?v=1763625242172";import"./__commonjsHelpers__.js?v=1763625242172";import"./index.vue_vue_type_script_setup_true_lang6.js?v=1763625242172";import"./index.vue_vue_type_script_setup_true_lang.js?v=1763625242172";import"./index263.js?v=1763625242172";function $(){const{t:t}=_();return{key:"db_password",title:t("Database.index_14"),width:160,render:t=>r(a,{value:t.db_password},null)}}function E(){const{t:t}=_();return{key:"ps",title:t("Database.tools.index_62")}}const q={class:"p-20px"},B={key:0},L=u({__name:"index",setup(a){const{t:u}=_(),L=j(),{type:P,remoteList:G}=p(L),H=c({show:!1,title:u("Database.tools.index_41"),data:{row:void 0,isEdit:!1}}),U=()=>{H.data.row=void 0,H.data.isEdit=!1,H.title=u("Database.tools.index_41"),H.show=!0},I=m((()=>G.value.filter((t=>0!==t.id)))),{columns:S}=e([{key:"db_host",title:u("Database.tools.index_42")},{key:"db_port",title:u("Docker.Container.create.index_7")},{key:"db_type",title:u("Database.tools.index_59")},{key:"db_user",title:u("Database.index_13")},$(),E(),s({width:"mysql"===L.type?150:100,options:t=>[{label:"Get DB",show:"mysql"===t.db_type,onClick:()=>{(async t=>{await k(P.value,{sid:t.id}),L.setRefresh(!0)})(t)}},{label:u("Public.Btn.Edit"),onClick:()=>{(t=>{H.data.row=t,H.data.isEdit=!0,H.title=u("Database.tools.index_58"),H.show=!0})(t)}},{label:u("Public.Btn.Del"),onClick:()=>{o({title:"".concat(u("Database.tools.index_60")," [").concat(t.db_host,"]"),content:u("Database.tools.index_61"),onConfirm:async({hide:a})=>{await(async t=>{await g(P.value,{id:t.id}),L.getRemote(),L.setRefresh(!0),L.setDelRemoteId(t.id)})(t),a()}})}}]})]),{loading:V,setLoading:X}=i();return(async()=>{try{X(!0),L.getRemote()}finally{X(!1)}})(),(a,e)=>{const s=R,o=l,i=d,_=n,u=t;return b(),y("div",q,[r(i,null,{toolsLeft:x((()=>[r(s,{type:"primary",onClick:U},{default:x((()=>[f(w(a.$t("Database.tools.index_41")),1)])),_:1})])),table:x((()=>[r(o,{loading:D(V),columns:D(S),data:D(I)},null,8,["loading","columns","data"])])),_:1}),r(_,{class:"mt-24px"},{default:x((()=>["mysql"===D(P)?(b(),y("li",B,w(a.$t("Database.tools.index_49")),1)):h("",!0),v("li",null,w(a.$t("Database.tools.index_50")),1),v("li",null,w(a.$t("Database.tools.index_51")),1),v("li",null,w(a.$t("Database.tools.index_52")),1)])),_:1}),r(u,{show:D(H).show,"onUpdate:show":e[0]||(e[0]=t=>D(H).show=t),title:D(H).title,width:460,footer:!0,data:D(H).data,component:C},null,8,["show","title","data"])])}}});export{L as default};
