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-DnroACXc.js";import{i as V,c as g}from"./app-DckefXYL.js";import{_ as b}from"./app-DPkDcD7h.js";import{_ as v,a as p}from"./app-DntYVxd7.js";import{_ as k}from"./app-BbRQPmFH.js";import{T as C}from"./app-LqsmzyUT.js";import{_ as P}from"./app-CjXr3cCY.js";import{_ as U}from"./app-CkWIpBVL.js";import{_ as $}from"./app-DezwSKU9.js";import{_ as D}from"./app-Dum_NU1V.js";import"./app-CF0qXH5Q.js";import"./app-BJhJ7lM8.js";import"./app-Dd07dUxy.js";import"./app-CYYQ_Zep.js";import"./app-Dpl5YSiv.js";import"./app-CF8nmC-F.js";import"./app-NVAx7Sc3.js";import"./app-xECxwo4T.js";import"./app-B4bUdtyo.js";import"./app-uFawAv7F.js";import"./app-BtWF1kMA.js";import"./app-rBrER_c4.js";import"./app-DM6WPmnv.js";import"./app-B0NrURRk.js";import"./app-CGj1gg44.js";import"./app-BeuOvIof.js";import"./app-DSjO_8RR.js";import"./app-CZGZgDLc.js";import"./app-DFy7dJHP.js";import"./app-yF7sElvF.js";import"./app-CqkleIqs.js";import"./app-R-vSvFIF.js";import"./app-HaDoyrq5.js";import"./app-Cmxxk_WX.js";import"./app-B09rlSqG.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};
