import{_ as v}from"./index-DIKmrNCq.js?v=1773287522785";import{_ as y}from"./index.vue_vue_type_script_setup_true_lang-BeO8Hyma.js?v=1773287522785";import{n as W,m as $}from"./index-BTglIPU2.js?v=1773287522785";import{u as h}from"./useTableColumns-DDeyYvje.js?v=1773287522785";import{u as w}from"./useTableData-BmkIKQ_R.js?v=1773287522785";import{w as k,x as B,A}from"./site-D0zX56Uh.js?v=1773287522785";import{b as U,B as V}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{k as D,R,e as L,$ as P,Z as T,_ as i,a0 as l,S as n,a9 as x,j,aa as o}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import"./data-BVsViUMm.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./index-S15tYq5l.js?v=1773287522785";import"./copy-D-wIKr0q.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-DeTfbeeM.js?v=1773287522785";import"./index-Cg6fMjw6.js?v=1773287522785";const E={class:"p-20px"},F={class:"flex mb-16px"},I={class:"flex-1 mr-16px"},Z={class:"w-230px mr-16px"},_="url_rule",ie=D({__name:"filter",props:{siteName:{default:""}},setup(C){const m=C,{t:s}=R(),t=L({url:"",filter:""}),S=async()=>{if(t.url.trim()===""||t.filter.trim()===""){$.error(s("Waf.Site.Config.index_85"));return}await A({siteName:m.siteName,ruleName:_,ruleUri:t.url,ruleValue:t.filter}),t.url="",t.filter="",f()},{table:u,columns:N,setLoading:g}=w([{key:"uri",title:s("Waf.Site.Config.index_86")},{key:"name",title:s("Waf.Site.Config.index_87")},h({width:80,options:(e,a)=>[{label:s("Public.Btn.Del"),onClick:async()=>{await k({index:a,siteName:m.siteName,ruleName:_}),f()}}]})]),f=async()=>{try{g(!0);const{siteName:e}=m,{message:a}=await B({siteName:e,ruleName:_});W(a)&&(u.data=a.map(([r,p,d])=>({uri:r,name:p,value:d})))}finally{g(!1)}};return f(),(e,a)=>{const r=U,p=V,d=y,b=v;return P(),T("div",E,[i("div",F,[i("div",I,[l(r,{value:n(t).url,"onUpdate:value":a[0]||(a[0]=c=>n(t).url=c),placeholder:e.$t("Waf.Site.Config.index_67")},null,8,["value","placeholder"])]),i("div",Z,[l(r,{value:n(t).filter,"onUpdate:value":a[1]||(a[1]=c=>n(t).filter=c),placeholder:e.$t("Waf.Site.Config.index_79")},null,8,["value","placeholder"])]),l(p,{type:"primary",onClick:S},{default:x(()=>[j(o(e.$t("Public.Btn.Add")),1)]),_:1})]),l(d,{"max-height":230,loading:n(u).loading,data:n(u).data,columns:n(N)},null,8,["loading","data","columns"]),l(b,{class:"mt-16px"},{default:x(()=>[i("li",null,o(e.$t("Waf.Site.Config.index_80")),1),i("li",null,o(e.$t("Waf.Site.Config.index_81")),1),i("li",null,o(e.$t("Waf.Site.Config.index_82")),1),i("li",null,o(e.$t("Waf.Site.Config.index_83")),1),i("li",null,o(e.$t("Waf.Site.Config.index_84")),1)]),_:1})])}}});export{ie as default};
