import{_ as e}from"./index.vue_vue_type_script_setup_true_lang.js?v=1753954525509";import{k as a,P as s,$ as t,r as o,e as r,c as l,U as i,V as n,Q as p,a2 as d,W as u,X as c}from"./vue.js?v=1753954525509";import{b1 as m,eS as _,m as v}from"./page_layout.js?v=1753954525509";import"./public.js?v=1753954525509";import{cG as f,cA as x}from"./naive.js?v=1753954525509";import"./__commonjsHelpers__.js?v=1753954525509";import"./common.js?v=1753954525509";const b={class:"px-20px pt-24px pb-8px"},h={class:"w-260px"},j=a({__name:"index",setup(a,{expose:j}){const{t:g}=s(),w=m(),{remoteList:y}=t(w),D=o(null),k=r({sid:y.value.length>0?y.value[0].id:null}),E=l((()=>y.value.map((e=>({label:"".concat(e.ps||e.db_host," (").concat(e.db_host,")"),value:e.id}))))),R={sid:{trigger:"change",validator:(e,a)=>null!==a||new Error(g("Database.tools.index_63"))}};return j({onConfirm:async({hide:e})=>{var a;try{await(null==(a=D.value)?void 0:a.validate());const s=(()=>{const{sid:e}=k;if(null===e)throw v.error(g("Database.tools.index_64")),new Error(g("Database.tools.index_64"));return{sid:e}})();await _(w.type,s),w.setRefresh(!0),e()}catch(s){console.error(s)}}}),(a,s)=>{const t=f,o=x,r=e;return i(),n("div",b,[p(r,{ref_key:"formRef",ref:D,model:c(k),rules:R},{default:d((()=>[p(o,{label:a.$t("Database.tools.index_76"),path:"sid"},{default:d((()=>[u("div",h,[p(t,{value:c(k).sid,"onUpdate:value":s[0]||(s[0]=e=>c(k).sid=e),class:"server-select",options:c(E)},null,8,["value","options"])])])),_:1},8,["label"])])),_:1},8,["model"])])}}});export{j as default};
