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-SC54XQDl.js";import{i as f,c as y}from"./app-Ba7ZqSpq.js";import{_ as I}from"./app-DJCl4rzT.js";import{_ as k}from"./app-Cft_lrsr.js";import{W as $}from"./app-B9xxzP2y.js";import{_ as g}from"./app-rIYFLdeU.js";import{_ as w}from"./app-DFulsyXy.js";import{_ as P}from"./app-DWUwCFNm.js";import{_ as T}from"./app-CVQkwzlf.js";import{D as x}from"./app-ZeVDYyDS.js";import"./app-CL60OiIv.js";import"./app-D9TrJBlL.js";import"./app-_Ovp2dOH.js";import"./app-BjSCO7rC.js";import"./app-Dhl-Bw0H.js";import"./app-B2C_dtYI.js";import"./app-COidJXl1.js";import"./app-qhR41k1m.js";import"./app-CS3AUTAk.js";import"./app-CCkWSX4Q.js";import"./app-C28obFWS.js";import"./app-CkINxBL9.js";import"./app-PPG0ZS4d.js";import"./app--Lj8zATS.js";import"./app-Ch8j4za4.js";import"./app-C2mBgI5Z.js";import"./app-CNHjdV6U.js";import"./app-DnXuoh8P.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};
