System.register(["./index.vue_vue_type_script_setup_true_lang-legacy.js?v=1753954525509","./page_layout-legacy.js?v=1753954525509","./vue-legacy.js?v=1753954525509","./naive-legacy.js?v=1753954525509","./common-legacy.js?v=1753954525509","./__commonjsHelpers__-legacy.js?v=1753954525509","./public-legacy.js?v=1753954525509"],(function(e,a){"use strict";var s,l,c,t,n,i,o,r,u,p,d,m,_,v,f,b,x,y,g,h,w;return{setters:[e=>{s=e._},e=>{l=e.eE,c=e.eF,t=e.c,n=e.f},e=>{i=e.k,o=e.P,r=e.r,u=e.e,p=e.U,d=e.a1,m=e.a2,_=e.Q,v=e.W,f=e.X,b=e.al,x=e.N},e=>{y=e.cG,g=e.cA,h=e.aq,w=e.c5},null,null,null],execute:function(){const a={class:"w-280px"},j={class:"w-280px"};e("default",i({__name:"index",props:{row:{}},setup(e,{expose:i}){const A=e,{row:D}=A,{t:k}=o(),R=r(null),U=u({dataAccess:"127.0.0.1",access:"127.0.0.1",ssl:""}),E=r([{label:k("Database.form.index_12"),value:"127.0.0.1"},{label:k("Database.form.index_13"),value:"%"},{label:k("Database.form.index_14"),value:"ip"}]),$={host:{trigger:["blur","change"],validator:()=>"ip"!==U.dataAccess||""!==U.access.trim()||new Error(k("Database.form.index_19"))}},S=e=>{U.access="ip"===e?"":e};return(async()=>{const{message:e}=await c({name:D.name});t(e)&&("127.0.0.1"!==e.permission&&"%"!==e.permission?(U.dataAccess="ip",U.access=e.permission.split(",").join("\n")):(U.dataAccess=e.permission,U.access=e.permission),U.ssl=n(e.ssl)?e.ssl:"")})(),i({onConfirm:async({hide:e})=>{try{await(R.value?.validate());const a={...x(U),name:D.username,access:"ip"===U.dataAccess?U.access.trim().split("\n").join(","):U.access};await l(x(a)),e()}catch(a){console.error(a)}}}),(e,l)=>{const c=y,t=g,n=h,i=w,o=s;return p(),d(o,{ref_key:"formRef",ref:R,model:f(U),rules:$,class:"px-20px py-24px"},{default:m((()=>[_(t,{label:e.$t("Database.form.index_6"),path:"listen_ip"},{default:m((()=>[v("div",a,[_(c,{value:f(U).dataAccess,"onUpdate:value":[l[0]||(l[0]=e=>f(U).dataAccess=e),S],class:"permission-select",options:f(E)},null,8,["value","options"])])])),_:1},8,["label"]),"ip"===f(U).dataAccess?(p(),d(t,{key:0,label:e.$t("Database.form.index_7"),path:"host"},{default:m((()=>[v("div",j,[_(n,{value:f(U).access,"onUpdate:value":l[1]||(l[1]=e=>f(U).access=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"])):b("",!0),_(t,{label:e.$t("Database.form.index_11"),"show-feedback":!1},{default:m((()=>[_(i,{value:f(U).ssl,"onUpdate:value":l[2]||(l[2]=e=>f(U).ssl=e),class:"ssl-switch","checked-value":"REQUIRE SSL"},null,8,["value"])])),_:1},8,["label"])])),_:1},8,["model"])}}}))}}}));
