HFish/admin/dashboard.html

1130 lines
28 KiB
Go
Raw Normal View History

2019-08-07 13:16:23 +08:00
{{template "header"}}
<style>
.title {
font-weight: bold;
font-size: 18px;
margin-bottom: 30px;
color: #383838;
2019-08-07 13:16:23 +08:00
}
2019-12-03 21:28:24 +08:00
.xing {
color: #ff0101;
margin-right: 5px;
}
2019-08-07 13:16:23 +08:00
.openx {
background: #3dd209;
width: 10px;
height: 10px;
border-radius: 100%;
display: -webkit-inline-box;
margin-right: 10px;
}
.closex {
background: #dc0e0e;
width: 10px;
height: 10px;
border-radius: 100%;
display: -webkit-inline-box;
margin-right: 10px;
}
2019-08-11 20:14:28 +08:00
2019-12-03 21:28:24 +08:00
.m-b-10 {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.titlea {
font-size: 16px;
font-weight: bold;
border-left: 4px solid #60aff4;
padding-left: 15px;
}
.form-x {
line-height: 35px;
height: 35px;
}
2019-08-11 20:14:28 +08:00
.lb_web {
color: #039cfd;
}
.lb_ssh {
color: #953fb9;
}
.lb_redis {
color: #e44242;
}
.lb_mysql {
color: #cabd23;
}
.lb_ftp {
color: #32cc16;
}
.lb_telnet {
color: #6b79c1;
}
.lb_deep {
color: #000000;
}
.lb_mem_cache {
color: #3d9671;
}
2019-12-03 21:28:24 +08:00
.lb_es {
color: #0177a3;
}
.lb_tftp {
color: #452b6d;
}
.lb_vnc {
color: #3c6f40;
}
.lb_http {
color: #56a996;
}
2020-04-12 22:19:13 +08:00
.lb_custom {
color: #8c600e;
}
2019-08-07 13:16:23 +08:00
</style>
<div class="row">
<div class="col-sm-12">
<div class="btn-group pull-right m-t-15">
2019-12-03 21:28:24 +08:00
<a type="button" class="btn btn-custom" href="/data">
切换大屏 <i class="ion-log-in"></i>
2019-08-07 13:16:23 +08:00
</a>
</div>
<h4 class="page-title">仪表盘</h4>
</div>
2019-12-03 21:28:24 +08:00
<div class="col-xs-12 col-md-6 col-lg-6 col-xl-2">
2019-08-07 13:16:23 +08:00
<div class="card-box tilebox-two">
2019-08-11 20:14:28 +08:00
<i class="icon-ghost pull-xs-right text-muted"></i>
2019-12-03 21:28:24 +08:00
<h6 class="lb_ssh text-uppercase m-b-15 m-t-10">SSH</h6>
2019-08-11 20:14:28 +08:00
<h2 class="m-b-10"><span data-plugin="counterup">{{.sshSum}}</span></h2>
</div>
</div>
2019-12-03 21:28:24 +08:00
<div class="col-xs-12 col-md-6 col-lg-6 col-xl-2">
2019-08-11 20:14:28 +08:00
<div class="card-box tilebox-two">
<i class="icon-layers pull-xs-right text-muted"></i>
2019-12-03 21:28:24 +08:00
<h6 class="lb_redis text-uppercase m-b-15 m-t-10">Redis</h6>
2019-08-11 20:14:28 +08:00
<h2 class="m-b-10" data-plugin="counterup">{{.redisSum}}</h2>
2019-08-07 13:16:23 +08:00
</div>
</div>
2019-08-11 20:14:28 +08:00
2019-12-03 21:28:24 +08:00
<div class="col-xs-12 col-md-6 col-lg-6 col-xl-2">
2019-08-07 13:16:23 +08:00
<div class="card-box tilebox-two">
<i class="icon-chart pull-xs-right text-muted"></i>
2019-12-03 21:28:24 +08:00
<h6 class="lb_mysql text-uppercase m-b-15 m-t-10">Mysql</h6>
2019-08-11 20:14:28 +08:00
<h2 class="m-b-10"><span data-plugin="counterup">{{.mysqlSum}}</span></h2>
2019-08-07 13:16:23 +08:00
</div>
</div>
2019-12-03 21:28:24 +08:00
<div class="col-xs-12 col-md-6 col-lg-6 col-xl-2">
2019-08-07 13:16:23 +08:00
<div class="card-box tilebox-two">
<i class="icon-layers pull-xs-right text-muted"></i>
2019-12-03 21:28:24 +08:00
<h6 class="lb_ftp text-uppercase m-b-15 m-t-10">FTP</h6>
2019-08-11 20:14:28 +08:00
<h2 class="m-b-10"><span data-plugin="counterup">{{.ftpSum}}</span></h2>
2019-08-07 13:16:23 +08:00
</div>
</div>
2019-12-03 21:28:24 +08:00
<div class="col-xs-12 col-md-6 col-lg-6 col-xl-2">
<div class="card-box tilebox-two">
<i class="icon-social-pintarest pull-xs-right text-muted"></i>
2019-12-03 21:28:24 +08:00
<h6 class="lb_mem_cache text-uppercase m-b-15 m-t-10">MemCache</h6>
<h2 class="m-b-10"><span data-plugin="counterup">{{.memCacheSum}}</span></h2>
</div>
</div>
2019-12-03 21:28:24 +08:00
<div class="col-xs-12 col-md-6 col-lg-6 col-xl-2">
2019-08-07 13:16:23 +08:00
<div class="card-box tilebox-two">
2019-12-03 21:28:24 +08:00
<i class="icon-social-spotify pull-xs-right text-muted"></i>
<h6 class="lb_telnet text-uppercase m-b-15 m-t-10">TELNET</h6>
2019-08-11 20:14:28 +08:00
<h2 class="m-b-10"><span data-plugin="counterup">{{.telnetSum}}</span></h2>
2019-08-07 13:16:23 +08:00
</div>
</div>
2020-04-12 22:19:13 +08:00
<div class="col-xs-12 col-md-6 col-lg-6 col-xl-3">
2019-08-11 20:14:28 +08:00
<div class="card-box tilebox-two">
<i class="icon-fire pull-xs-right text-muted"></i>
2019-12-03 21:28:24 +08:00
<h6 class="lb_web text-uppercase m-b-15 m-t-10">WEB</h6>
2019-08-11 20:14:28 +08:00
<h2 class="m-b-10"><span data-plugin="counterup">{{.webSum}}</span></h2>
</div>
</div>
2020-04-12 22:19:13 +08:00
<div class="col-xs-12 col-md-6 col-lg-6 col-xl-3">
2019-08-11 20:14:28 +08:00
<div class="card-box tilebox-two">
<i class="icon-globe pull-xs-right text-muted"></i>
2019-12-03 21:28:24 +08:00
<h6 class="lb_deep text-uppercase m-b-15 m-t-10">DEEP</h6>
2019-08-11 20:14:28 +08:00
<h2 class="m-b-10"><span data-plugin="counterup">{{.deepSum}}</span></h2>
</div>
</div>
2020-04-12 22:19:13 +08:00
<div class="col-xs-12 col-md-6 col-lg-6 col-xl-3">
2019-12-03 21:28:24 +08:00
<div class="card-box tilebox-two">
<i class="icon-plane pull-xs-right text-muted"></i>
<h6 class="lb_http text-uppercase m-b-15 m-t-10">HTTP代理</h6>
<h2 class="m-b-10"><span data-plugin="counterup">{{.httpSum}}</span></h2>
</div>
</div>
2020-04-12 22:19:13 +08:00
<div class="col-xs-12 col-md-6 col-lg-6 col-xl-3">
2019-12-03 21:28:24 +08:00
<div class="card-box tilebox-two">
<i class="icon-cursor pull-xs-right text-muted"></i>
<h6 class="lb_tftp text-uppercase m-b-15 m-t-10">TFTP</h6>
<h2 class="m-b-10"><span data-plugin="counterup">{{.tftpSum}}</span></h2>
</div>
</div>
2020-04-12 22:19:13 +08:00
<div class="col-xs-12 col-md-6 col-lg-6 col-xl-4">
2019-12-03 21:28:24 +08:00
<div class="card-box tilebox-two">
<i class="icon-diamond pull-xs-right text-muted"></i>
<h6 class="lb_es text-uppercase m-b-15 m-t-10">ES</h6>
<h2 class="m-b-10"><span data-plugin="counterup">{{.esSum}}</span></h2>
</div>
</div>
2020-04-12 22:19:13 +08:00
<div class="col-xs-12 col-md-6 col-lg-6 col-xl-4">
2019-12-03 21:28:24 +08:00
<div class="card-box tilebox-two">
<i class="icon-target pull-xs-right text-muted"></i>
2020-04-12 22:19:13 +08:00
<h6 class="lb_custom text-uppercase m-b-15 m-t-10">VNC</h6>
2019-12-03 21:28:24 +08:00
<h2 class="m-b-10"><span data-plugin="counterup">{{.vncSum}}</span></h2>
</div>
</div>
2020-04-12 22:19:13 +08:00
<div class="col-xs-12 col-md-6 col-lg-6 col-xl-4">
<div class="card-box tilebox-two">
<i class="icon-cup pull-xs-right text-muted"></i>
<h6 class="lb_vnc text-uppercase m-b-15 m-t-10">CUSTOM</h6>
<h2 class="m-b-10"><span data-plugin="counterup">{{.customSum}}</span></h2>
</div>
</div>
2019-12-03 21:28:24 +08:00
<div class="col-md-12">
<div class="card-box">
<p class="titlea">最近24小时</p>
<div id="myChart" style="width:100%;height:200px;"></div>
</div>
</div>
2019-08-07 13:16:23 +08:00
<div class="col-md-2">
2019-12-03 21:28:24 +08:00
<div class="card-box" style="height: 676px;">
2019-08-07 13:16:23 +08:00
<p class="title">服务状态</p>
{{if eq .apiStatus "1"}}
<p><span class="openx"></span>API</p>
{{else}}
<p><span class="closex"></span>API</p>
{{end}}
{{if eq .apiStatus "1"}}
<p><span class="openx"></span>PLUG</p>
{{else}}
<p><span class="closex"></span>PLUG</p>
{{end}}
2019-08-07 13:16:23 +08:00
{{if eq .webStatus "1"}}
<p><span class="openx"></span>WEB</p>
{{else}}
<p><span class="closex"></span>WEB</p>
{{end}}
2019-08-11 20:14:28 +08:00
{{if eq .deepStatus "1"}}
<p><span class="openx"></span>DEEP</p>
{{else}}
<p><span class="closex"></span>DEEP</p>
{{end}}
2019-08-07 13:16:23 +08:00
{{if eq .sshStatus "1"}}
<p><span class="openx"></span>SSH</p>
2019-08-29 12:43:00 +08:00
{{ else if eq .sshStatus "2"}}
<p><span class="openx"></span>SSH</p>
2019-08-07 13:16:23 +08:00
{{else}}
<p><span class="closex"></span>SSH</p>
{{end}}
{{if eq .redisStatus "1"}}
<p><span class="openx"></span>REDIS</p>
{{else}}
<p><span class="closex"></span>REDIS</p>
{{end}}
{{if eq .mysqlStatus "1"}}
<p><span class="openx"></span>MYSQL</p>
{{else}}
<p><span class="closex"></span>MYSQL</p>
{{end}}
2019-08-11 20:14:28 +08:00
{{if eq .telnetStatus "1"}}
<p><span class="openx"></span>TELNET</p>
{{else}}
<p><span class="closex"></span>TELNET</p>
{{end}}
{{if eq .ftpStatus "1"}}
<p><span class="openx"></span>FTP</p>
{{else}}
<p><span class="closex"></span>FTP</p>
{{end}}
{{if eq .memCacheStatus "1"}}
2019-10-28 22:25:23 +08:00
<p><span class="openx"></span>MemCache</p>
{{else}}
2019-10-28 22:25:23 +08:00
<p><span class="closex"></span>MemCache</p>
{{end}}
2019-10-28 22:25:23 +08:00
{{if eq .httpStatus "1"}}
<p><span class="openx"></span>HTTP</p>
{{else}}
<p><span class="closex"></span>HTTP</p>
{{end}}
{{if eq .tftpStatus "1"}}
<p><span class="openx"></span>TFTP</p>
{{else}}
<p><span class="closex"></span>TFTP</p>
{{end}}
{{if eq .esStatus "1"}}
<p><span class="openx"></span>ElasticSearch</p>
{{else}}
<p><span class="closex"></span>ElasticSearch</p>
{{end}}
{{if eq .vncStatus "1"}}
<p><span class="openx"></span>VNC</p>
{{else}}
<p><span class="closex"></span>VNC</p>
{{end}}
2020-04-12 22:19:13 +08:00
{{if eq .customStatus "1"}}
<p><span class="openx"></span>CUSTOM</p>
{{else}}
<p><span class="closex"></span>CUSTOM</p>
{{end}}
2019-08-07 13:16:23 +08:00
</div>
</div>
2019-12-03 21:28:24 +08:00
<div class="col-md-5">
2019-08-07 13:16:23 +08:00
<div class="card-box">
2019-12-03 21:28:24 +08:00
<p class="titlea">[攻击地区] TOP10</p>
<div id="myChart1" style="width:100%;height:300px;"></div>
</div>
</div>
<div class="col-md-5">
<div class="card-box">
2019-12-03 21:28:24 +08:00
<p class="titlea">[攻击IP] TOP10</p>
<div id="myChart2" style="width:100%;height:300px;"></div>
</div>
</div>
2019-12-03 21:28:24 +08:00
<div class="col-md-5">
<div class="card-box">
2019-12-03 21:28:24 +08:00
<p class="titlea">账号统计</p>
<div id="myChart3" style="width:100%;height:200px;"></div>
2019-08-07 13:16:23 +08:00
</div>
</div>
2019-12-03 21:28:24 +08:00
<div class="col-md-5">
<div class="card-box">
<p class="titlea">密码统计</p>
<div id="myChart4" style="width:100%;height:200px;"></div>
</div>
</div>
2019-08-07 13:16:23 +08:00
</div>
2019-12-03 21:28:24 +08:00
{{/*<div id="myRegInfo" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">*/}}
2020-04-12 22:19:13 +08:00
{{/*<div class="modal-dialog" style="width: 486px;">*/}}
{{/*<div class="modal-content">*/}}
{{/*<div class="modal-header">*/}}
{{/*<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>*/}}
{{/*<h6 class="modal-title" id="myModalLabel">请填写 - 收集需求为了更好的 HFish</h6>*/}}
{{/*</div>*/}}
{{/*<div class="modal-body">*/}}
{{/*<div class="form-horizontal">*/}}
{{/*<div class="form-group form-x">*/}}
{{/*<label for="inputPassword3" class="col-sm-2 control-label"><span*/}}
{{/*class="xing">*</span>使用者</label>*/}}
{{/*<div class="col-sm-10">*/}}
{{/*<input type="text" class="form-control" id="reg_use" placeholder="请输入企业名或个人网名(真名)">*/}}
{{/*</div>*/}}
{{/*</div>*/}}
{{/*<div class="form-group form-x">*/}}
{{/*<label for="reg_mail" class="col-sm-2 control-label"><span class="xing">*</span>邮箱</label>*/}}
{{/*<div class="col-sm-10">*/}}
{{/*<input type="email" class="form-control" id="reg_mail" placeholder="请输入公司或个人邮箱">*/}}
{{/*</div>*/}}
{{/*</div>*/}}
{{/*</div>*/}}
{{/*<div style="clear: both"></div>*/}}
{{/*</div>*/}}
{{/*<div class="modal-footer">*/}}
{{/*<button type="button" class="btn btn-primary">提交信息</button>*/}}
{{/*</div>*/}}
{{/*</div>*/}}
{{/*</div>*/}}
2019-12-03 21:28:24 +08:00
{{/*</div>*/}}
2019-08-07 13:16:23 +08:00
{{template "footer" }}
2019-12-03 21:28:24 +08:00
<script type="text/javascript" src="/static/data/js/echarts-3.8.5.min.js"></script>
<script type="text/javascript" src="/static/libs/moment/moment.min.js"></script>
<script type="text/javascript" src="/static/data/js/echarts-wordcloud.min.js"></script>
2019-08-07 13:16:23 +08:00
<script>
2019-12-03 21:28:24 +08:00
// $('#myRegInfo').modal('show');
2019-08-12 14:15:36 +08:00
var m = moment(new Date());
2019-08-12 14:42:25 +08:00
var arr = new Array();
2019-08-12 14:15:36 +08:00
for (var i = 0; i < 24; i++) {
var h = m.subtract(1, 'h').hours();
if (h >= 0 && h < 10) {
2019-08-12 14:42:25 +08:00
arr.push("0" + h.toString())
} else {
arr.push(h.toString())
2019-08-12 14:15:36 +08:00
}
}
2019-08-07 13:16:23 +08:00
2019-08-12 14:42:25 +08:00
var xdata = arr.reverse();
2019-08-07 13:16:23 +08:00
var webData = [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
];
var sshData = [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
];
var redisData = [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
];
var mysqlData = [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
];
2019-08-11 20:14:28 +08:00
var deepData = [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
];
var ftpData = [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
];
var telnetData = [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
];
var memCacheData = [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
];
2019-12-03 21:28:24 +08:00
var httpData = [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
];
var tftpData = [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
];
var esData = [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
];
var vncData = [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
];
2020-04-12 22:19:13 +08:00
var customData = [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
];
2019-08-07 13:16:23 +08:00
var myChart = echarts.init(document.getElementById('myChart'));
$.ajax({
type: "GET",
url: "/get/dashboard/data",
dataType: "json",
success: function (e) {
if (e.code == 200) {
var d = e.data;
for (var item in d.mysql) {
2019-08-12 14:42:25 +08:00
var index = xdata.indexOf(item);
2019-09-03 10:53:22 +08:00
mysqlData[index] = parseInt(d.mysql[item]);
2019-08-07 13:16:23 +08:00
}
for (var item in d.redis) {
2019-08-12 14:42:25 +08:00
var index = xdata.indexOf(item);
2019-09-03 10:53:22 +08:00
redisData[index] = parseInt(d.redis[item]);
2019-08-07 13:16:23 +08:00
}
for (var item in d.ssh) {
2019-08-12 14:42:25 +08:00
var index = xdata.indexOf(item);
2019-09-03 10:53:22 +08:00
sshData[index] = parseInt(d.ssh[item]);
2019-08-07 13:16:23 +08:00
}
for (var item in d.web) {
2019-08-12 14:42:25 +08:00
var index = xdata.indexOf(item);
2019-09-03 10:53:22 +08:00
webData[index] = parseInt(d.web[item]);
2019-08-07 13:16:23 +08:00
}
2019-08-11 20:14:28 +08:00
for (var item in d.deep) {
2019-08-12 14:42:25 +08:00
var index = xdata.indexOf(item);
2019-09-03 10:53:22 +08:00
deepData[index] = parseInt(d.deep[item]);
2019-08-11 20:14:28 +08:00
}
for (var item in d.ftp) {
2019-08-12 14:42:25 +08:00
var index = xdata.indexOf(item);
2019-09-03 10:53:22 +08:00
ftpData[index] = parseInt(d.ftp[item]);
2019-08-11 20:14:28 +08:00
}
for (var item in d.telnet) {
2019-08-12 14:42:25 +08:00
var index = xdata.indexOf(item);
2019-09-03 10:53:22 +08:00
telnetData[index] = parseInt(d.telnet[item]);
2019-08-11 20:14:28 +08:00
}
for (var item in d.memCache) {
var index = xdata.indexOf(item);
2019-09-03 10:53:22 +08:00
memCacheData[index] = parseInt(d.memCache[item]);
}
2020-04-12 22:19:13 +08:00
for (var item in d.httpMap) {
2019-12-03 21:28:24 +08:00
var index = xdata.indexOf(item);
2020-04-12 22:19:13 +08:00
httpData[index] = parseInt(d.httpMap[item]);
2019-12-03 21:28:24 +08:00
}
2020-04-12 22:19:13 +08:00
for (var item in d.vncMap) {
2019-12-03 21:28:24 +08:00
var index = xdata.indexOf(item);
2020-04-12 22:19:13 +08:00
vncData[index] = parseInt(d.vncMap[item]);
2019-12-03 21:28:24 +08:00
}
2020-04-12 22:19:13 +08:00
for (var item in d.tftpMap) {
2019-12-03 21:28:24 +08:00
var index = xdata.indexOf(item);
2020-04-12 22:19:13 +08:00
tftpData[index] = parseInt(d.tftpMap[item]);
2019-12-03 21:28:24 +08:00
}
2020-04-12 22:19:13 +08:00
for (var item in d.esMap) {
var index = xdata.indexOf(item);
esData[index] = parseInt(d.esMap[item]);
}
for (var item in d.customMap) {
2019-12-03 21:28:24 +08:00
var index = xdata.indexOf(item);
2020-04-12 22:19:13 +08:00
customData[index] = parseInt(d.customMap[item]);
2019-12-03 21:28:24 +08:00
}
2019-08-07 13:16:23 +08:00
var option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
label: {
backgroundColor: '#6a7985'
}
}
},
legend: {
2020-04-12 22:19:13 +08:00
data: ['WEB', 'DEEP', 'SSH', 'REDIS', 'MYSQL', 'TELNET', 'FTP', 'MEMCACHE', 'HTTP', 'TFTP', 'VNC', 'ES', 'CUSTOM']
2019-08-07 13:16:23 +08:00
},
grid: {
left: '0%',
2019-08-12 14:42:25 +08:00
right: '2%',
2019-08-07 13:16:23 +08:00
bottom: '3%',
containLabel: true
},
xAxis: [
{
type: 'category',
boundaryGap: false,
2019-08-12 14:42:25 +08:00
data: xdata
2019-08-07 13:16:23 +08:00
}
],
yAxis: [
{
type: 'value'
}
],
series: [
{
name: 'WEB',
type: 'line',
stack: '总量',
areaStyle: {normal: {}},
data: webData
},
2019-08-11 20:14:28 +08:00
{
name: 'DEEP',
type: 'line',
stack: '总量',
areaStyle: {normal: {}},
data: deepData
},
2019-08-07 13:16:23 +08:00
{
name: 'SSH',
type: 'line',
stack: '总量',
areaStyle: {normal: {}},
data: sshData
},
{
name: 'REDIS',
type: 'line',
stack: '总量',
areaStyle: {normal: {}},
data: redisData
},
{
name: 'MYSQL',
type: 'line',
stack: '总量',
areaStyle: {normal: {}},
data: mysqlData
2019-08-11 20:14:28 +08:00
},
{
name: 'TELNET',
type: 'line',
stack: '总量',
areaStyle: {normal: {}},
data: telnetData
},
{
name: 'FTP',
type: 'line',
stack: '总量',
areaStyle: {normal: {}},
data: ftpData
},
{
name: 'MEMCACHE',
type: 'line',
stack: '总量',
areaStyle: {normal: {}},
data: memCacheData
2019-12-03 21:28:24 +08:00
},
{
name: 'HTTP',
type: 'line',
stack: '总量',
areaStyle: {normal: {}},
data: httpData
},
{
name: 'TFTP',
type: 'line',
stack: '总量',
areaStyle: {normal: {}},
data: tftpData
},
{
name: 'VNC',
type: 'line',
stack: '总量',
areaStyle: {normal: {}},
data: vncData
},
{
name: 'ES',
type: 'line',
stack: '总量',
areaStyle: {normal: {}},
data: esData
2020-04-12 22:19:13 +08:00
},
{
name: 'CUSTOM',
type: 'line',
stack: '总量',
areaStyle: {normal: {}},
data: customData
2019-08-07 13:16:23 +08:00
}
]
};
myChart.setOption(option);
}
}
});
var myChart1 = echarts.init(document.getElementById('myChart1'));
var myChart2 = echarts.init(document.getElementById('myChart2'));
$.ajax({
type: "GET",
url: "/get/dashboard/pie_data",
dataType: "json",
success: function (e) {
2019-09-02 19:12:46 +08:00
var d = e.data;
console.log(d);
var option = {
tooltip: {
trigger: 'item',
formatter: "{a} <br/>{b} : {c} ({d}%)"
},
series: [
{
name: '来源地区',
type: 'pie',
2019-12-03 21:28:24 +08:00
radius: '70%',
2019-08-29 12:43:00 +08:00
center: ['50%', '60%'],
data: d.regionList,
itemStyle: {
emphasis: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
};
myChart1.setOption(option);
var option = {
tooltip: {
trigger: 'item',
formatter: "{a} <br/>{b} : {c} ({d}%)"
},
series: [
{
name: '攻击者IP',
type: 'pie',
2019-12-03 21:28:24 +08:00
radius: '70%',
2019-08-29 12:43:00 +08:00
center: ['50%', '60%'],
data: d.ipList,
itemStyle: {
emphasis: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
};
myChart2.setOption(option);
}
});
2019-12-03 21:28:24 +08:00
var myChart3 = echarts.init(document.getElementById('myChart3'));
$.ajax({
type: "GET",
url: "/data/get/account",
dataType: "json",
success: function (e) {
var d = e.data;
var option = {
tooltip: {
show: true
},
series: [{
name: '账号',
type: "wordCloud",
gridSize: 6,
shape: 'circle',
sizeRange: [12, 50],
width: '100%',
height: '100%',
textStyle: {
normal: {
color: function () {
return 'rgb(' + [
Math.round(Math.random() * 160),
Math.round(Math.random() * 160),
Math.round(Math.random() * 160)
].join(',') + ')';
}
},
emphasis: {
shadowBlur: 10,
shadowColor: '#333'
}
},
data: d
}]
};
myChart3.setOption(option);
}
});
var myChart4 = echarts.init(document.getElementById('myChart4'));
$.ajax({
type: "GET",
url: "/data/get/password",
dataType: "json",
success: function (e) {
var d = e.data;
var option = {
tooltip: {
show: true
},
series: [{
name: '密码',
type: "wordCloud",
gridSize: 6,
shape: 'circle',
sizeRange: [12, 50],
width: '100%',
height: '100%',
textStyle: {
normal: {
color: function () {
return 'rgb(' + [
Math.round(Math.random() * 160),
Math.round(Math.random() * 160),
Math.round(Math.random() * 160)
].join(',') + ')';
}
},
emphasis: {
shadowBlur: 10,
shadowColor: '#333'
}
},
data: d
}]
};
myChart4.setOption(option);
}
});
window.onresize = function () {
myChart.resize();
myChar1.resize();
myChar2.resize();
myChar3.resize();
myChar4.resize();
};
2019-08-07 13:16:23 +08:00
</script>