Commit 76183631 by 杨琪琪

ocr调用统计-折线图添加超量显示;授权管理-添加折线图;

parent aef9242c
......@@ -20,7 +20,7 @@ var defaultLineOptions = {
legend: {
data: [],
textStyle: {
color: "#fff",
// color: "#fff",
fontSize: 13,
},
type: 'scroll',
......@@ -57,6 +57,7 @@ var defaultLineOptions = {
end: 100
}
],
visualMap: null,
series: []
}
var defaultXBarOptions = {
......
......@@ -21,7 +21,7 @@
</style>
</head>
<body>
<div class="layui-layout">
<div class="layui-layout" id="charts-content">
<div class="layui-row layui-col-space5" style="height: 60vh">
<div class="layui-col-xs8" style="height: 100%">
<div class="content-box box-border" style="width: calc(100% - 20px);height: calc(65% - 20px)">
......@@ -165,7 +165,6 @@
<script src="js/utils/dateformat.js"></script>
<script src="js/utils/fileDownload.js"></script>
<script th:inline="javascript">
var gatewayUrl = [[${gatewayUrl}]];
</script>
......@@ -348,12 +347,12 @@
page: false,
cols: [
[
{field: 'name', title: '服务器资源池', align: 'center', style: 'color: #3e63cc',minWidth: "200"},
{field: 'name', title: '服务器资源池', align: 'center', style: 'color: #3e63cc', minWidth: "200"},
{
field: 'active',
title: '活跃状态',
align: 'center',
width:'100',
width: '100',
style: 'color: #3e63cc',
templet: function (data) {
if (data.active) {
......@@ -416,16 +415,16 @@
var option = {};
switch (type) {
case 'line':
option = defaultLineOptions;
option = JSON.parse(JSON.stringify(defaultLineOptions));
break;
case 'Xbar':
option = defaultXBarOptions;
option = JSON.parse(JSON.stringify(defaultXBarOptions));
break;
case 'Ybar':
option = defaultYBarOptions;
option = JSON.parse(JSON.stringify(defaultYBarOptions));
break;
case 'gauge':
option = defaultGaugeOptions;
option = JSON.parse(JSON.stringify(defaultGaugeOptions));
break;
default:
break;
......@@ -482,9 +481,10 @@
})
let option = {};
if (isNotMerge) {
option = defaultLineOptions;
option = JSON.parse(JSON.stringify(defaultLineOptions));
if (showLegend) {
option.legend.data = legendData;
option.legend.textStyle.color = '#fff';
} else {
option.legend.data = [];
}
......@@ -498,6 +498,29 @@
option.xAxis.minInterval = 1000 * 60;
break
case 'second':
option.visualMap = [{
show: true,
top: 30,
right: 10,
pieces: [
{
gt: 0,
lt: 195,
color: '#5470c6'
},
{
gte: 195,
color: '#AC3B2A'
}
],
outOfRange: {
color: '#999'
},
orient: "horizontal",
textStyle: {
color: "#fff"
}
}]
option.xAxis.minInterval = 1000;
break
default:
......@@ -525,6 +548,7 @@
} else {
// 替换合并
timeLineChart.setOption(option, {notMerge: false, replaceMerge: ['dataZoom', 'series']});
let op = timeLineChart.getOption();
}
}
......@@ -908,7 +932,7 @@
datazoom_end_n = event.end
}
})
let option = defaultYBarOptions;
let option = JSON.parse(JSON.stringify(defaultYBarOptions));
option.dataZoom[0].start = datazoom_start_n;
option.dataZoom[0].end = datazoom_end_n;
option.dataZoom[1].start = datazoom_start_n;
......@@ -949,12 +973,12 @@
method: 'get',
}).then(function (res) {
if (res.success) {
let {cpu,disk,gpu,load,memory} = res.data
updateGauge('cpuGaugeChart',cpu);
updateGauge('hardDiskGaugeChart',disk);
updateGauge('gpuGaugeChart',gpu);
updateGauge('sysLoadGaugeChart',load);
updateGauge('memoryGaugeChart',memory);
let {cpu, disk, gpu, load, memory} = res.data
updateGauge('cpuGaugeChart', cpu);
updateGauge('hardDiskGaugeChart', disk);
updateGauge('gpuGaugeChart', gpu);
updateGauge('sysLoadGaugeChart', load);
updateGauge('memoryGaugeChart', memory);
} else {
console.log(' --- 获取服务器总资源实时监控数据失败 --- ', res)
}
......@@ -963,7 +987,7 @@
})
}
function updateGauge(key,value){
function updateGauge(key, value) {
let option = window[key].getOption();
option.series[1].data[0] = value;
let color = "#58D9F9";
......@@ -1003,6 +1027,9 @@
if (gaugeInterval) {
clearInterval(gaugeInterval)
}
if (tableInterval) {
clearInterval(tableInterval)
}
}
// 移除监听器
......@@ -1051,6 +1078,7 @@
// 页面销毁前
$(window).on('beforeunload', function () {
console.log(' --- 页面即将销毁 --- ')
stopInterval();
chartsDestroy();
stopListener();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment