修改展示

This commit is contained in:
wenc000 2020-08-12 12:04:39 +08:00
parent a8fbb1d572
commit fbcf8e48fd

View File

@ -38,16 +38,25 @@
<div :id="'disk_' + index" class="disk-info"></div> <div :id="'disk_' + index" class="disk-info"></div>
</div> </div>
</div> </div>
<blockquote class="layui-elem-quote">
<span><b>CPU使用情况%</b></span>
</blockquote>
<div class="layui-row layui-col-space15"> <div class="layui-row layui-col-space15">
<div class="layui-col-sm12"> <div class="layui-col-sm12">
<div id="cpu" class="cpu-info"></div> <div id="cpu" class="cpu-info"></div>
</div> </div>
</div> </div>
<blockquote class="layui-elem-quote">
<span><b>内存使用情况GB</b></span>
</blockquote>
<div class="layui-row layui-col-space15"> <div class="layui-row layui-col-space15">
<div class="layui-col-sm12"> <div class="layui-col-sm12">
<div id="memory" class="cpu-info"></div> <div id="memory" class="cpu-info"></div>
</div> </div>
</div> </div>
<blockquote class="layui-elem-quote">
<span><b>JVM使用情况MB</b></span>
</blockquote>
<div class="layui-row layui-col-space15"> <div class="layui-row layui-col-space15">
<div class="layui-col-sm12"> <div class="layui-col-sm12">
<div id="jvm" class="cpu-info"></div> <div id="jvm" class="cpu-info"></div>
@ -67,6 +76,7 @@
}).use(['index', 'laydate'], function(){ }).use(['index', 'laydate'], function(){
var $ = layui.$; var $ = layui.$;
var clientId = top.restAjax.params(window.location.href).clientId; var clientId = top.restAjax.params(window.location.href).clientId;
var firstLoading = true;
new Vue({ new Vue({
el: '#app', el: '#app',
@ -97,7 +107,7 @@
}, },
series: [ series: [
{ {
name: '磁盘占用', name: '磁盘占用情况',
type: 'gauge', type: 'gauge',
radius: '85%', radius: '85%',
axisLine: { axisLine: {
@ -111,7 +121,7 @@
min: 0, min: 0,
max: disk.total, max: disk.total,
detail: {formatter: '{value}GB'}, detail: {formatter: '{value}GB'},
data: [{value: (parseFloat(disk.total) - parseFloat(disk.usable)).toFixed(2), name: '磁盘使用'}] data: [{value: (parseFloat(disk.total) - parseFloat(disk.usable)).toFixed(2), name: '磁盘用'}]
} }
] ]
}); });
@ -133,9 +143,6 @@
} }
var echart = echarts.init(document.getElementById('cpu')); var echart = echarts.init(document.getElementById('cpu'));
echart.setOption({ echart.setOption({
title: {
text: 'CPU使用情况%'
},
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
formatter: function(params, ticket, callback) { formatter: function(params, ticket, callback) {
@ -218,9 +225,6 @@
} }
var echart = echarts.init(document.getElementById('memory')); var echart = echarts.init(document.getElementById('memory'));
echart.setOption({ echart.setOption({
title: {
text: '内存使用情况GB'
},
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
formatter: function(params, ticket, callback) { formatter: function(params, ticket, callback) {
@ -298,9 +302,6 @@
} }
var echart = echarts.init(document.getElementById('jvm')); var echart = echarts.init(document.getElementById('jvm'));
echart.setOption({ echart.setOption({
title: {
text: 'JVM使用情况MB'
},
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
formatter: function(params, ticket, callback) { formatter: function(params, ticket, callback) {
@ -366,6 +367,7 @@
}, },
initClientInfo: function() { initClientInfo: function() {
var self = this; var self = this;
var loadLayerIndex;
top.restAjax.get(top.restAjax.path('api/client/getclientinfobyclientid/{clientId}', [clientId]), {}, null, function(code, data) { top.restAjax.get(top.restAjax.path('api/client/getclientinfobyclientid/{clientId}', [clientId]), {}, null, function(code, data) {
self.system = data.data.system; self.system = data.data.system;
self.diskList = data.data.diskList; self.diskList = data.data.diskList;
@ -386,7 +388,14 @@
}) })
}, function(code, data) { }, function(code, data) {
top.dialog.msg(data.msg); top.dialog.msg(data.msg);
}) }, function() {
if(firstLoading) {
loadLayerIndex = top.dialog.msg(top.dataMessage.loading, {icon: 16, time: 0, shade: 0.3});
firstLoading = false;
}
}, function() {
top.dialog.close(loadLayerIndex);
});
} }
}, },
mounted: function() { mounted: function() {