import{_ as y}from"./index-DIKmrNCq.js?v=1773287522785";import{_ as C}from"./index.vue_vue_type_script_setup_true_lang-BeO8Hyma.js?v=1773287522785";import{n as N,m as S}from"./index-BTglIPU2.js?v=1773287522785";import{u as B}from"./useTableData-BmkIKQ_R.js?v=1773287522785";import{t as k,u as w,v as $}from"./site-D0zX56Uh.js?v=1773287522785";import{u as A}from"./useTableColumns-DDeyYvje.js?v=1773287522785";import{b as H,B as D}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{k as V,R as W,r as L,$ as P,Z as R,_ as m,a0 as o,X as T,S as n,a9 as p,j,aa as _}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import"./data-BVsViUMm.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./index-S15tYq5l.js?v=1773287522785";import"./copy-D-wIKr0q.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-DeTfbeeM.js?v=1773287522785";import"./index-Cg6fMjw6.js?v=1773287522785";const E={class:"p-20px"},I={class:"flex mb-16px"},U={class:"flex-1 mr-16px"},ae=V({__name:"index",props:{siteName:{default:""}},setup(u){const s=u,{t:d}=W(),t=L(""),f=async()=>{if(t.value.trim()===""){S.error(d("Waf.Site.Config.index_61"));return}await $({siteName:s.siteName,cdn_header:t.value}),r()},{table:i,columns:g,setLoading:c}=B([{key:"header",title:"Header"},A({width:80,options:e=>[{label:d("Public.Btn.Del"),onClick:async()=>{await k({siteName:s.siteName,cdn_header:e.header}),r()}}]})]),r=async()=>{try{c(!0);const{siteName:e}=s,{message:a}=await w({siteName:e});N(a)&&(i.data=a.map(l=>({header:l})))}finally{c(!1)}};return r(),(e,a)=>{const l=H,h=D,x=C,b=y;return P(),R("div",E,[m("div",I,[m("div",U,[o(l,{value:n(t),"onUpdate:value":a[0]||(a[0]=v=>T(t)?t.value=v:null),placeholder:e.$t("Waf.Site.Config.index_59")},null,8,["value","placeholder"])]),o(h,{type:"primary",onClick:f},{default:p(()=>[j(_(e.$t("Public.Btn.Add")),1)]),_:1})]),o(x,{"max-height":368,loading:n(i).loading,data:n(i).data,columns:n(g)},null,8,["loading","data","columns"]),o(b,{class:"mt-16px"},{default:p(()=>[m("li",null,_(e.$t("Waf.Site.Config.index_60")),1)]),_:1})])}}});export{ae as default};
