2019-08-07 13:16:23 +08:00
|
|
|
{{template "header"}}
|
|
|
|
<style>
|
|
|
|
.title {
|
|
|
|
font-weight: bold;
|
|
|
|
font-size: 18px;
|
|
|
|
margin-bottom: 30px;
|
2019-08-25 15:22:37 +08:00
|
|
|
color: #383838;
|
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
|
|
|
|
|
|
|
.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;
|
|
|
|
}
|
|
|
|
|
2019-08-25 15:22:37 +08:00
|
|
|
.lb_mem_cache {
|
|
|
|
color: #3d9671;
|
|
|
|
}
|
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-08-26 23:38:32 +08:00
|
|
|
<a type="button" class="btn btn-custom" href="https://hfish.io/docs"
|
2019-08-07 13:16:23 +08:00
|
|
|
target="_blank">查看帮助 <span class="m-l-5"><i
|
|
|
|
class="zmdi zmdi-help-outline"></i></span>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<h4 class="page-title">仪表盘</h4>
|
|
|
|
</div>
|
|
|
|
<div class="col-xs-12 col-md-6 col-lg-6 col-xl-3">
|
|
|
|
<div class="card-box tilebox-two">
|
2019-08-11 20:14:28 +08:00
|
|
|
<i class="icon-ghost pull-xs-right text-muted"></i>
|
|
|
|
<h6 class="lb_ssh text-uppercase m-b-15 m-t-10">SSH 蜜罐</h6>
|
|
|
|
<h2 class="m-b-10"><span data-plugin="counterup">{{.sshSum}}</span></h2>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-xs-12 col-md-6 col-lg-6 col-xl-3">
|
|
|
|
<div class="card-box tilebox-two">
|
|
|
|
<i class="icon-layers pull-xs-right text-muted"></i>
|
|
|
|
<h6 class="lb_redis text-uppercase m-b-15 m-t-10">Redis 蜜罐</h6>
|
|
|
|
<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-08-07 13:16:23 +08:00
|
|
|
<div class="col-xs-12 col-md-6 col-lg-6 col-xl-3">
|
|
|
|
<div class="card-box tilebox-two">
|
|
|
|
<i class="icon-chart pull-xs-right text-muted"></i>
|
2019-08-11 20:14:28 +08:00
|
|
|
<h6 class="lb_mysql text-uppercase m-b-15 m-t-10">Mysql 蜜罐</h6>
|
|
|
|
<h2 class="m-b-10"><span data-plugin="counterup">{{.mysqlSum}}</span></h2>
|
2019-08-07 13:16:23 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-xs-12 col-md-6 col-lg-6 col-xl-3">
|
|
|
|
<div class="card-box tilebox-two">
|
|
|
|
<i class="icon-layers pull-xs-right text-muted"></i>
|
2019-08-11 20:14:28 +08:00
|
|
|
<h6 class="lb_ftp text-uppercase m-b-15 m-t-10">FTP 蜜罐</h6>
|
|
|
|
<h2 class="m-b-10"><span data-plugin="counterup">{{.ftpSum}}</span></h2>
|
2019-08-07 13:16:23 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2019-08-25 15:22:37 +08:00
|
|
|
|
|
|
|
<div class="col-xs-12 col-md-6 col-lg-6 col-xl-3">
|
|
|
|
<div class="card-box tilebox-two">
|
|
|
|
<i class="icon-social-pintarest pull-xs-right text-muted"></i>
|
|
|
|
<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>
|
|
|
|
|
|
|
|
<div class="col-xs-12 col-md-6 col-lg-6 col-xl-3">
|
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-plane pull-xs-right text-muted"></i>
|
|
|
|
<h6 class="lb_telnet text-uppercase m-b-15 m-t-10">TELNET 蜜罐</h6>
|
|
|
|
<h2 class="m-b-10"><span data-plugin="counterup">{{.telnetSum}}</span></h2>
|
2019-08-07 13:16:23 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2019-08-25 15:22:37 +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>
|
|
|
|
<h6 class="lb_web text-uppercase m-b-15 m-t-10">WEB 蜜罐</h6>
|
|
|
|
<h2 class="m-b-10"><span data-plugin="counterup">{{.webSum}}</span></h2>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2019-08-25 15:22:37 +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>
|
|
|
|
<h6 class="lb_deep text-uppercase m-b-15 m-t-10">DEEP 蜜罐</h6>
|
|
|
|
<h2 class="m-b-10"><span data-plugin="counterup">{{.deepSum}}</span></h2>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2019-08-07 13:16:23 +08:00
|
|
|
<div class="col-md-2">
|
2019-08-25 15:22:37 +08:00
|
|
|
<div class="card-box" style="height: 550px;">
|
2019-08-07 13:16:23 +08:00
|
|
|
<p class="title">服务状态</p>
|
|
|
|
<p><span class="openx"></span>ADMIN</p>
|
|
|
|
|
|
|
|
{{if eq .apiStatus "1"}}
|
|
|
|
<p><span class="openx"></span>API</p>
|
|
|
|
{{else}}
|
|
|
|
<p><span class="closex"></span>API</p>
|
|
|
|
{{end}}
|
|
|
|
|
2019-08-25 15:22:37 +08:00
|
|
|
{{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}}
|
|
|
|
|
2019-08-25 15:22:37 +08:00
|
|
|
{{if eq .memCacheStatus "1"}}
|
|
|
|
<p><span class="openx"></span>MEMCACHE</p>
|
|
|
|
{{else}}
|
|
|
|
<p><span class="closex"></span>MEMCACHE</p>
|
|
|
|
{{end}}
|
|
|
|
|
2019-08-07 13:16:23 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-md-10">
|
|
|
|
<div class="card-box">
|
2019-08-25 15:22:37 +08:00
|
|
|
<div id="myChart" style="width:100%;height:200px;"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-5">
|
|
|
|
<div class="card-box">
|
|
|
|
<div id="myChart1" style="width:100%;height:250px;"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-5">
|
|
|
|
<div class="card-box">
|
|
|
|
<div id="myChart2" style="width:100%;height:250px;"></div>
|
2019-08-07 13:16:23 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{template "footer" }}
|
|
|
|
<script src="/static/libs/echarts/echarts.js"></script>
|
2019-08-12 14:15:36 +08:00
|
|
|
<script src="/static/libs/moment/moment.min.js"></script>
|
2019-08-07 13:16:23 +08:00
|
|
|
<script>
|
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,
|
|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
|
|
|
|
|
|
|
$.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);
|
|
|
|
mysqlData[index] = 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);
|
|
|
|
redisData[index] = 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);
|
|
|
|
sshData[index] = 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);
|
|
|
|
webData[index] = 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);
|
|
|
|
deepData[index] = 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);
|
|
|
|
ftpData[index] = 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);
|
|
|
|
telnetData[index] = d.telnet[item];
|
2019-08-11 20:14:28 +08:00
|
|
|
}
|
|
|
|
|
2019-08-25 15:22:37 +08:00
|
|
|
for (var item in d.memCache) {
|
|
|
|
var index = xdata.indexOf(item);
|
|
|
|
memCacheData[index] = d.memCache[item];
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-08-07 13:16:23 +08:00
|
|
|
var option = {
|
|
|
|
title: {
|
2019-08-12 14:42:25 +08:00
|
|
|
text: '最近24小时'
|
2019-08-07 13:16:23 +08:00
|
|
|
},
|
|
|
|
tooltip: {
|
|
|
|
trigger: 'axis',
|
|
|
|
axisPointer: {
|
|
|
|
type: 'cross',
|
|
|
|
label: {
|
|
|
|
backgroundColor: '#6a7985'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
legend: {
|
2019-08-25 15:22:37 +08:00
|
|
|
data: ['WEB', 'DEEP', 'SSH', 'REDIS', 'MYSQL', 'TELNET', 'FTP', 'MEMCACHE']
|
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
|
2019-08-25 15:22:37 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'MEMCACHE',
|
|
|
|
type: 'line',
|
|
|
|
stack: '总量',
|
|
|
|
areaStyle: {normal: {}},
|
|
|
|
data: memCacheData
|
2019-08-07 13:16:23 +08:00
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
|
|
|
myChart.setOption(option);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2019-08-25 15:22:37 +08:00
|
|
|
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) {
|
|
|
|
var d = e;
|
|
|
|
|
|
|
|
console.log(d);
|
|
|
|
|
|
|
|
var option = {
|
|
|
|
title: {
|
2019-08-29 12:43:00 +08:00
|
|
|
text: '[攻击地区] TOP10',
|
2019-08-25 15:22:37 +08:00
|
|
|
x: 'left'
|
|
|
|
},
|
|
|
|
tooltip: {
|
|
|
|
trigger: 'item',
|
|
|
|
formatter: "{a} <br/>{b} : {c} ({d}%)"
|
|
|
|
},
|
|
|
|
series: [
|
|
|
|
{
|
|
|
|
name: '来源地区',
|
|
|
|
type: 'pie',
|
2019-08-29 12:43:00 +08:00
|
|
|
radius: '60%',
|
|
|
|
center: ['50%', '60%'],
|
2019-08-25 15:22:37 +08:00
|
|
|
data: d.regionList,
|
|
|
|
itemStyle: {
|
|
|
|
emphasis: {
|
|
|
|
shadowBlur: 10,
|
|
|
|
shadowOffsetX: 0,
|
|
|
|
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
|
|
|
|
|
|
|
myChart1.setOption(option);
|
|
|
|
|
|
|
|
|
|
|
|
var option = {
|
|
|
|
title: {
|
2019-08-29 12:43:00 +08:00
|
|
|
text: '[攻击IP] TOP10',
|
2019-08-25 15:22:37 +08:00
|
|
|
x: 'left'
|
|
|
|
},
|
|
|
|
tooltip: {
|
|
|
|
trigger: 'item',
|
|
|
|
formatter: "{a} <br/>{b} : {c} ({d}%)"
|
|
|
|
},
|
|
|
|
series: [
|
|
|
|
{
|
|
|
|
name: '攻击者IP',
|
|
|
|
type: 'pie',
|
2019-08-29 12:43:00 +08:00
|
|
|
radius: '60%',
|
|
|
|
center: ['50%', '60%'],
|
2019-08-25 15:22:37 +08:00
|
|
|
data: d.ipList,
|
|
|
|
itemStyle: {
|
|
|
|
emphasis: {
|
|
|
|
shadowBlur: 10,
|
|
|
|
shadowOffsetX: 0,
|
|
|
|
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
|
|
|
|
|
|
|
myChart2.setOption(option);
|
|
|
|
}
|
|
|
|
});
|
2019-08-07 13:16:23 +08:00
|
|
|
</script>
|