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