import{c as a,f as e,h as l,_ as i}from"./public.js?v=1763625242172";import{x as t,m as s}from"./page_layout.js?v=1763625242172";import{w as n,x as r,A as o}from"./site3.js?v=1763625242172";import{au as u,aC as m}from"./naive.js?v=1763625242172";import{k as f,P as d,e as p,R as c,S as x,U as _,X as g,V as v,a3 as C,j as S,a4 as y}from"./vue.js?v=1763625242172";import"./common.js?v=1763625242172";import"./__commonjsHelpers__.js?v=1763625242172";const N={class:"p-20px"},W={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",W,[_("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((()=>[S(y(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,y(a.$t("Waf.Site.Config.index_80")),1),_("li",null,y(a.$t("Waf.Site.Config.index_81")),1),_("li",null,y(a.$t("Waf.Site.Config.index_82")),1),_("li",null,y(a.$t("Waf.Site.Config.index_83")),1),_("li",null,y(a.$t("Waf.Site.Config.index_84")),1)])),_:1})])}}});export{b as default};
