import{c as a,f as e,h as s,_ as l}from"./public.js?v=1764830988434";import{k as t,P as i,r as n,R as o,V as m,S as r,W as u,aj as d,ak as p,U as c,a3 as f,j as x,a4 as _}from"./vue.js?v=1764830988434";import{x as g,m as v}from"./page_layout.js?v=1764830988434";import{w as y,x as j,y as N}from"./site3.js?v=1764830988434";import{au as b,aC as C}from"./naive.js?v=1764830988434";import"./common.js?v=1764830988434";import"./__commonjsHelpers__.js?v=1764830988434";const h={class:"p-20px"},S={class:"flex mb-16px"},W={class:"flex-1 mr-16px"},k="disable_path",w=t({__name:"disable",props:{siteName:{default:""}},setup(t){const w=t,{t:$}=i(),P=n(""),B=async()=>{""!==P.value.trim()?(await N({siteName:w.siteName,ruleName:k,ruleValue:P.value}),P.value="",D()):v.error($("Waf.Site.Config.index_70"))},{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:k}),D()}}]})]),D=async()=>{try{A(!0);const{siteName:a}=w,{message:e}=await j({siteName:a,ruleName:k});g(e)&&(U.data=e.map(a=>({rule:a})))}finally{A(!1)}};return D(),(a,e)=>{const t=b,i=C,n=s,g=l;return m(),o("div",h,[r("div",S,[r("div",W,[u(t,{value:c(P),"onUpdate:value":e[0]||(e[0]=a=>p(P)?P.value=a:null),placeholder:a.$t("Waf.Site.Config.index_67"),onKeyup:d(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:c(U).loading,data:c(U).data,columns:c(V)},null,8,["loading","data","columns"]),u(g,{class:"mt-16px"},{default:f(()=>[r("li",null,_(a.$t("Waf.Site.Config.index_68")),1),r("li",null,_(a.$t("Waf.Site.Config.index_69")),1)]),_:1})])}}});export{w as default};
