File: /www/server/panel/BTPanel/static/js/ip-attack-detail.js
import{c as L,v as T,n as E,x as p,y as O,A as d,O as g,P as x,z as h,e as b,b6 as P}from"./base-lib.js?v=1777008528";import{an as u}from"./utils-lib.js?v=1777008528";import{u as W}from"./hooks2.js?v=1777008528";import{i as $}from"./page11.js?v=1777008528";import"./__commonjsHelpers__.js?v=1777008528";import"./index431.js?v=1777008528";import"./site-list.js?v=1777008528";import"./index432.js?v=1777008528";import"./use-log-detail.js?v=1777008528";import"./constants.js?v=1777008528";import"./index109.js?v=1777008528";import"./column.js?v=1777008528";import"./index110.js?v=1777008528";const A={class:"flex flex-col h-full p-[20px]",style:{"min-height":"620px"}},N={class:"flex gap-4",style:{height:"260px"}},V={class:"rounded-lg",style:{width:"350px"}},F={class:"rounded-lg flex-1 min-w-0"},tt=L({__name:"ip-attack-detail",props:{compData:{}},setup(y){var m;const _=y,{ip:H,logs:f,typeData:w,uriData:D,fetchLogDetail:C,openLogDetail:v,openHttpDetail:S}=(m=_.compData)!=null?m:{},l=u({options:{title:{text:"当前IP总拦截数",textStyle:{fontSize:14},subtext:"0",subtextStyle:{fontSize:14},itemGap:10,left:"49%",top:"43%",textAlign:"center"},tooltip:{trigger:"item",formatter:"{b}: {c} ({d}%)"},legend:{show:!1},color:["#6ec71e","#4885FF","#fc8b40","#818af8","#31c9d7","#f35e7a","#ab7aee","#14d68b","#cde5ff"],series:[{type:"pie",radius:["45%","60%"],center:["50%","50%"],clockwise:!0,avoidLabelOverlap:!0,label:{show:!1},emphasis:{label:{show:!0,fontSize:14,fontWeight:"bold"}},itemStyle:{borderWidth:2,borderColor:"#fff"},data:[]}]}}),n=u({options:{tooltip:{trigger:"item",axisPointer:{type:"shadow"},formatter:t=>"".concat(t.marker).concat(t.seriesName,"<br/>当前uri总攻击次数: ").concat(t.data)},legend:{top:"0%",data:[],textStyle:{fontSize:12,color:"#808080"},icon:"rect"},grid:{top:60,left:60,right:0,bottom:50},xAxis:[{type:"category",axisLabel:{color:"#4D4D4D",fontSize:14,fontWeight:"bold"},data:["今日URI(TOP5)"]}],yAxis:[{type:"value",axisLine:{show:!1},axisTick:{show:!1},splitNumber:4,axisLabel:{color:"#8C8C8C"},splitLine:{lineStyle:{type:"dashed"}}}],color:["#4fa8f9","#6ec71e","#f56e6a","#fc8b40","#818af8","#31c9d7","#f35e7a","#ab7aee","#14d68b","#cde5ff"],series:[]}});function B(t){v(t)}function k(t){C(t.id).then(a=>{S(a)})}const r=W({request:async t=>{const a=(t==null?void 0:t.p)||1,i=(t==null?void 0:t.limit)||10,s=(a-1)*i,c=s+i;return{data:f.slice(s,c),total:f.length}},columns:$(B,k)}),z=r.BtTable;return r.BtPage,T(async()=>{await E();const t=Object.entries(w).map(([e,o])=>({name:e,value:o})),a=t.reduce((e,o)=>e+o.value,0);l.setOption({title:{subtext:String(a)},series:[{data:t}]});const i=D.slice(0,5),s=i.map(([e])=>e.length>25?"".concat(e.slice(0,25),"..."):e),c=i.map(([e,o])=>({name:e.length>25?"".concat(e.slice(0,25),"..."):e,type:"bar",label:{show:!0,position:"top"},barMaxWidth:60,data:[o]}));n.setOption({legend:{data:s},series:c}),setTimeout(async()=>{const e=await l.getEChart(),o=await n.getEChart();e==null||e.resize(),o==null||o.resize()},100),r.refresh()}),(t,a)=>{const i=P;return p(),O("div",A,[d("div",N,[d("div",V,[(p(),g(x(h(l).BtECharts),{style:{width:"100%",height:"260px"}}))]),d("div",F,[(p(),g(x(h(n).BtECharts),{style:{width:"100%",height:"260px"}}))])]),b(i,{style:{margin:"12px 0"}}),b(h(z),{"max-height":"380"})])}}});export{tt as default};