import{c as a,f as e,h as l,_ as i}from"./public.js?v=1763625242172";import{x as t,m as n}from"./page_layout.js?v=1763625242172";import{w as s,x as u,z as o}from"./site3.js?v=1763625242172";import{au as r,aC as m}from"./naive.js?v=1763625242172";import{k as d,P as f,e as p,R as c,S as x,U as v,X as _,V as g,a3 as C,j as S,a4 as W}from"./vue.js?v=1763625242172";import"./common.js?v=1763625242172";import"./__commonjsHelpers__.js?v=1763625242172";const y={class:"p-20px"},h={class:"flex mb-16px"},N={class:"flex-1 mr-16px"},j={class:"w-110px mr-16px"},$={class:"w-110px mr-32px"},w="url_tell",b=d({__name:"protect",props:{siteName:{default:""}},setup(d){const b=d,{t:k}=f(),U=p({uri:"",name:"",value:""}),P=async()=>{""!==U.uri.trim()&&""!==U.name.trim()&&""!==U.value.trim()?(await o({siteName:b.siteName,ruleName:w,ruleUri:U.uri,ruleValue:U.name,rulePass:U.value}),U.uri="",U.name="",U.value="",A()):n.error(k("Waf.Site.Config.index_95"))},{table:B,columns:V,setLoading:z}=a([{key:"uri",title:k("Waf.Site.Config.index_96")},{key:"name",title:k("Waf.Site.Config.index_89")},{key:"value",title:k("Waf.Site.Config.index_90")},e({width:80,options:(a,e)=>[{label:k("Public.Btn.Del"),onClick:async()=>{await s({index:e,siteName:b.siteName,ruleName:w}),A()}}]})]),A=async()=>{try{z(!0);const{siteName:a}=b,{message:e}=await u({siteName:a,ruleName:w});t(e)&&(B.data=e.map((([a,e,l])=>({uri:a,name:e,value:l}))))}finally{z(!1)}};return A(),(a,e)=>{const t=r,n=m,s=l,u=i;return c(),x("div",y,[v("div",h,[v("div",N,[_(t,{value:g(U).uri,"onUpdate:value":e[0]||(e[0]=a=>g(U).uri=a),placeholder:a.$t("Waf.Site.Config.index_88")},null,8,["value","placeholder"])]),v("div",j,[_(t,{value:g(U).name,"onUpdate:value":e[1]||(e[1]=a=>g(U).name=a),placeholder:a.$t("Waf.Site.Config.index_89")},null,8,["value","placeholder"])]),v("div",$,[_(t,{value:g(U).value,"onUpdate:value":e[2]||(e[2]=a=>g(U).value=a),placeholder:a.$t("Waf.Site.Config.index_90")},null,8,["value","placeholder"])]),_(n,{type:"primary",onClick:P},{default:C((()=>[S(W(a.$t("Public.Btn.Add")),1)])),_:1})]),_(s,{"max-height":250,loading:g(B).loading,data:g(B).data,columns:g(V)},null,8,["loading","data","columns"]),_(u,{class:"mt-16px"},{default:C((()=>[v("li",null,W(a.$t("Waf.Site.Config.index_91")),1),v("li",null,W(a.$t("Waf.Site.Config.index_81")),1),v("li",null,W(a.$t("Waf.Site.Config.index_92")),1),v("li",null,W(a.$t("Waf.Site.Config.index_93")),1),v("li",null,W(a.$t("Waf.Site.Config.index_94")),1)])),_:1})])}}});export{b as default};
