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-DA7OTM4Q.js";import{i as f,c as y}from"./app-BT68AfZ-.js";import{_ as I}from"./app-B4tq9Xj4.js";import{_ as k}from"./app-CKBPOVnC.js";import{W as $}from"./app-D6fSNcLx.js";import{_ as g}from"./app-DQ7IohAF.js";import{_ as w}from"./app-DokSVapq.js";import{_ as P}from"./app-CKSEN_Rg.js";import{_ as T}from"./app-DuUYZNNT.js";import{D as x}from"./app-DNL2FXPk.js";import"./app-scFtFqL8.js";import"./app-DREBJ-ou.js";import"./app-CWBL8eTX.js";import"./app-CnGe5nlE.js";import"./app-OC5wWJiS.js";import"./app-BX4pd6U-.js";import"./app-Bhreb6Cm.js";import"./app-P70ZK_FT.js";import"./app-D5twQdhO.js";import"./app-BotiHebp.js";import"./app-up4gT9D9.js";import"./app-D29bbm9n.js";import"./app-Dxa5h-uG.js";import"./app-B_5dka6q.js";import"./app-BqY8p2gl.js";import"./app-CQwVTjAx.js";import"./app-Zes_jb7S.js";import"./app-DSiZNBrr.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};
