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