import{b as a,h as e,f as l,_ as i}from"./public.js?v=1753954525509";import{w as t,m as n}from"./page_layout.js?v=1753954525509";import{w as s,x as o,z as u}from"./site3.js?v=1753954525509";import{aq as r,ay as m}from"./naive.js?v=1753954525509";import{k as d,P as f,e as p,U as c,V as x,W as v,Q as _,X as g,a2 as C,j as W,a3 as y}from"./vue.js?v=1753954525509";import"./common.js?v=1753954525509";import"./__commonjsHelpers__.js?v=1753954525509";const S={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 u({siteName:b.siteName,ruleName:w,ruleUri:U.uri,ruleValue:U.name,rulePass:U.value}),U.uri="",U.name="",U.value="",z()):n.error(k("Waf.Site.Config.index_95"))},{table:B,columns:V,setLoading:q}=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}),z()}}]})]),z=async()=>{try{q(!0);const{siteName:a}=b,{message:e}=await o({siteName:a,ruleName:w});t(e)&&(B.data=e.map((([a,e,l])=>({uri:a,name:e,value:l}))))}finally{q(!1)}};return z(),(a,e)=>{const t=r,n=m,s=l,o=i;return c(),x("div",S,[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((()=>[W(y(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"]),_(o,{class:"mt-16px"},{default:C((()=>[v("li",null,y(a.$t("Waf.Site.Config.index_91")),1),v("li",null,y(a.$t("Waf.Site.Config.index_81")),1),v("li",null,y(a.$t("Waf.Site.Config.index_92")),1),v("li",null,y(a.$t("Waf.Site.Config.index_93")),1),v("li",null,y(a.$t("Waf.Site.Config.index_94")),1)])),_:1})])}}});export{b as default};
