import{c as a,f as e,h as s,_ as t}from"./public.js?v=1763625242172";import{x as i,m as l}from"./page_layout.js?v=1763625242172";import{t as o,u as n,v as m}from"./site3.js?v=1763625242172";import{au as r,aC as d}from"./naive.js?v=1763625242172";import{k as u,P as c,r as p,R as f,S as _,U as x,X as v,V as h,aj as g,a3 as j,j as y,a4 as N}from"./vue.js?v=1763625242172";import"./common.js?v=1763625242172";import"./__commonjsHelpers__.js?v=1763625242172";const b={class:"p-20px"},C={class:"flex mb-16px"},k={class:"flex-1 mr-16px"},w=u({__name:"index",props:{siteName:{default:""}},setup(u){const w=u,{t:S}=c(),P=p(""),W=async()=>{""!==P.value.trim()?(await m({siteName:w.siteName,cdn_header:P.value}),U()):l.error(S("Waf.Site.Config.index_61"))},{table:$,columns:B,setLoading:H}=a([{key:"header",title:"Header"},e({width:80,options:a=>[{label:S("Public.Btn.Del"),onClick:async()=>{await o({siteName:w.siteName,cdn_header:a.header}),U()}}]})]),U=async()=>{try{H(!0);const{siteName:a}=w,{message:e}=await n({siteName:a});i(e)&&($.data=e.map((a=>({header:a}))))}finally{H(!1)}};return U(),(a,e)=>{const i=r,l=d,o=s,n=t;return f(),_("div",b,[x("div",C,[x("div",k,[v(i,{value:h(P),"onUpdate:value":e[0]||(e[0]=a=>g(P)?P.value=a:null),placeholder:a.$t("Waf.Site.Config.index_59")},null,8,["value","placeholder"])]),v(l,{type:"primary",onClick:W},{default:j((()=>[y(N(a.$t("Public.Btn.Add")),1)])),_:1})]),v(o,{"max-height":368,loading:h($).loading,data:h($).data,columns:h(B)},null,8,["loading","data","columns"]),v(n,{class:"mt-16px"},{default:j((()=>[x("li",null,N(a.$t("Waf.Site.Config.index_60")),1)])),_:1})])}}});export{w as default};
