import{_ as N}from"./index-DIKmrNCq.js?v=1773287522785";import{_ as W}from"./index.vue_vue_type_script_setup_true_lang-BeO8Hyma.js?v=1773287522785";import{n as b,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,z as U}from"./site-D0zX56Uh.js?v=1773287522785";import{b as A,B as P}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{k as V,R as D,e as R,$ as L,Z as T,_ as i,a0 as o,S as n,a9 as v,j,aa as l}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 z={class:"p-20px"},E={class:"flex mb-16px"},I={class:"flex-1 mr-16px"},Z={class:"w-110px mr-16px"},q={class:"w-110px mr-32px"},_="url_tell",ne=V({__name:"protect",props:{siteName:{default:""}},setup(x){const m=x,{t:s}=D(),e=R({uri:"",name:"",value:""}),C=async()=>{if(e.uri.trim()===""||e.name.trim()===""||e.value.trim()===""){$.error(s("Waf.Site.Config.index_95"));return}await U({siteName:m.siteName,ruleName:_,ruleUri:e.uri,ruleValue:e.name,rulePass:e.value}),e.uri="",e.name="",e.value="",d()},{table:p,columns:S,setLoading:g}=w([{key:"uri",title:s("Waf.Site.Config.index_96")},{key:"name",title:s("Waf.Site.Config.index_89")},{key:"value",title:s("Waf.Site.Config.index_90")},h({width:80,options:(t,a)=>[{label:s("Public.Btn.Del"),onClick:async()=>{await k({index:a,siteName:m.siteName,ruleName:_}),d()}}]})]),d=async()=>{try{g(!0);const{siteName:t}=m,{message:a}=await B({siteName:t,ruleName:_});b(a)&&(p.data=a.map(([r,f,c])=>({uri:r,name:f,value:c})))}finally{g(!1)}};return d(),(t,a)=>{const r=A,f=P,c=W,y=N;return L(),T("div",z,[i("div",E,[i("div",I,[o(r,{value:n(e).uri,"onUpdate:value":a[0]||(a[0]=u=>n(e).uri=u),placeholder:t.$t("Waf.Site.Config.index_88")},null,8,["value","placeholder"])]),i("div",Z,[o(r,{value:n(e).name,"onUpdate:value":a[1]||(a[1]=u=>n(e).name=u),placeholder:t.$t("Waf.Site.Config.index_89")},null,8,["value","placeholder"])]),i("div",q,[o(r,{value:n(e).value,"onUpdate:value":a[2]||(a[2]=u=>n(e).value=u),placeholder:t.$t("Waf.Site.Config.index_90")},null,8,["value","placeholder"])]),o(f,{type:"primary",onClick:C},{default:v(()=>[j(l(t.$t("Public.Btn.Add")),1)]),_:1})]),o(c,{"max-height":250,loading:n(p).loading,data:n(p).data,columns:n(S)},null,8,["loading","data","columns"]),o(y,{class:"mt-16px"},{default:v(()=>[i("li",null,l(t.$t("Waf.Site.Config.index_91")),1),i("li",null,l(t.$t("Waf.Site.Config.index_81")),1),i("li",null,l(t.$t("Waf.Site.Config.index_92")),1),i("li",null,l(t.$t("Waf.Site.Config.index_93")),1),i("li",null,l(t.$t("Waf.Site.Config.index_94")),1)]),_:1})])}}});export{ne as default};
