import{b as a,h as e,f as s,_ as l}from"./public.js?v=1753954525509";import{k as t,P as i,r as n,U as o,V as m,W as r,Q as u,X as d,ah as p,at as c,a2 as f,j as x,a3 as _}from"./vue.js?v=1753954525509";import{w as g,m as v}from"./page_layout.js?v=1753954525509";import{w as y,x as N,y as j}from"./site3.js?v=1753954525509";import{aq as b,ay as h}from"./naive.js?v=1753954525509";import"./common.js?v=1753954525509";import"./__commonjsHelpers__.js?v=1753954525509";const C={class:"p-20px"},w={class:"flex mb-16px"},W={class:"flex-1 mr-16px"},S="disable_upload_ext",k=t({__name:"index",props:{siteName:{default:""}},setup(t){const k=t,{t:$}=i(),P=n(""),B=async()=>{""!==P.value.trim()?(await j({siteName:k.siteName,ruleName:S,ruleValue:P.value}),P.value="",A()):v.error($("Waf.Site.Config.index_65"))},{table:U,columns:V,setLoading:q}=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:k.siteName,ruleName:S}),A()}}]})]),A=async()=>{try{q(!0);const{siteName:a}=k,{message:e}=await N({siteName:a,ruleName:S});g(e)&&(U.data=e.map((a=>({rule:a}))))}finally{q(!1)}};return A(),(a,e)=>{const t=b,i=h,n=s,g=l;return o(),m("div",C,[r("div",w,[r("div",W,[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{k as default};
