import{jM as a,aK as e,P as s,jN as l,$ as t}from"./utils-lib.js?v=1761009159";import{c as u,r as n,q as o,H as m,I as c,y as i,v as d,x as r,z as v,e as p,B as f,F as _,b0 as y,N as b,Q as x,C as j,ak as k,al as g,G as w}from"./base-lib.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";const V={class:"p-[20px]"},h=u({__name:"defalut-site",setup(u){const h=n(!1),q=n([{name:"默认站点",value:"default"},{name:"自定义站点",value:"custom"}]),C=n("default"),H=async()=>{const a={site_name:"未设置默认站点"===C.value?"0":C.value};h.value=!0,await s({loading:"正在设置默认站点，请稍后...",request:l(a),message:!0}),h.value=!1};return o(()=>{(async()=>{h.value=!0;try{const{data:e}=await a();C.value=e.data.defaultSite,e.data.defaultSite||(C.value="未设置默认站点"),q.value=e.data.sites,q.value.unshift({name:"未设置默认站点",value:"未设置默认站点"})}catch(s){e(s)}finally{h.value=!1}})()}),(a,e)=>{const s=k,l=g,u=w,n=t,o=m("bt-loading");return c((d(),r("div",V,[e[2]||(e[2]=v("span",{class:"mr-[12px]"},"默认站点",-1)),p(l,{modelValue:i(C),"onUpdate:modelValue":e[0]||(e[0]=a=>x(C)?C.value=a:null),class:"!w-[32rem]"},{default:f(()=>[(d(!0),r(_,null,y(i(q),(a,e)=>(d(),b(s,{key:e,label:a.name,value:a.name},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),p(u,{type:"primary",onClick:H,class:"!mt-[20px] !block"},{default:f(()=>e[1]||(e[1]=[j("保存",-1)])),_:1,__:[1]}),p(n,{class:"ml-[20px] my-[20px]",options:[{content:"设置默认站点后,所有未绑定的域名和IP都被定向到默认站点"},{content:"可有效防止恶意解析"}]})])),[[o,i(h)]])}}});export{h as default};
