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