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-BYcXwl4U.js";import{i as V,c as g}from"./app-a6cKceqE.js";import{_ as b}from"./app-Ufpj4Ll4.js";import{_ as v,a as p}from"./app-DxbU-QrX.js";import{_ as k}from"./app-DwtlHtUX.js";import{T as C}from"./app-CrjU8lgK.js";import{_ as P}from"./app-BsFusN7_.js";import{_ as U}from"./app-DvvLeaLT.js";import{_ as $}from"./app-uhTxLRnQ.js";import{_ as D}from"./app-DmX24te2.js";import"./app-ysQ8KbGS.js";import"./app-Cp3gmk2J.js";import"./app--MWyBMkA.js";import"./app-BG60hdvp.js";import"./app-CNARLpXE.js";import"./app-SxAW7vhf.js";import"./app-D5k1HLu9.js";import"./app-BDgR0DSb.js";import"./app-BHl80pFw.js";import"./app-CJCAnMrx.js";import"./app-Cc2zXvHs.js";import"./app-DwDoXV5j.js";import"./app-W_y7sflh.js";import"./app-DPDEogA0.js";import"./app-aSafd0Me.js";import"./app-Btbk6LWy.js";import"./app-CrkKi1Ag.js";import"./app-u5shTDG_.js";import"./app-VC1SYszA.js";import"./app-yF7sElvF.js";import"./app-CqkleIqs.js";import"./app-CO4sV-Ic.js";import"./app-yt37eDzA.js";import"./app-BQ5ggxk2.js";import"./app-D3zbrzdO.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};
