import{c as a,f as t,h as l,_ as s}from"./public.js?v=1763625242172";import{k as e,P as n,r as i,R as o,S as r,U as u,X as c,V as m,aj as p,ak as f,a3 as d,j as g,a4 as _}from"./vue.js?v=1763625242172";import{x as v,m as x}from"./page_layout.js?v=1763625242172";import{q as j,t as y,v as b}from"./setting.js?v=1763625242172";import{au as h,aC as S}from"./naive.js?v=1763625242172";import"./common.js?v=1763625242172";import"./__commonjsHelpers__.js?v=1763625242172";const k={class:"p-20px"},W={class:"flex mb-16px"},$={class:"flex-1 mr-16px"},w=e({__name:"config",setup(e){const{t:w}=n(),C=i(""),P=async()=>{""!==C.value.trim()?(await b({text:C.value}),C.value="",R()):x.error(w("Waf.Setting.config_81"))},{table:U,columns:B,setLoading:L}=a([{key:"rule",title:"URL"},t({width:80,options:a=>[{label:w("Public.Btn.Del"),onClick:async()=>{await j({text:a.rule}),R()}}]})]),R=async()=>{try{L(!0);const{message:a}=await y();v(a)&&(U.data=a.map((a=>({rule:a}))))}finally{L(!1)}};return R(),(a,t)=>{const e=h,n=S,i=l,v=s;return o(),r("div",k,[u("div",W,[u("div",$,[c(e,{value:m(C),"onUpdate:value":t[0]||(t[0]=a=>p(C)?C.value=a:null),placeholder:a.$t("Waf.Setting.config_78"),onKeyup:f(P,["enter"])},null,8,["value","placeholder"])]),c(n,{type:"primary",onClick:P},{default:d((()=>[g(_(a.$t("Public.Btn.Add")),1)])),_:1})]),c(i,{"max-height":368,loading:m(U).loading,data:m(U).data,columns:m(B)},null,8,["loading","data","columns"]),c(v,{class:"mt-16px"},{default:d((()=>[u("li",null,_(a.$t("Waf.Setting.config_77")),1),u("li",null,_(a.$t("Waf.Setting.config_79")),1),u("li",null,_(a.$t("Waf.Setting.config_80")),1)])),_:1})])}}});export{w as default};
