Update index.js

pull/199/head
midoks 3 years ago
parent daf6c9bff8
commit ef6adfd82d
  1. 21
      route/static/app/index.js

@ -83,14 +83,19 @@ function showCpuTips(rdata){
$('#cpuChart .mask').unbind(); $('#cpuChart .mask').unbind();
$('#cpuChart .mask').hover(function() { $('#cpuChart .mask').hover(function() {
var cpuText = ''; var cpuText = '';
for (var i = 1; i < rdata.cpu[2].length + 1; i++) {
var cpuUse = parseFloat(rdata.cpu[2][i - 1] == 0 ? 0 : rdata.cpu[2][i - 1]).toFixed(1) if (rdata.cpu[2].length == 1){
if (i % 2 != 0) { cpuText += 'CPU-1:' + cpuUse + '%'
cpuText += 'CPU-' + i + ':' + cpuUse + '%&nbsp;|&nbsp;' } else{
} else { for (var i = 1; i < rdata.cpu[2].length + 1; i++) {
cpuText += 'CPU-' + i + ':' + cpuUse + '%' var cpuUse = parseFloat(rdata.cpu[2][i - 1] == 0 ? 0 : rdata.cpu[2][i - 1]).toFixed(1)
cpuText += '\n' if (i % 2 != 0) {
} cpuText += 'CPU-' + i + ':' + cpuUse + '%&nbsp;|&nbsp;'
} else {
cpuText += 'CPU-' + i + ':' + cpuUse + '%'
cpuText += '\n'
}
}
} }
layer.tips(rdata.cpu[3] + "</br>" + rdata.cpu[5] + "个物理CPU," + (rdata.cpu[4]) + "个物理核心," + rdata.cpu[1] + "个逻辑核心</br>" + cpuText, this, { time: 0, tips: [1, '#999'] }); layer.tips(rdata.cpu[3] + "</br>" + rdata.cpu[5] + "个物理CPU," + (rdata.cpu[4]) + "个物理核心," + rdata.cpu[1] + "个逻辑核心</br>" + cpuText, this, { time: 0, tips: [1, '#999'] });
}, function() { }, function() {

Loading…
Cancel
Save