System.register(["./public-legacy.js?v=1764830988434","./index.vue_vue_type_script_setup_true_lang-legacy.js?v=1764830988434","./vue-legacy.js?v=1764830988434","./page_layout-legacy.js?v=1764830988434","./index-legacy264.js?v=1764830988434","./naive-legacy.js?v=1764830988434"],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.V,_=e.W,b=e.a3,i=e.a2,c=e.an,v=e.S,h=e.U,x=e.a4,m=e.N},e=>{g=e.aL,w=e.fB,f=e.fC,D=e.fD,y=e.di},e=>{$=e.v},e=>{j=e.dR,k=e.au,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"},N={class:"w-260px"},S={key:0};e("_",l({__name:"form",props:{data:{}},setup(e,{expose:l}){const{t:B}=o(),L=e,{row:M,isEdit:P}=L.data,V=g(),{type:W}=r(V),z=d(null),A=p({db_host:"",db_port:null,db_user:"root",db_password:"",db_ps:""}),F={db_host:{trigger:["blur","change"],validator:(e,a)=>""===a?new Error(B("Database.tools.index_53")):!(!D(a)&&!y(a))||new Error(B("Database.tools.index_54"))},db_port:$(),db_user:{required:!0,message:B("Database.tools.index_55"),trigger:["blur","change"]},db_password:{required:!0,message:B("Database.tools.index_56"),trigger:["blur","change"]}},G=e=>{A.db_ps=e},H=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(P&&M)A.db_host=`${M.db_host}`,A.db_port=M.db_port,A.db_user=`${M.db_user}`,A.db_password=`${M.db_password}`,A.db_ps=`${M.ps}`;else{const e=H.get(W.value);e&&(A.db_port=e.port,A.db_user=e.username)}})(),l({onConfirm:async({hide:e})=>{await(z.value?.validate());const a=(()=>{const{db_port:e}=A;if(null===e)throw new Error(B("Database.tools.index_57"));return{...m(A),db_port:e,type:W.value}})();P&&M&&await w(W.value,{id:M.id,...a}),P||await f(W.value,a),V.getRemote(),e()}}),(e,l)=>{const o=k,r=j,d=q,p=s,m=t;return u(),n("div",a,[_(p,{ref_key:"formRef",ref:z,model:h(A),rules:F},{default:b(()=>[_(r,{label:e.$t("Database.tools.index_42"),path:"db_host"},{default:b(()=>[v("div",U,[_(o,{value:h(A).db_host,"onUpdate:value":[l[0]||(l[0]=e=>h(A).db_host=e),G],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(()=>[v("div",E,[_(d,{value:h(A).db_port,"onUpdate:value":l[1]||(l[1]=e=>h(A).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"!==h(W)?(u(),i(r,{key:0,label:e.$t("Database.index_13"),path:"db_user"},{default:b(()=>[v("div",R,[_(o,{value:h(A).db_user,"onUpdate:value":l[2]||(l[2]=e=>h(A).db_user=e),placeholder:e.$t("Database.tools.index_45"),"input-props":{name:"username"}},null,8,["value","placeholder"])])]),_:1},8,["label"])):c("",!0),_(r,{label:e.$t("Database.index_14"),path:"db_password"},{default:b(()=>[v("div",C,[_(o,{value:h(A).db_password,"onUpdate:value":l[3]||(l[3]=e=>h(A).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(()=>[v("div",N,[_(o,{value:h(A).db_ps,"onUpdate:value":l[4]||(l[4]=e=>h(A).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"===h(W)?(u(),n("li",S,x(e.$t("Database.tools.index_49")),1)):c("",!0),v("li",null,x(e.$t("Database.tools.index_50")),1),v("li",null,x(e.$t("Database.tools.index_51")),1),v("li",null,x(e.$t("Database.tools.index_52")),1)]),_:1})])}}}))}}});
