import{_ as b}from"./index-DIKmrNCq.js?v=1773287522785";import{_ as v}from"./index.vue_vue_type_script_setup_true_lang-BeO8Hyma.js?v=1773287522785";import{k as x,R as W,r as B,$ as S,Z as $,_ as e,a0 as o,ai as k,X as w,S as s,a9 as u,j as U,aa as i}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{n as A,m as C}from"./index-BTglIPU2.js?v=1773287522785";import{u as D}from"./useTableColumns-DDeyYvje.js?v=1773287522785";import{u as L}from"./useTableData-BmkIKQ_R.js?v=1773287522785";import{q as N,t as R,v as V}from"./setting-DouXuJGW.js?v=1773287522785";import{b as K,B as P}from"./naive-ui--dJnpVcV.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 T={class:"p-20px"},j={class:"flex mb-16px"},q={class:"flex-1 mr-16px"},et=x({__name:"config",setup(E){const{t:m}=W(),a=B(""),c=async()=>{if(a.value.trim()===""){C.error(m("Waf.Setting.config_81"));return}await V({text:a.value}),a.value="",r()},{table:l,columns:_,setLoading:p}=L([{key:"rule",title:"URL"},D({width:80,options:t=>[{label:m("Public.Btn.Del"),onClick:async()=>{await N({text:t.rule}),r()}}]})]),r=async()=>{try{p(!0);const{message:t}=await R();A(t)&&(l.data=t.map(n=>({rule:n})))}finally{p(!1)}};return r(),(t,n)=>{const f=K,d=P,g=v,h=b;return S(),$("div",T,[e("div",j,[e("div",q,[o(f,{value:s(a),"onUpdate:value":n[0]||(n[0]=y=>w(a)?a.value=y:null),placeholder:t.$t("Waf.Setting.config_78"),onKeyup:k(c,["enter"])},null,8,["value","placeholder"])]),o(d,{type:"primary",onClick:c},{default:u(()=>[U(i(t.$t("Public.Btn.Add")),1)]),_:1})]),o(g,{"max-height":368,loading:s(l).loading,data:s(l).data,columns:s(_)},null,8,["loading","data","columns"]),o(h,{class:"mt-16px"},{default:u(()=>[e("li",null,i(t.$t("Waf.Setting.config_77")),1),e("li",null,i(t.$t("Waf.Setting.config_79")),1),e("li",null,i(t.$t("Waf.Setting.config_80")),1)]),_:1})])}}});export{et as default};
