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