System.register(["./index.vue_vue_type_script_setup_true_lang-legacy.js?v=1753954525509","./page_layout-legacy.js?v=1753954525509","./index.vue_vue_type_script_setup_true_lang-legacy2.js?v=1753954525509","./vue-legacy.js?v=1753954525509","./public-legacy.js?v=1753954525509","./index-legacy126.js?v=1753954525509","./naive-legacy.js?v=1753954525509","./common-legacy.js?v=1753954525509","./__commonjsHelpers__-legacy.js?v=1753954525509","./index-legacy96.js?v=1753954525509","./index-legacy127.js?v=1753954525509","./soft-legacy.js?v=1753954525509"],(function(e,a){"use strict";var l,s,t,d,n,r,u,o,i,c,p,b,_,v,m,f,g,x,h,w,y,D,j,$,U,k,A;return{setters:[e=>{l=e._},e=>{s=e.b1,t=e.er,d=e.o,n=e.m},e=>{r=e._},e=>{u=e.k,o=e.P,i=e.$,c=e.r,p=e.e,b=e.c,_=e.U,v=e.a1,m=e.a2,f=e.Q,g=e.W,x=e.X,h=e.al,w=e.j,y=e.a3,D=e.N},null,e=>{j=e.g},e=>{$=e.aq,U=e.cG,k=e.cA,A=e.c5},null,null,null,null,null],execute:function(){const a={class:"w-240px"},R={class:"w-100px ml-8px"},q={class:"w-240px"},E={class:"w-240px"},S={class:"w-240px"},L={class:"w-240px"},Q={class:"w-240px"},C={class:"ml-8px"};e("default",u({__name:"index",setup(e,{expose:u}){const{t:z}=o(),G=s(),{remoteList:H}=i(G),I=c(null),M=p({sid:H.value.length>0?H.value[0].id:null,name:"",codeing:"utf8",db_user:"",password:"",dataAccess:"127.0.0.1",address:"127.0.0.1",active:!1,ssl:""}),N=c([{label:"utf-8",value:"utf8"},{label:"utf8mb4",value:"utf8mb4"},{label:"gbk",value:"gbk"},{label:"big5",value:"big5"}]),P=c([{label:z("Database.form.index_12"),value:"127.0.0.1"},{label:z("Database.form.index_13"),value:"%"},{label:z("Database.form.index_14"),value:"ip"}]),W=b((()=>H.value.map((e=>({label:`${e.ps} (${e.db_host})`,value:e.id}))))),X={name:{required:!0,message:z("Database.form.index_15"),trigger:["blur","change"]},db_user:{required:!0,message:z("Database.form.index_16"),trigger:["blur","change"]},password:{required:!0,message:z("Database.form.index_17"),trigger:["blur","change"]},sid:{trigger:"change",validator:(e,a)=>null!==a||new Error(z("Database.form.index_18"))}},B=e=>{M.db_user=e},F=e=>{M.address="ip"===e?"":e},J=e=>{M.ssl=e?"REQUIRE SSL":""},K=()=>{j()};return u({onConfirm:async()=>{await(I.value?.validate());try{const e=(()=>{const e=D(M),{sid:a}=e;if(null===a)throw n.error(z("Database.form.index_18")),new Error(z("Database.form.index_18"));return{...e,sid:a,ps:e.name,dtype:"MySQL",address:"ip"===M.dataAccess?M.address.trim().split("\n").join(","):M.address}})();await t(e),G.setRefresh(!0)}catch(e){console.warn(e)}}}),(e,s)=>{const t=$,n=U,u=k,o=r,i=d,c=A,p=l;return _(),v(p,{ref_key:"formRef",ref:I,model:x(M),rules:X,class:"p-20px"},{default:m((()=>[f(u,{label:e.$t("Database.form.index_1"),path:"name"},{default:m((()=>[g("div",a,[f(t,{value:x(M).name,"onUpdate:value":[s[0]||(s[0]=e=>x(M).name=e),B],placeholder:e.$t("Database.form.index_2"),"input-props":{name:"name"}},null,8,["value","placeholder"])]),g("div",R,[f(n,{value:x(M).codeing,"onUpdate:value":s[1]||(s[1]=e=>x(M).codeing=e),class:"code-select",options:x(N)},null,8,["value","options"])])])),_:1},8,["label"]),f(u,{label:e.$t("Database.form.index_3"),path:"db_user"},{default:m((()=>[g("div",q,[f(t,{value:x(M).db_user,"onUpdate:value":s[2]||(s[2]=e=>x(M).db_user=e),placeholder:e.$t("Database.form.index_4"),"input-props":{name:"username"}},null,8,["value","placeholder"])])])),_:1},8,["label"]),f(u,{label:e.$t("Database.form.index_5"),path:"password"},{default:m((()=>[g("div",E,[f(o,{value:x(M).password,"onUpdate:value":s[3]||(s[3]=e=>x(M).password=e),placeholder:"","input-props":{name:"password"}},null,8,["value"])])])),_:1},8,["label"]),f(u,{label:e.$t("Database.form.index_6"),path:"dataAccess"},{default:m((()=>[g("div",S,[f(n,{value:x(M).dataAccess,"onUpdate:value":[s[4]||(s[4]=e=>x(M).dataAccess=e),F],class:"access-select",options:x(P)},null,8,["value","options"])])])),_:1},8,["label"]),"ip"===x(M).dataAccess?(_(),v(u,{key:0,label:e.$t("Database.form.index_7"),path:"address"},{default:m((()=>[g("div",L,[f(t,{value:x(M).address,"onUpdate:value":s[5]||(s[5]=e=>x(M).address=e),type:"textarea",autosize:{minRows:3,maxRows:3},"input-props":{name:"address"},placeholder:e.$t("Database.form.index_8")},null,8,["value","placeholder"])])])),_:1},8,["label"])):h("",!0),f(u,{label:e.$t("Database.form.index_9"),path:"sid"},{default:m((()=>[g("div",Q,[f(n,{value:x(M).sid,"onUpdate:value":s[6]||(s[6]=e=>x(M).sid=e),class:"sid-select",options:x(W)},null,8,["value","options"])]),g("div",C,[f(i,{onClick:K},{default:m((()=>[w(y(e.$t("Database.form.index_10")),1)])),_:1})])])),_:1},8,["label"]),f(u,{label:e.$t("Database.form.index_11"),"show-feedback":!1},{default:m((()=>[f(c,{value:x(M).active,"onUpdate:value":[s[7]||(s[7]=e=>x(M).active=e),J],class:"ssl-switch"},null,8,["value"])])),_:1},8,["label"])])),_:1},8,["model"])}}}))}}}));
