import{_ as t}from"./index.js?v=1753954525509";import{t as e,b as a,h as s,d as o,c as i,f as l,_ as n}from"./public.js?v=1753954525509";import{_ as d}from"./index.vue_vue_type_script_setup_true_lang4.js?v=1753954525509";import{P as _,Q as r,k as u,$ as p,e as c,c as m,U as b,V as y,a2 as x,j as f,a3 as w,X as D,al as h,W as v}from"./vue.js?v=1753954525509";import{b1 as j,eL as k,eM as g}from"./page_layout.js?v=1753954525509";import{_ as C}from"./form.vue_vue_type_script_setup_true_lang.js?v=1753954525509";import{ay as $}from"./naive.js?v=1753954525509";import"./common.js?v=1753954525509";import"./__commonjsHelpers__.js?v=1753954525509";import"./index.vue_vue_type_script_setup_true_lang7.js?v=1753954525509";import"./index.vue_vue_type_script_setup_true_lang.js?v=1753954525509";import"./index255.js?v=1753954525509";function R(){const{t:t}=_();return{key:"db_password",title:t("Database.index_14"),width:160,render:t=>r(e,{value:t.db_password},null)}}function E(){const{t:t}=_();return{key:"ps",title:t("Database.tools.index_62")}}const L={class:"p-20px"},q={key:0},B=u({__name:"index",setup(e){const{t:u}=_(),B=j(),{type:P,remoteList:U}=p(B),G=c({show:!1,title:u("Database.tools.index_41"),data:{row:void 0,isEdit:!1}}),H=()=>{G.data.row=void 0,G.data.isEdit=!1,G.title=u("Database.tools.index_41"),G.show=!0},I=m((()=>U.value.filter((t=>0!==t.id)))),{columns:M}=a([{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")},R(),E(),s({width:"mysql"===B.type?150:100,options:t=>[{label:"Get DB",show:"mysql"===t.db_type,onClick:()=>{(async t=>{await k(P.value,{sid:t.id}),B.setRefresh(!0)})(t)}},{label:u("Public.Btn.Edit"),onClick:()=>{(t=>{G.data.row=t,G.data.isEdit=!0,G.title=u("Database.tools.index_58"),G.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:e})=>{await(async t=>{await g(P.value,{id:t.id}),B.getRemote(),B.setRefresh(!0),B.setDelRemoteId(t.id)})(t),e()}})}}]})]),{loading:Q,setLoading:V}=i();return(async()=>{try{V(!0),B.getRemote()}finally{V(!1)}})(),(e,a)=>{const s=$,o=l,i=d,_=n,u=t;return b(),y("div",L,[r(i,null,{toolsLeft:x((()=>[r(s,{type:"primary",onClick:H},{default:x((()=>[f(w(e.$t("Database.tools.index_41")),1)])),_:1})])),table:x((()=>[r(o,{loading:D(Q),columns:D(M),data:D(I)},null,8,["loading","columns","data"])])),_:1}),r(_,{class:"mt-24px"},{default:x((()=>["mysql"===D(P)?(b(),y("li",q,w(e.$t("Database.tools.index_49")),1)):h("",!0),v("li",null,w(e.$t("Database.tools.index_50")),1),v("li",null,w(e.$t("Database.tools.index_51")),1),v("li",null,w(e.$t("Database.tools.index_52")),1)])),_:1}),r(u,{show:D(G).show,"onUpdate:show":a[0]||(a[0]=t=>D(G).show=t),title:D(G).title,width:460,footer:!0,data:D(G).data,component:C},null,8,["show","title","data"])])}}});export{B as default};
