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