1
This commit is contained in:
huoji
2022-10-11 17:53:42 +08:00
parent a31398883e
commit f867ebfb33
6 changed files with 14 additions and 11 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 157 KiB

After

Width:  |  Height:  |  Size: 195 KiB

View File

@@ -1 +1 @@
<!DOCTYPE html><html><head><title>Duck Sys Eye</title><meta charset=utf-8><meta name=description content=syseye><meta name=format-detection content="telephone=no"><meta name=msapplication-tap-highlight content=no><meta name=viewport content="user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1,width=device-width"><link rel=icon type=image/png sizes=128x128 href=icons/favicon-128x128.png><link rel=icon type=image/png sizes=96x96 href=icons/favicon-96x96.png><link rel=icon type=image/png sizes=32x32 href=icons/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=icons/favicon-16x16.png><link rel=icon type=image/ico href=favicon.ico><script defer src=js/vendor.68a7f1bc.js></script><script defer src=js/app.f9d03ded.js></script><link href=css/vendor.5b8581f0.css rel=stylesheet><link href=css/app.31d6cfe0.css rel=stylesheet></head><body><div id=q-app></div></body></html>
<!DOCTYPE html><html><head><title>Duck Sys Eye</title><meta charset=utf-8><meta name=description content=syseye><meta name=format-detection content="telephone=no"><meta name=msapplication-tap-highlight content=no><meta name=viewport content="user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1,width=device-width"><link rel=icon type=image/png sizes=128x128 href=icons/favicon-128x128.png><link rel=icon type=image/png sizes=96x96 href=icons/favicon-96x96.png><link rel=icon type=image/png sizes=32x32 href=icons/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=icons/favicon-16x16.png><link rel=icon type=image/ico href=favicon.ico><script defer src=js/vendor.68a7f1bc.js></script><script defer src=js/app.7c8d084f.js></script><link href=css/vendor.5b8581f0.css rel=stylesheet><link href=css/app.31d6cfe0.css rel=stylesheet></head><body><div id=q-app></div></body></html>

View File

@@ -1 +0,0 @@
"use strict";(globalThis["webpackChunksyseye"]=globalThis["webpackChunksyseye"]||[]).push([[526],{7526:(t,e,a)=>{a.r(e),a.d(e,{default:()=>Z});var s=a(3673),i=a(2323);const o={class:"q-gutter-md q-mb-sm q-pa-lg"},l={class:"row q-col-gutter-sm"},n={class:"text-h6"},r=(0,s.Uk)(" 由于python+sqlite数据库作为后端,理论上最高支持的主机数量为50. "),c={class:"text-subtitle2"},h={ref:"main_draw",style:{width:"100%",height:"600px"}};function m(t,e,a,m,u,d){const p=(0,s.up)("q-icon"),w=(0,s.up)("q-item-section"),g=(0,s.up)("q-item-label"),_=(0,s.up)("q-item"),b=(0,s.up)("q-card-section"),f=(0,s.up)("q-card"),v=(0,s.up)("q-banner"),y=(0,s.up)("q-popup-proxy");return(0,s.wg)(),(0,s.iD)("div",o,[(0,s._)("div",null,[(0,s.Wm)(f,{class:"bg-transparent no-shadow no-border"},{default:(0,s.w5)((()=>[(0,s.Wm)(b,{class:"q-pa-none"},{default:(0,s.w5)((()=>[(0,s._)("div",l,[((0,s.wg)(!0),(0,s.iD)(s.HY,null,(0,s.Ko)(t.Threatitems,((t,e)=>((0,s.wg)(),(0,s.iD)("div",{key:e,class:"col-md-3 col-sm-12 col-xs-12"},[(0,s.Wm)(_,{style:(0,i.j5)(`background-color: ${t.color1}`),class:"q-pa-none"},{default:(0,s.w5)((()=>[(0,s.Wm)(w,{side:"",style:(0,i.j5)(`background-color: ${t.color2}`),class:"q-pa-lg q-mr-none text-white"},{default:(0,s.w5)((()=>[(0,s.Wm)(p,{name:t.icon,color:"white",size:"24px"},null,8,["name"])])),_:2},1032,["style"]),(0,s.Wm)(w,{class:"q-pa-md q-ml-none text-white"},{default:(0,s.w5)((()=>[(0,s.Wm)(g,{class:"text-white text-h6 text-weight-bolder"},{default:(0,s.w5)((()=>[(0,s.Uk)((0,i.zw)(t.value),1)])),_:2},1024),(0,s.Wm)(g,null,{default:(0,s.w5)((()=>[(0,s.Uk)((0,i.zw)(t.title),1)])),_:2},1024)])),_:2},1024)])),_:2},1032,["style"])])))),128))])])),_:1})])),_:1})]),(0,s.Wm)(f,{class:"no-shadow",style:{background:"rbg(255,255,255)"}},{default:(0,s.w5)((()=>[(0,s.Wm)(b,null,{default:(0,s.w5)((()=>[(0,s._)("div",n,[(0,s.Uk)(" 主机数量: "+(0,i.zw)(t.threatStatistics.host_num)+"/50 ",1),(0,s.Wm)(p,{name:"info",class:"text-brown cursor-pointer"},{default:(0,s.w5)((()=>[(0,s.Wm)(y,{"transition-show":"flip-up","transition-hide":"flip-down"},{default:(0,s.w5)((()=>[(0,s.Wm)(v,{class:"bg-brown text-white"},{avatar:(0,s.w5)((()=>[(0,s.Wm)(p,{name:"lightbulb"})])),default:(0,s.w5)((()=>[r])),_:1})])),_:1})])),_:1})]),(0,s._)("div",c,"最近日志数量: "+(0,i.zw)(t.threatStatistics.all_log_num),1)])),_:1}),(0,s.Wm)(b,{class:"q-pt-none"},{default:(0,s.w5)((()=>[(0,s._)("div",h," 1 ",512)])),_:1})])),_:1})])}var u=a(52),d=a.n(u),p=a(2256);const w=(0,s.aZ)({name:"Dashboard",data(){return{Threatitems:[{title:"发现的威胁",icon:"remove_red_eye",value:"200",color1:"#b9b6ab",color2:"#969388"},{title:"确认的威胁",icon:"flash_on",value:"500",color1:"#9f6a61",color2:"#a27a73"},{title:"忽略的威胁",icon:"add_moderator",value:"50",color1:"#1fd7a2",color2:"#19C896"},{title:"进行中的威胁",icon:"stream",value:"1020",color1:"#f34a50",color2:"#c77c6f"}],threatStatistics:{all:1,confirm:0,ingore:1,working:0,host_list:{},host_num:10,all_log_num:647}}},methods:{get_threatStatistics(){d().get("/api/v1/get/threat_statistics",{"Content-Type":"application/json"}).then((t=>{const e=t.data;e.data&&(this.threatStatistics=e.data,this.threatStatistics.host_num=Object.keys(this.threatStatistics.host_list).length,this.Threatitems[0].value=this.threatStatistics.all,this.Threatitems[1].value=this.threatStatistics.confirm,this.Threatitems[2].value=this.threatStatistics.ingore,this.Threatitems[3].value=this.threatStatistics.working,console.log(this.threatStatistics),this.draw())}))},draw(){const t=[],e=[];for(const o in this.threatStatistics.host_list)t.push(o),e.push({name:o,type:"line",stack:"Total",areaStyle:{},emphasis:{focus:"series"},data:this.threatStatistics.host_list[o].log_num});const a=this.$refs.main_draw,s=p.S1(a),i={title:{text:"最近十分钟日志量"},tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{backgroundColor:"#6a7985"}}},legend:{data:t},toolbox:{feature:{saveAsImage:{}}},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:[{type:"category",boundaryGap:!1,data:["10min","9min","8min","7min","6min","5min","4min","3min","2min","1min"]}],yAxis:[{type:"value"}],series:e};s.setOption(i),setTimeout((()=>{s.resize()}),1e3)}},mounted(){this.get_threatStatistics(),setInterval((()=>{this.get_threatStatistics()}),1e4)}});var g=a(4260),_=a(151),b=a(5589),f=a(3414),v=a(2035),y=a(4554),x=a(2350),q=a(3944),S=a(5607),k=a(7518),W=a.n(k);const T=(0,g.Z)(w,[["render",m]]),Z=T;W()(w,"components",{QCard:_.Z,QCardSection:b.Z,QItem:f.Z,QItemSection:v.Z,QIcon:y.Z,QItemLabel:x.Z,QPopupProxy:q.Z,QBanner:S.Z})}}]);

View File

@@ -0,0 +1 @@
"use strict";(globalThis["webpackChunksyseye"]=globalThis["webpackChunksyseye"]||[]).push([[763],{1763:(t,e,s)=>{s.r(e),s.d(e,{default:()=>Z});var a=s(3673),i=s(2323);const o={class:"q-gutter-md q-mb-sm q-pa-lg"},l={class:"row q-col-gutter-sm"},n={class:"text-h6"},r=(0,a.Uk)(" 由于python+sqlite数据库作为后端,理论上最高支持的主机数量为50. "),c={class:"text-subtitle2"},h={ref:"main_draw",style:{width:"100%",height:"600px"}};function m(t,e,s,m,u,d){const p=(0,a.up)("q-icon"),w=(0,a.up)("q-item-section"),g=(0,a.up)("q-item-label"),_=(0,a.up)("q-item"),b=(0,a.up)("q-card-section"),f=(0,a.up)("q-card"),y=(0,a.up)("q-banner"),v=(0,a.up)("q-popup-proxy");return(0,a.wg)(),(0,a.iD)("div",o,[(0,a._)("div",null,[(0,a.Wm)(f,{class:"bg-transparent no-shadow no-border"},{default:(0,a.w5)((()=>[(0,a.Wm)(b,{class:"q-pa-none"},{default:(0,a.w5)((()=>[(0,a._)("div",l,[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)(t.Threatitems,((t,e)=>((0,a.wg)(),(0,a.iD)("div",{key:e,class:"col-md-3 col-sm-12 col-xs-12"},[(0,a.Wm)(_,{style:(0,i.j5)(`background-color: ${t.color1}`),class:"q-pa-none"},{default:(0,a.w5)((()=>[(0,a.Wm)(w,{side:"",style:(0,i.j5)(`background-color: ${t.color2}`),class:"q-pa-lg q-mr-none text-white"},{default:(0,a.w5)((()=>[(0,a.Wm)(p,{name:t.icon,color:"white",size:"24px"},null,8,["name"])])),_:2},1032,["style"]),(0,a.Wm)(w,{class:"q-pa-md q-ml-none text-white"},{default:(0,a.w5)((()=>[(0,a.Wm)(g,{class:"text-white text-h6 text-weight-bolder"},{default:(0,a.w5)((()=>[(0,a.Uk)((0,i.zw)(t.value),1)])),_:2},1024),(0,a.Wm)(g,null,{default:(0,a.w5)((()=>[(0,a.Uk)((0,i.zw)(t.title),1)])),_:2},1024)])),_:2},1024)])),_:2},1032,["style"])])))),128))])])),_:1})])),_:1})]),(0,a.Wm)(f,{class:"no-shadow",style:{background:"rbg(255,255,255)"}},{default:(0,a.w5)((()=>[(0,a.Wm)(b,null,{default:(0,a.w5)((()=>[(0,a._)("div",n,[(0,a.Uk)(" 主机数量: "+(0,i.zw)(t.threatStatistics.host_num)+"/50 ",1),(0,a.Wm)(p,{name:"info",class:"text-brown cursor-pointer"},{default:(0,a.w5)((()=>[(0,a.Wm)(v,{"transition-show":"flip-up","transition-hide":"flip-down"},{default:(0,a.w5)((()=>[(0,a.Wm)(y,{class:"bg-brown text-white"},{avatar:(0,a.w5)((()=>[(0,a.Wm)(p,{name:"lightbulb"})])),default:(0,a.w5)((()=>[r])),_:1})])),_:1})])),_:1})]),(0,a._)("div",c,"最近日志数量: "+(0,i.zw)(t.threatStatistics.all_log_num),1)])),_:1}),(0,a.Wm)(b,{class:"q-pt-none"},{default:(0,a.w5)((()=>[(0,a._)("div",h," 1 ",512)])),_:1})])),_:1})])}var u=s(52),d=s.n(u),p=s(2256);const w=(0,a.aZ)({name:"Dashboard",data(){return{Threatitems:[{title:"发现的威胁",icon:"remove_red_eye",value:"200",color1:"#EE9B00",color2:"#EE9B00"},{title:"确认的威胁",icon:"flash_on",value:"500",color1:"#CA6702",color2:"#CA6702"},{title:"忽略的威胁",icon:"add_moderator",value:"50",color1:"#BB3E03",color2:"#BB3E03"},{title:"进行中的威胁",icon:"stream",value:"1020",color1:"#AE2012",color2:"#AE2012"}],threatStatistics:{all:1,confirm:0,ingore:1,working:0,host_list:{},host_num:10,all_log_num:647}}},methods:{get_threatStatistics(){d().get("/api/v1/get/threat_statistics",{"Content-Type":"application/json"}).then((t=>{const e=t.data;e.data&&(this.threatStatistics=e.data,this.threatStatistics.host_num=Object.keys(this.threatStatistics.host_list).length,this.Threatitems[0].value=this.threatStatistics.all,this.Threatitems[1].value=this.threatStatistics.confirm,this.Threatitems[2].value=this.threatStatistics.ingore,this.Threatitems[3].value=this.threatStatistics.working,console.log(this.threatStatistics),this.draw())}))},draw(){const t=[],e=[];for(const o in this.threatStatistics.host_list)t.push(o),e.push({itemStyle:{color:"#005F73"},name:o,type:"line",stack:"Total",areaStyle:{},emphasis:{focus:"series"},data:this.threatStatistics.host_list[o].log_num});const s=this.$refs.main_draw,a=p.S1(s),i={title:{text:"最近十分钟日志量"},tooltip:{trigger:"axis",axisPointer:{type:"cross",label:{backgroundColor:"#6a7985"}}},legend:{data:t},toolbox:{feature:{saveAsImage:{}}},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:[{type:"category",boundaryGap:!1,data:["10min","9min","8min","7min","6min","5min","4min","3min","2min","1min"]}],yAxis:[{type:"value"}],series:e};a.setOption(i),setTimeout((()=>{a.resize()}),1e3)}},mounted(){this.get_threatStatistics(),setInterval((()=>{this.get_threatStatistics()}),1e4)}});var g=s(4260),_=s(151),b=s(5589),f=s(3414),y=s(2035),v=s(4554),x=s(2350),S=s(3944),q=s(5607),k=s(7518),W=s.n(k);const T=(0,g.Z)(w,[["render",m]]),Z=T;W()(w,"components",{QCard:_.Z,QCardSection:b.Z,QItem:f.Z,QItemSection:y.Z,QIcon:v.Z,QItemLabel:x.Z,QPopupProxy:S.Z,QBanner:q.Z})}}]);

File diff suppressed because one or more lines are too long

View File

@@ -63,29 +63,29 @@ export default defineComponent({
title: '发现的威胁',
icon: 'remove_red_eye',
value: '200',
color1: '#b9b6ab',
color2: '#969388'
color1: '#EE9B00',
color2: '#EE9B00'
},
{
title: '确认的威胁',
icon: 'flash_on',
value: '500',
color1: '#9f6a61',
color2: '#a27a73'
color1: '#CA6702',
color2: '#CA6702'
},
{
title: '忽略的威胁',
icon: 'add_moderator',
value: '50',
color1: '#1fd7a2',
color2: '#19C896'
color1: '#BB3E03',
color2: '#BB3E03'
},
{
title: '进行中的威胁',
icon: 'stream',
value: '1020',
color1: '#f34a50',
color2: '#c77c6f'
color1: '#AE2012',
color2: '#AE2012'
}
],
threatStatistics: {
@@ -127,6 +127,9 @@ export default defineComponent({
for (const key in this.threatStatistics.host_list) {
hostList.push(key)
hostLoggedNumList.push({
itemStyle: {
color: '#005F73'
},
name: key,
type: 'line',
stack: 'Total',