import{_ as C}from"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import{aF as D,ie as k}from"./index-BTglIPU2.js?v=1773287522785";import{_ as y}from"./index-Bn9O4sxw.js?v=1773287522785";import{k as q,R as P,r as d,e as U,$ as _,Z as M,a0 as o,a9 as l,S as a,a8 as R,ak as B}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{a1 as E,b as N,k as V,a6 as F}from"./naive-ui--dJnpVcV.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./index-DIKmrNCq.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-DgjjuUjT.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-B7YvCBmY.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-BeO8Hyma.js?v=1773287522785";import"./data-BVsViUMm.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-D2Bk83Ev.js?v=1773287522785";import"./useTableColumns-DDeyYvje.js?v=1773287522785";import"./index-S15tYq5l.js?v=1773287522785";import"./copy-D-wIKr0q.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-DeTfbeeM.js?v=1773287522785";import"./index-Cg6fMjw6.js?v=1773287522785";import"./useTableData-BmkIKQ_R.js?v=1773287522785";import"./useLoading-CZ2gSAW7.js?v=1773287522785";const I={class:"p-16px"},te=q({__name:"index",props:{data:{}},setup(f,{expose:b}){const{t:r}=P(),c=f,{getList:i}=c.data,m=d(null),e=U({sid:0,username:"",password:D(10),host:"127.0.0.1",ip:""}),v={username:{required:!0,message:r("Config.Panel.index_60"),trigger:["blur","input"]},password:{required:!0,message:r("Config.Panel.index_67"),trigger:["blur","input"]},ip:{trigger:["blur","input"],validator:()=>e.host==="ip"&&e.ip===""?new Error(r("Database.Mysql.index_6")):!0}},w=d([{label:r("Database.form.index_13"),value:"%"},{label:r("Database.form.index_12"),value:"127.0.0.1"},{label:r("Database.form.index_14"),value:"ip"}]),x=()=>({sid:e.sid,username:e.username,password:e.password,host:e.host==="ip"?e.ip:e.host,db_name:"*",tb_name:"*"});return b({onConfirm:async()=>{var s;await((s=m.value)==null?void 0:s.validate()),await k(x()),i==null||i()}}),(s,t)=>{const p=E,u=N,g=F,h=V,$=C;return _(),M("div",I,[o($,{ref_key:"formRef",ref:m,model:a(e),rules:v},{default:l(()=>[o(p,{label:s.$t("Database.Mysql.index_5"),path:"server"},{default:l(()=>[o(y,{class:"w-200px",value:a(e).sid,"onUpdate:value":t[0]||(t[0]=n=>a(e).sid=n)},null,8,["value"])]),_:1},8,["label"]),o(p,{label:s.$t("Database.index_13"),path:"username"},{default:l(()=>[o(u,{class:"w-350px!",value:a(e).username,"onUpdate:value":t[1]||(t[1]=n=>a(e).username=n),placeholder:s.$t("Config.Panel.index_60")},null,8,["value","placeholder"])]),_:1},8,["label"]),o(p,{label:s.$t("Database.index_14"),path:"password"},{default:l(()=>[o(u,{class:"w-350px!",value:a(e).password,"onUpdate:value":t[2]||(t[2]=n=>a(e).password=n),placeholder:s.$t("Config.Panel.index_67")},null,8,["value","placeholder"])]),_:1},8,["label"]),o(h,null,{default:l(()=>[o(p,{label:s.$t("Database.Mysql.index_4")},{default:l(()=>[o(g,{class:"w-200px",value:a(e).host,"onUpdate:value":t[3]||(t[3]=n=>a(e).host=n),options:a(w)},null,8,["value","options"])]),_:1},8,["label"]),o(p,{"show-label":!1,path:"ip"},{default:l(()=>[a(e).host==="ip"?(_(),R(u,{key:0,class:"w-150px!",value:a(e).ip,"onUpdate:value":t[4]||(t[4]=n=>a(e).ip=n),placeholder:s.$t("Database.Mysql.index_6")},null,8,["value","placeholder"])):B("",!0)]),_:1})]),_:1})]),_:1},8,["model"])])}}});export{te as default};
