import{_ as t}from"./index.js?v=1764830988434";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=1764830988434";import{_ as d}from"./index.vue_vue_type_script_setup_true_lang5.js?v=1764830988434";import{P as _,W as r,k as u,a0 as p,e as c,c as m,R as b,V as y,a3 as x,U as f,j as w,a4 as D,an as h,S as v}from"./vue.js?v=1764830988434";import{aL as j,fz as k,fA as g}from"./page_layout.js?v=1764830988434";import{_ as C}from"./form.vue_vue_type_script_setup_true_lang.js?v=1764830988434";import{aC as R}from"./naive.js?v=1764830988434";import"./common.js?v=1764830988434";import"./__commonjsHelpers__.js?v=1764830988434";import"./index.vue_vue_type_script_setup_true_lang6.js?v=1764830988434";import"./index.vue_vue_type_script_setup_true_lang.js?v=1764830988434";import"./index264.js?v=1764830988434";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 L={class:"p-20px"},q={key:0},B=u({__name:"index",setup(a){const{t:u}=_(),B=j(),{type:P,remoteList:U}=p(B),z=c({show:!1,title:u("Database.tools.index_41"),data:{row:void 0,isEdit:!1}}),A=()=>{z.data.row=void 0,z.data.isEdit=!1,z.title=u("Database.tools.index_41"),z.show=!0},G=m(()=>U.value.filter(t=>0!==t.id)),{columns:H}=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"===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=>{z.data.row=t,z.data.isEdit=!0,z.title=u("Database.tools.index_58"),z.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}),B.getRemote(),B.setRefresh(!0),B.setDelRemoteId(t.id)})(t),a()}})}}]})]),{loading:I,setLoading:S}=i();return(async()=>{try{S(!0),B.getRemote()}finally{S(!1)}})(),(a,e)=>{const s=R,o=l,i=d,_=n,u=t;return y(),b("div",L,[r(i,null,{toolsLeft:x(()=>[r(s,{type:"primary",onClick:A},{default:x(()=>[w(D(a.$t("Database.tools.index_41")),1)]),_:1})]),table:x(()=>[r(o,{loading:f(I),columns:f(H),data:f(G)},null,8,["loading","columns","data"])]),_:1}),r(_,{class:"mt-24px"},{default:x(()=>["mysql"===f(P)?(y(),b("li",q,D(a.$t("Database.tools.index_49")),1)):h("",!0),v("li",null,D(a.$t("Database.tools.index_50")),1),v("li",null,D(a.$t("Database.tools.index_51")),1),v("li",null,D(a.$t("Database.tools.index_52")),1)]),_:1}),r(u,{show:f(z).show,"onUpdate:show":e[0]||(e[0]=t=>f(z).show=t),title:f(z).title,width:460,footer:!0,data:f(z).data,component:C},null,8,["show","title","data"])])}}});export{B as default};
