System.register(["./public-legacy.js?v=1763625242172","./index.vue_vue_type_script_setup_true_lang-legacy.js?v=1763625242172","./vue-legacy.js?v=1763625242172","./page_layout-legacy.js?v=1763625242172","./index-legacy263.js?v=1763625242172","./naive-legacy.js?v=1763625242172"],(function(e,a){"use strict";var t,s,l,o,r,d,p,n,u,_,b,i,c,v,h,x,m,g,w,f,D,y,$,j,k,q;return{setters:[e=>{t=e._},e=>{s=e._},e=>{l=e.k,o=e.P,r=e.a0,d=e.r,p=e.e,n=e.R,u=e.S,_=e.X,b=e.a3,i=e.U,c=e.V,v=e.a2,h=e.an,x=e.a4,m=e.N},e=>{g=e.bn,w=e.fI,f=e.dM,D=e.fJ,y=e.fK},e=>{$=e.v},e=>{j=e.au,k=e.dP,q=e.df}],execute:function(){const a={class:"p-20px"},U={class:"w-260px"},E={class:"w-260px"},R={class:"w-260px"},C={class:"w-260px"},M={class:"w-260px"},N={key:0};e("_",l({__name:"form",props:{data:{}},setup(e,{expose:l}){const{t:P}=o(),S=e,{row:I,isEdit:J}=S.data,K=g(),{type:V}=r(K),X=d(null),z=p({db_host:"",db_port:null,db_user:"root",db_password:"",db_ps:""}),A={db_host:{trigger:["blur","change"],validator:(e,a)=>""===a?new Error(P("Database.tools.index_53")):!(!w(a)&&!f(a))||new Error(P("Database.tools.index_54"))},db_port:$(),db_user:{required:!0,message:P("Database.tools.index_55"),trigger:["blur","change"]},db_password:{required:!0,message:P("Database.tools.index_56"),trigger:["blur","change"]}},B=e=>{z.db_ps=e},F=new Map([["mysql",{port:3306,username:"root"}],["sqlserver",{port:1433,username:"sa"}],["redis",{port:6379,username:"root"}],["mongodb",{port:27017,username:"root"}],["pgsql",{port:5432,username:"postgres"}]]);return(()=>{if(J&&I)z.db_host=`${I.db_host}`,z.db_port=I.db_port,z.db_user=`${I.db_user}`,z.db_password=`${I.db_password}`,z.db_ps=`${I.ps}`;else{const e=F.get(V.value);e&&(z.db_port=e.port,z.db_user=e.username)}})(),l({onConfirm:async({hide:e})=>{await(X.value?.validate());const a=(()=>{const{db_port:e}=z;if(null===e)throw new Error(P("Database.tools.index_57"));return{...m(z),db_port:e,type:V.value}})();J&&I&&await D(V.value,{id:I.id,...a}),J||await y(V.value,a),K.getRemote(),e()}}),(e,l)=>{const o=j,r=k,d=q,p=s,m=t;return n(),u("div",a,[_(p,{ref_key:"formRef",ref:X,model:c(z),rules:A},{default:b((()=>[_(r,{label:e.$t("Database.tools.index_42"),path:"db_host"},{default:b((()=>[i("div",U,[_(o,{value:c(z).db_host,"onUpdate:value":[l[0]||(l[0]=e=>c(z).db_host=e),B],placeholder:e.$t("Database.tools.index_43"),"input-props":{name:"host"}},null,8,["value","placeholder"])])])),_:1},8,["label"]),_(r,{label:e.$t("Docker.Container.create.index_7"),path:"db_port"},{default:b((()=>[i("div",E,[_(d,{value:c(z).db_port,"onUpdate:value":l[1]||(l[1]=e=>c(z).db_port=e),min:1,max:65535,"show-button":!1,"input-props":{name:"port"},placeholder:e.$t("Database.tools.index_44")},null,8,["value","placeholder"])])])),_:1},8,["label"]),"redis"!==c(V)?(n(),v(r,{key:0,label:e.$t("Database.index_13"),path:"db_user"},{default:b((()=>[i("div",R,[_(o,{value:c(z).db_user,"onUpdate:value":l[2]||(l[2]=e=>c(z).db_user=e),placeholder:e.$t("Database.tools.index_45"),"input-props":{name:"username"}},null,8,["value","placeholder"])])])),_:1},8,["label"])):h("",!0),_(r,{label:e.$t("Database.index_14"),path:"db_password"},{default:b((()=>[i("div",C,[_(o,{value:c(z).db_password,"onUpdate:value":l[3]||(l[3]=e=>c(z).db_password=e),placeholder:e.$t("Database.tools.index_46"),"input-props":{name:"password"}},null,8,["value","placeholder"])])])),_:1},8,["label"]),_(r,{label:"Notes",path:"db_ps","show-feedback":!1},{default:b((()=>[i("div",M,[_(o,{value:c(z).db_ps,"onUpdate:value":l[4]||(l[4]=e=>c(z).db_ps=e),placeholder:e.$t("Database.tools.index_48"),"input-props":{name:"ps"}},null,8,["value","placeholder"])])])),_:1})])),_:1},8,["model"]),_(m,{class:"mt-24px"},{default:b((()=>["mysql"===c(V)?(n(),u("li",N,x(e.$t("Database.tools.index_49")),1)):h("",!0),i("li",null,x(e.$t("Database.tools.index_50")),1),i("li",null,x(e.$t("Database.tools.index_51")),1),i("li",null,x(e.$t("Database.tools.index_52")),1)])),_:1})])}}}))}}}));
