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