import{b as a,h as e,f as l,_ as i}from"./public.js?v=1753954525509";import{w as t,m as s}from"./page_layout.js?v=1753954525509";import{w as n,x as r,A as o}from"./site3.js?v=1753954525509";import{aq as u,ay as m}from"./naive.js?v=1753954525509";import{k as f,P as d,e as p,U as c,V as x,W as _,Q as g,X as v,a2 as C,j as y,a3 as W}from"./vue.js?v=1753954525509";import"./common.js?v=1753954525509";import"./__commonjsHelpers__.js?v=1753954525509";const N={class:"p-20px"},S={class:"flex mb-16px"},j={class:"flex-1 mr-16px"},h={class:"w-230px mr-16px"},$="url_rule",b=f({__name:"filter",props:{siteName:{default:""}},setup(f){const b=f,{t:w}=d(),k=p({url:"",filter:""}),U=async()=>{""!==k.url.trim()&&""!==k.filter.trim()?(await o({siteName:b.siteName,ruleName:$,ruleUri:k.url,ruleValue:k.filter}),k.url="",k.filter="",V()):s.error(w("Waf.Site.Config.index_85"))},{table:P,columns:A,setLoading:B}=a([{key:"uri",title:w("Waf.Site.Config.index_86")},{key:"name",title:w("Waf.Site.Config.index_87")},e({width:80,options:(a,e)=>[{label:w("Public.Btn.Del"),onClick:async()=>{await n({index:e,siteName:b.siteName,ruleName:$}),V()}}]})]),V=async()=>{try{B(!0);const{siteName:a}=b,{message:e}=await r({siteName:a,ruleName:$});t(e)&&(P.data=e.map((([a,e,l])=>({uri:a,name:e,value:l}))))}finally{B(!1)}};return V(),(a,e)=>{const t=u,s=m,n=l,r=i;return c(),x("div",N,[_("div",S,[_("div",j,[g(t,{value:v(k).url,"onUpdate:value":e[0]||(e[0]=a=>v(k).url=a),placeholder:a.$t("Waf.Site.Config.index_67")},null,8,["value","placeholder"])]),_("div",h,[g(t,{value:v(k).filter,"onUpdate:value":e[1]||(e[1]=a=>v(k).filter=a),placeholder:a.$t("Waf.Site.Config.index_79")},null,8,["value","placeholder"])]),g(s,{type:"primary",onClick:U},{default:C((()=>[y(W(a.$t("Public.Btn.Add")),1)])),_:1})]),g(n,{"max-height":230,loading:v(P).loading,data:v(P).data,columns:v(A)},null,8,["loading","data","columns"]),g(r,{class:"mt-16px"},{default:C((()=>[_("li",null,W(a.$t("Waf.Site.Config.index_80")),1),_("li",null,W(a.$t("Waf.Site.Config.index_81")),1),_("li",null,W(a.$t("Waf.Site.Config.index_82")),1),_("li",null,W(a.$t("Waf.Site.Config.index_83")),1),_("li",null,W(a.$t("Waf.Site.Config.index_84")),1)])),_:1})])}}});export{b as default};
