System.register(["./index.vue_vue_type_script_setup_true_lang-legacy.js?v=1764830988434","./page_layout-legacy.js?v=1764830988434","./index.vue_vue_type_script_setup_true_lang-legacy2.js?v=1764830988434","./vue-legacy.js?v=1764830988434","./public-legacy.js?v=1764830988434","./index-legacy132.js?v=1764830988434","./naive-legacy.js?v=1764830988434","./common-legacy.js?v=1764830988434","./__commonjsHelpers__-legacy.js?v=1764830988434","./index-legacy96.js?v=1764830988434","./index-legacy133.js?v=1764830988434","./soft-legacy.js?v=1764830988434","./site-legacy.js?v=1764830988434"],function(e,a){"use strict";var l,s,t,d,n,r,u,i,o,c,p,b,_,v,m,f,g,x,h,y,w,D,j,$,U,k,R;return{setters:[e=>{l=e._},e=>{s=e.aL,t=e.o,d=e.ff,n=e.m},e=>{r=e._},e=>{u=e.k,i=e.P,o=e.a0,c=e.r,p=e.e,b=e.c,_=e.a2,v=e.V,m=e.a3,f=e.W,g=e.an,x=e.S,h=e.U,y=e.j,w=e.a4,D=e.N},null,e=>{j=e.g},e=>{$=e.dR,U=e.au,k=e.dV,R=e.dj},null,null,null,null,null,null],execute:function(){const a={class:"w-240px"},A={class:"w-100px ml-8px"},S={class:"w-240px"},E={class:"w-240px"},L={class:"w-240px"},q={class:"w-240px"},C={class:"w-240px"},Q={class:"ml-8px"};e("default",u({__name:"index",setup(e,{expose:u}){const{t:V}=i(),z=s(),{remoteList:H}=o(z),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:V("Database.form.index_12"),value:"127.0.0.1"},{label:V("Database.form.index_13"),value:"%"},{label:V("Database.form.index_14"),value:"ip"}]),W=b(()=>H.value.map(e=>({label:`${e.ps} (${e.db_host})`,value:e.id}))),B={name:{required:!0,message:V("Database.form.index_15"),trigger:["blur","change"]},db_user:{required:!0,message:V("Database.form.index_16"),trigger:["blur","change"]},password:{required:!0,message:V("Database.form.index_17"),trigger:["blur","change"]},sid:{trigger:"change",validator:(e,a)=>null!==a||new Error(V("Database.form.index_18"))}},F=e=>{M.db_user=e},G=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(V("Database.form.index_18")),new Error(V("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 d(e),z.setRefresh(!0)}catch(e){console.warn(e)}}}),(e,s)=>{const d=U,n=k,u=$,i=r,o=t,c=R,p=l;return v(),_(p,{ref_key:"formRef",ref:I,model:h(M),rules:B,class:"p-20px"},{default:m(()=>[f(u,{label:e.$t("Database.form.index_1"),path:"name"},{default:m(()=>[x("div",a,[f(d,{value:h(M).name,"onUpdate:value":[s[0]||(s[0]=e=>h(M).name=e),F],placeholder:e.$t("Database.form.index_2"),"input-props":{name:"name"}},null,8,["value","placeholder"])]),x("div",A,[f(n,{value:h(M).codeing,"onUpdate:value":s[1]||(s[1]=e=>h(M).codeing=e),class:"code-select",options:h(N)},null,8,["value","options"])])]),_:1},8,["label"]),f(u,{label:e.$t("Database.form.index_3"),path:"db_user"},{default:m(()=>[x("div",S,[f(d,{value:h(M).db_user,"onUpdate:value":s[2]||(s[2]=e=>h(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(()=>[x("div",E,[f(i,{value:h(M).password,"onUpdate:value":s[3]||(s[3]=e=>h(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(()=>[x("div",L,[f(n,{value:h(M).dataAccess,"onUpdate:value":[s[4]||(s[4]=e=>h(M).dataAccess=e),G],class:"access-select",options:h(P)},null,8,["value","options"])])]),_:1},8,["label"]),"ip"===h(M).dataAccess?(v(),_(u,{key:0,label:e.$t("Database.form.index_7"),path:"address"},{default:m(()=>[x("div",q,[f(d,{value:h(M).address,"onUpdate:value":s[5]||(s[5]=e=>h(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"])):g("",!0),f(u,{label:e.$t("Database.form.index_9"),path:"sid"},{default:m(()=>[x("div",C,[f(n,{value:h(M).sid,"onUpdate:value":s[6]||(s[6]=e=>h(M).sid=e),class:"sid-select",options:h(W)},null,8,["value","options"])]),x("div",Q,[f(o,{onClick:K},{default:m(()=>[y(w(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:h(M).active,"onUpdate:value":[s[7]||(s[7]=e=>h(M).active=e),J],class:"ssl-switch"},null,8,["value"])]),_:1},8,["label"])]),_:1},8,["model"])}}}))}}});
