import{o as r,g as u,d as I,e as y,u as t,a as l,b as s,w as i,h as c,f as n,i as f,c as _,F as h,D as w,t as x}from"./app-SC54XQDl.js";import{i as V,c as g}from"./app-Ba7ZqSpq.js";import{_ as b}from"./app-CVQkwzlf.js";import{_ as v,a as p}from"./app-PrSv7rSt.js";import{_ as k}from"./app-FlPLZh9D.js";import{T as C}from"./app-CNHjdV6U.js";import{_ as P}from"./app-DZcB_Zcx.js";import{_ as U}from"./app-DK6yt561.js";import{_ as $}from"./app-D9UgVOV0.js";import{_ as D}from"./app-BUqHq_rP.js";import"./app-DnXuoh8P.js";import"./app-BZGObKCm.js";import"./app-BPIIxVwk.js";import"./app-PPG0ZS4d.js";import"./app-DgoEZtNT.js";import"./app-Ch8j4za4.js";import"./app-Dw0jKdCD.js";import"./app-CCkWSX4Q.js";import"./app-DZaelcLs.js";import"./app-DHsI_tns.js";import"./app-C8HFiBxn.js";import"./app-CukjbZvY.js";import"./app-Crd12MWL.js";import"./app-BjSCO7rC.js";import"./app-g-bJrEAS.js";import"./app-D_RBJHM6.js";import"./app-CmrRgGIA.js";import"./app-DyP4Nide.js";import"./app-D3Qbxi9D.js";import"./app-yF7sElvF.js";import"./app-CqkleIqs.js";import"./app-C28obFWS.js";import"./app-CkINxBL9.js";import"./app--Lj8zATS.js";import"./app-C2mBgI5Z.js";function T(){const{utils:d,Tea:e}=V(this);this.updateItem=function(m){d.popup(e.url(".updateIPPopup",{itemId:m}),{height:d.POPUP_HEIGHT_LG,callback:function(){d.success("保存成功",function(){d.reload()})}})},this.deleteItem=function(m){d.confirm("确定要删除这个IP吗？",function(){this.$post(".deleteIP").params({itemId:m}).refresh()})},this.readAllItems=function(){this.$post(".readAll").success(function(){d.reload()})},this.hasCheckedItems=!1,this.checkItems=function(m){this.hasCheckedItems=m},this.removeDeniedIP=function(){d.popup(".removeDeniedIPPopup",{callback:function(){d.successRefresh("操作成功")}})}}const L={action:"/waf/iplists",method:"get",class:"relative"},N={class:"ui fields inline"},B={class:"ui field"},O={class:"ui field"},A={class:"ui field"},E={class:"ui field"},F={class:"ui checkbox"},G={key:0,class:"ui field"},H={class:"ui checkbox"},R=l("span",{class:"red"},"New",-1),S={class:"ui field"},M={key:0,href:"/waf/iplists"},j={key:1,class:"ui field"},q=l("span",{class:"disabled"},"|",-1),z=[q],J={key:2,class:"ui field"},K={class:"mt-4 xl:absolute xl:mt-0 xl:right-2 xl:top-0"},De={__name:"index",setup(d){const e=g(new T);return(m,a)=>(r(),u(h,null,[I(l("form",L,[l("div",N,[l("div",B,[s(b,{name:"keyword",placeholder:"x.x.x.x",modelValue:t(e).keyword,"onUpdate:modelValue":a[0]||(a[0]=o=>t(e).keyword=o)},null,8,["modelValue"])]),l("div",O,[s(v,{name:"listType",modelValue:t(e).listType,"onUpdate:modelValue":a[1]||(a[1]=o=>t(e).listType=o)},{default:i(()=>[s(p,{value:""},{default:i(()=>[n("[所有类型]")]),_:1}),s(p,{value:"black"},{default:i(()=>[n("黑名单")]),_:1}),s(p,{value:"white"},{default:i(()=>[n("白名单")]),_:1}),s(p,{value:"grey"},{default:i(()=>[n("灰名单")]),_:1})]),_:1},8,["modelValue"])]),l("div",A,[s(v,{name:"eventLevel",modelValue:t(e).eventLevel,"onUpdate:modelValue":a[2]||(a[2]=o=>t(e).eventLevel=o)},{default:i(()=>[s(p,{value:""},{default:i(()=>[n("[所有级别]")]),_:1}),(r(!0),u(h,null,w(t(e).eventLevels,o=>(r(),_(p,{value:o.code},{default:i(()=>[n(x(o.name),1)]),_:2},1032,["value"]))),256))]),_:1},8,["modelValue"])]),l("div",E,[l("div",F,[s(k,{name:"globalOnly",value:"1",modelValue:t(e).globalOnly,"onUpdate:modelValue":a[3]||(a[3]=o=>t(e).globalOnly=o)},{default:i(()=>[n("系统自动拦截")]),_:1},8,["modelValue"])])]),t(e).countUnread>0?(r(),u("div",G,[l("div",H,[s(k,{name:"unread",value:"1",modelValue:t(e).unread,"onUpdate:modelValue":a[4]||(a[4]=o=>t(e).unread=o)},{default:i(()=>[R]),_:1},8,["modelValue"])])])):c("",!0),l("div",S,[s(C,{secondary:"",type:"submit"},{default:i(()=>[n("搜索")]),_:1}),n("   "),t(e).keyword.length>0||t(e).globalOnly||t(e).unread||t(e).eventLevel.length>0?(r(),u("a",M,"[清除条件]")):c("",!0)]),t(e).countUnread>0?(r(),u("div",j,z)):c("",!0),t(e).countUnread>0?(r(),u("div",J,[l("a",{href:"",onClick:a[5]||(a[5]=f((...o)=>t(e).readAllItems&&t(e).readAllItems(...o),["prevent"])),title:"消除未读标记New"},"[全部设为已读]")])):c("",!0)]),l("div",K,[s(D,{icon:"pi pi-lock-open",onClick:f(t(e).removeDeniedIP,["prevent"])},{default:i(()=>[n("快速解除黑名单")]),_:1},8,["onClick"])])],512),[[y,!t(e).hasCheckedItems]]),t(e).items.length==0?(r(),_($,{key:0},{default:i(()=>[n("暂时还没有IP。")]),_:1})):c("",!0),t(e).items.length>0?(r(),_(U,{key:1,"v-items":t(e).items,onUpdateItem:t(e).updateItem,onDeleteItem:t(e).deleteItem,onChecked:t(e).checkItems,"v-keyword":t(e).keyword,"v-show-search-button":!0},null,8,["v-items","onUpdateItem","onDeleteItem","onChecked","v-keyword"])):c("",!0),s(P,{data:t(e).page},null,8,["data"])],64))}};export{De as default};
