import{o as s,g as o,t as a,f as r,h as l,c as v,w as d,u as t,b as u,a as i,i as _}from"./app-BYcXwl4U.js";import{i as f,c as y}from"./app-a6cKceqE.js";import{_ as I}from"./app-DStQB5ZD.js";import{_ as k}from"./app-C3oVnfUH.js";import{W as $}from"./app-D7QVa3_6.js";import{_ as g}from"./app-B8JChEZz.js";import{_ as w}from"./app-CQ-vNlMj.js";import{_ as P}from"./app-CignoBaV.js";import{_ as T}from"./app-Ufpj4Ll4.js";import{D as x}from"./app-7GBSHA5C.js";import"./app-DCd54JMo.js";import"./app-MrAtUXr3.js";import"./app-BWSI2Z1R.js";import"./app-DPDEogA0.js";import"./app-DxjODhok.js";import"./app-CabATHnR.js";import"./app-BhzV4gWo.js";import"./app-CLawzVMq.js";import"./app-BeFNDz9n.js";import"./app-BDgR0DSb.js";import"./app-CO4sV-Ic.js";import"./app-yt37eDzA.js";import"./app-BG60hdvp.js";import"./app-BQ5ggxk2.js";import"./app-SxAW7vhf.js";import"./app-D3zbrzdO.js";import"./app-CrjU8lgK.js";import"./app-ysQ8KbGS.js";function C(){const{utils:m,Tea:e}=f(this);this.ip="",this.result={isDone:!1,isOk:!1,isFound:!1,isAllowed:!1,error:"",province:null,country:null,ipItem:null,ipList:null},this.$delay(function(){this.$watch("ip",function(){this.result.isDone=!1})}),this.success=function(c){this.result=c.data.result},this.updateItem=function(c,n){m.popup(e.url(".updateIPPopup?listId="+c,{itemId:n}),{height:m.POPUP_HEIGHT_LG,callback:function(){m.success("保存成功",function(){})}})}}const N={key:0},V={key:1},b={key:0},D={key:1},O={key:0},F={key:2},h={__name:"IPItemText",props:["v-item"],setup(m){return(e,c)=>(s(),o("span",null,[e.vItem.type=="all"?(s(),o("span",N,"*")):(s(),o("span",V,[e.vItem.value!=null&&e.vItem.value.length>0?(s(),o("span",b,a(e.vItem.value),1)):(s(),o("span",D,[r(a(e.vItem.ipFrom)+" ",1),e.vItem.ipTo!=null&&e.vItem.ipTo.length>0?(s(),o("span",O,"- "+a(e.vItem.ipTo),1)):l("",!0)]))])),e.vItem.eventLevelName!=null&&e.vItem.eventLevelName.length>0?(s(),o("span",F,"  级别："+a(e.vItem.eventLevelName),1)):l("",!0)]))}},L={key:0},B={key:1},W=["href"],A=["value"],S=i("td",{class:"title"},"IP *",-1),E=i("p",{class:"comment"},"要检查的IP",-1),G=i("td",null,"检查结果",-1),H={key:0},M={key:0},U={class:"red"},R={key:1},j={key:0},q={key:0},z={key:0,class:"green"},J=i("i",{class:"icon pencil small"},null,-1),K=[J],Q={key:1,class:"grey"},X=i("i",{class:"icon pencil small"},null,-1),Y=[X],Z={key:1},ee={class:"red"},te=i("i",{class:"icon pencil small"},null,-1),se=[te],ie={key:1},oe={class:"red"},le={key:2},ne={class:"red"},re={key:2},We={__name:"test",setup(m){const e=y(new C);return(c,n)=>(s(),v(k,{ctx:t(e)},{default:d(()=>[u(I,{ctx:t(e),"active-tab":"test"},null,8,["ctx"]),t(e).featureIsOn?l("",!0):(s(),o("div",L,[u(g)])),t(e).featureIsOn?(s(),o("div",B,[t(e).wafIsOn?l("",!0):(s(),v($,{key:0},{default:d(()=>[r("当前WAF未启用，设置将在"),i("a",{href:"/servers/server/settings/waf?serverId="+t(e).serverId},"[启用Web防火墙]",8,W),r("后生效。 ")]),_:1})),u(w,{action:"$",onSuccess:t(e).success},{default:d(()=>[i("input",{type:"hidden",name:"firewallPolicyId",value:t(e).firewallPolicyId},null,8,A),u(x,null,{default:d(()=>[i("tbody",null,[i("tr",null,[S,i("td",null,[u(T,{name:"ip",type:"text",maxlength:"100",autofocus:"",placeholder:"x.x.x.x",modelValue:t(e).ip,"onUpdate:modelValue":n[0]||(n[0]=p=>t(e).ip=p),class:"w-full"},null,8,["modelValue"]),E])]),i("tr",null,[G,i("td",null,[t(e).result.isDone?(s(),o("div",H,[t(e).result.isOk?l("",!0):(s(),o("div",M,[i("span",U,a(t(e).result.error),1)])),t(e).result.isFound?(s(),o("div",R,[t(e).result.item!=null?(s(),o("div",j,[t(e).result.isAllowed?(s(),o("div",q,[t(e).result.item.listType=="white"?(s(),o("span",z,[r("在白名单中 "),u(h,{"v-item":t(e).result.item},null,8,["v-item"]),r(" "),i("a",{href:"",onClick:n[1]||(n[1]=_(p=>t(e).updateItem(t(e).result.list.id,t(e).result.item.id),["prevent"])),title:"查看和修改"},K)])):l("",!0),t(e).result.item.listType=="grey"?(s(),o("span",Q,[r("在灰名单中 "),u(h,{"v-item":t(e).result.item},null,8,["v-item"]),r(" "),i("a",{href:"",onClick:n[2]||(n[2]=_(p=>t(e).updateItem(t(e).result.list.id,t(e).result.item.id),["prevent"])),title:"查看和修改"},Y)])):l("",!0)])):(s(),o("div",Z,[i("span",ee,[r("在黑名单中 "),u(h,{"v-item":t(e).result.item},null,8,["v-item"]),r(" "),i("a",{href:"",onClick:n[3]||(n[3]=_(p=>t(e).updateItem(t(e).result.list.id,t(e).result.item.id),["prevent"])),title:"查看和修改"},se)])]))])):l("",!0),t(e).result.province!=null?(s(),o("div",ie,[i("span",oe,'在省份封禁中 "'+a(t(e).result.province.name)+'"',1)])):l("",!0),t(e).result.country!=null&&t(e).result.province==null?(s(),o("div",le,[i("span",ne,'在国家/地区封禁中 "'+a(t(e).result.country.name)+'"',1)])):l("",!0)])):l("",!0),t(e).result.isFound?l("",!0):(s(),o("div",re," 没有找到和"+a(t(e).ip)+"匹配的配置。 ",1))])):l("",!0)])])])]),_:1}),u(P,null,{default:d(()=>[r("检查IP状态")]),_:1})]),_:1},8,["onSuccess"])])):l("",!0)]),_:1},8,["ctx"]))}};export{We as default};
