const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["js/index231.js?v=1764233927359","js/page_layout.js?v=1764233927359","js/vue.js?v=1764233927359","js/__commonjsHelpers__.js?v=1764233927359","js/naive.js?v=1764233927359","js/common.js?v=1764233927359","js/public.js?v=1764233927359","css/public.css?v=1764233927359","css/page_layout.css?v=1764233927359","css/index97.css?v=1764233927359"])))=>i.map(i=>d[i]);
import{dO as t,dP as e,dQ as a,g as s,dR as i,dS as o,d as n,a as d}from"./page_layout.js?v=1764233927359";import{_ as l}from"./index.js?v=1764233927359";import{e as r,c as m,n as u,f as c,a as p,h as _,_ as f}from"./public.js?v=1764233927359";import{_ as h}from"./index.vue_vue_type_script_setup_true_lang5.js?v=1764233927359";import{dd as y,aC as C,dS as x}from"./naive.js?v=1764233927359";import{k as w,P as W,W as g,a2 as j,V as b,a3 as v,U as k,j as E,a4 as O,S as P,_ as S,u as V}from"./vue.js?v=1764233927359";import"./common.js?v=1764233927359";import"./__commonjsHelpers__.js?v=1764233927359";import"./index.vue_vue_type_script_setup_true_lang6.js?v=1764233927359";const B=w({__name:"index",setup(w){const B=S(()=>d(()=>import("./index231.js?v=1764233927359"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))),{t:L}=W(),R=t(),$=r("",{isEdit:!1,onRefresh:()=>{M()}}),A=()=>{$.data.isEdit=!1,$.data.row=void 0,$.title=L("Waf.Custom.index_4"),$.show=!0},{table:D,columns:U,setLoading:z}=m([{key:"name",title:L("Waf.Custom.index_6"),minWidth:160,ellipsis:{tooltip:!0}},{key:"servers",title:L("Waf.Custom.index_7"),width:"20%",minWidth:260,ellipsis:{tooltip:!0},render:({servers:t})=>R.getSiteName(t)},u({width:"10%",minWidth:100,status:t=>({checkedValue:1,uncheckedValue:0,onClick:async a=>{await e({id:t.id,status:a}),t.status=a}})}),{key:"hit",title:L("Waf.Custom.index_8"),width:"10%",minWidth:100,render:({hit:t})=>{return g(y,{size:"small",type:t>0?"success":"default",bordered:!1},"function"==typeof(e=t)||"[object Object]"===Object.prototype.toString.call(e)&&!V(e)?t:{default:()=>[t]});var e}},{key:"root",title:L("Waf.Custom.index_9"),width:"20%",minWidth:160,render:({root:t})=>R.getMatchCondition(t)},{key:"action",title:L("Waf.Custom.index_10"),width:"20%",minWidth:160,render:({action:t})=>{var e;return R.getExecuteAction(t.type,(null==(e=t.response)?void 0:e.type)||"")}},c({width:140,options:t=>[{label:L("Public.Btn.Copy"),onClick:()=>{H(t)}},{label:L("Public.Btn.Edit"),onClick:()=>{(t=>{$.data.isEdit=!0,$.data.row=t,$.title=L("Waf.Custom.index_5",[t.name]),$.show=!0})(t)}},{label:L("Public.Btn.Del"),onClick:()=>{I(t)}}]})]),H=t=>{p({title:L("Waf.Custom.index_11",[t.name]),content:L("Waf.Custom.index_12"),onConfirm:async()=>{await a({name:"".concat(t.name,"_copy_").concat(s(6)),servers:t.servers?t.servers:[],status:1,is_global:0,priority:0,root:t.root,action:{type:t.action.type,response:Object.assign({},t.action.response,{headers:{}})}}),M()}})},I=t=>{p({title:L("Waf.Custom.index_13",[t.name]),content:L("Waf.Custom.index_14"),onConfirm:async()=>{await i({id:t.id}),M()}})},M=async()=>{try{z(!0);const{message:t}=await o();n(t)&&t.rules&&(D.data=Object.entries(t.rules).map(([t,e])=>({...e,id:t})))}finally{z(!1)}};return(async()=>{try{z(!0),await R.getConfig(),await M()}finally{z(!1)}})(),(t,e)=>{const a=C,s=_,i=h,o=f,n=l,d=x;return b(),j(d,{class:"p-16px"},{default:v(()=>[g(i,null,{toolsLeft:v(()=>[g(a,{type:"primary",onClick:A},{default:v(()=>[E(O(t.$t("Waf.Custom.index_1")),1)]),_:1})]),table:v(()=>[g(s,{loading:k(D).loading,data:k(D).data,columns:k(U)},null,8,["loading","data","columns"])]),_:1}),g(o,{class:"mt-20px"},{default:v(()=>[P("li",null,O(t.$t("Waf.Custom.index_2")),1),P("li",null,O(t.$t("Waf.Custom.index_3")),1)]),_:1}),g(n,{show:k($).show,"onUpdate:show":e[0]||(e[0]=t=>k($).show=t),title:k($).title,data:k($).data,width:800,"min-height":448,footer:!0,component:k(B)},null,8,["show","title","data","component"])]),_:1})}}});export{B as default};
