import{c as e,f as t,h as a}from"./public.js?v=1763625242172";import{dL as o,x as l}from"./page_layout.js?v=1763625242172";import{g as r}from"./index80.js?v=1763625242172";import{s as i}from"./tools2.js?v=1763625242172";import{k as s,t as n,P as c,W as p,aG as u,R as d,S as m,X as _,V as f,U as v}from"./vue.js?v=1763625242172";import{_ as x}from"./index.vue_vue_type_script_setup_true_lang15.js?v=1763625242172";import"./naive.js?v=1763625242172";import"./common.js?v=1763625242172";import"./__commonjsHelpers__.js?v=1763625242172";import"./rules.js?v=1763625242172";import"./index.vue_vue_type_script_setup_true_lang5.js?v=1763625242172";import"./index.vue_vue_type_script_setup_true_lang6.js?v=1763625242172";import"./index.vue_vue_type_script_setup_true_lang7.js?v=1763625242172";import"./index.vue_vue_type_script_setup_true_lang.js?v=1763625242172";import"./index99.js?v=1763625242172";const b={class:"h-full"},h=s({__name:"details-count",props:{data:{default:()=>({})}},setup(e){const t=n(e,"data"),{t:a}=c(),o=p("--color-bg-2"),l=p("--chart-tooltip-bg-color"),r=p("--color-text-1"),i=p("--color-text-2"),s=p("--color-text-3"),v=p("--color-border"),h=u({backgroundColor:o.value,title:g(),tooltip:{trigger:"item",confine:!0,backgroundColor:l.value,borderColor:"transparent",textStyle:{color:"#c7c7c7"},formatter(e){const t=e;return"".concat(t.marker," ").concat(t.name,": ").concat(t.value," (").concat(t.percent,"%)")}},series:w()}),y=["#6ec71e","#4885FF","#fc8b40","#818af8","#31c9d7","#f35e7a","#ab7aee","#14d68b","#cde5ff"];function g(e=0){return{text:a("Waf.Report.index_17"),textStyle:{color:r.value,fontSize:17},subtext:"".concat(e),subtextStyle:{color:i.value,fontSize:15},itemGap:20,left:"center",top:"42%"}}function w(e=[]){return[{type:"pie",data:e,radius:["50%","60%"],center:["50%","50%"],clockwise:!0,avoidLabelOverlap:!0,label:{show:!0,position:"outside",color:s.value,lineHeight:18,formatter:e=>""!==e.name?0===e.percent?"":a("Waf.Overview.index_33",[e.name,e.value,e.percent]):""},labelLine:{length:30,length2:30,lineStyle:{width:1,color:v.value}},itemStyle:{labelLine:{length:30,length2:30,lineStyle:{width:1,color:v.value}},color:e=>y[e.dataIndex]},emphasis:{scaleSize:15}}]}return(()=>{let e=0;const a=[];Object.entries(t.value).forEach((([t,o])=>{e+=o,a.push({name:t,value:o})})),h.title=g(e),h.series=w(a)})(),(e,t)=>(d(),m("div",b,[_(x,{type:"pie",height:"100%",option:f(h)},null,8,["option"])]))}}),y={class:"h-full"},g=s({__name:"details-uri",props:{data:{default:()=>[]}},setup(e){const t=n(e,"data"),{t:a}=c(),l=p("--color-bg-2"),r=p("--chart-tooltip-bg-color"),i=p("--color-text-1"),s=p("--color-text-2"),v=p("--color-border"),b=u({backgroundColor:l.value,tooltip:{trigger:"item",axisPointer:{type:"shadow",label:{color:"#fff",fontSize:"26"}},backgroundColor:r.value,borderColor:"transparent",textStyle:{color:"#c7c7c7"},formatter(e){const t=e;return'<div style="max-width: 400px;">'.concat(t.marker," ").concat(o(t.seriesName||""),"</div>\n\t\t\t<div>").concat(a("Waf.Report.index_16",[t.data]),"</div>")}},legend:{top:"0%",data:t.value.slice(0,4).map((e=>e.name)),textStyle:{fontSize:12,color:s.value},icon:"rect"},grid:{top:60,left:60,right:0,bottom:50},xAxis:[{type:"category",axisLabel:{color:i.value,fontSize:14,fontWeight:"bold"},data:[a("Waf.Report.index_15")]}],yAxis:[{type:"value",axisLine:{show:!1},axisTick:{show:!1},splitNumber:4,axisLabel:{color:s.value},splitLine:{lineStyle:{type:"dashed",color:v.value}}}],color:["#4fa8f9","#6ec71e","#f56e6a","#fc8b40","#818af8","#31c9d7","#f35e7a","#ab7aee","#14d68b","#cde5ff"],series:t.value.slice(0,4).map((e=>({name:e.name,type:"bar",label:{show:!0,position:"top"},barMaxWidth:60,data:[e.value]})))});return(e,t)=>(d(),m("div",y,[_(x,{type:"bar",height:"100%",option:f(b)},null,8,["option"])]))}}),w={class:"p-20px"},j={class:"flex h-280px mb-16px"},S={class:"w-410px"},k={class:"w-500px"},W=s({__name:"details",props:{row:{}},setup(s){const p=n(s,"row"),{t:u}=c(),{table:x,columns:b}=e([{key:"time_localtime",title:u("Waf.Report.index_13"),width:140},{key:"server_name",title:u("Waf.Report.index_14"),ellipsis:{tooltip:!0}},{key:"ip_country",title:u("Waf.Report.index_8"),render:e=>e.ip_country||"--"},{key:"URI",title:"URI",ellipsis:{tooltip:!0},render:e=>o(e.uri)||"--"},{key:"filter_rule",title:u("Waf.Report.index_34"),width:140},t({width:80,options:e=>[{label:u("Public.Btn.Details"),onClick:async()=>{const{message:t}=await r({id:e.id});l(t)&&t.length>0&&i(t[0])}}]})]);x.data=p.value.data.list;const y=p.value.data.uri.map((e=>({name:e[0],value:e[1]})));return(e,t)=>{const o=a;return d(),m("div",w,[v("div",j,[v("div",S,[_(h,{data:f(p).data.type},null,8,["data"])]),v("div",k,[_(g,{data:f(y)},null,8,["data"])])]),_(o,{"max-height":300,data:f(x).data,columns:f(b)},null,8,["data","columns"])])}}});export{W as default};
