|
|
@ -96,7 +96,6 @@ function displayServerData(data){ |
|
|
|
serverName.textContent = serverTitle + " - Not update -"; |
|
|
|
} |
|
|
|
|
|
|
|
console.log(serverData); |
|
|
|
// 网速
|
|
|
|
if ('network_list' in serverData){ |
|
|
|
let networkInfo = document.createElement('div'); |
|
|
@ -121,6 +120,24 @@ function displayServerData(data){ |
|
|
|
add_bar(serverCard); |
|
|
|
} |
|
|
|
|
|
|
|
// CPU
|
|
|
|
if ('cpu' in serverData){ |
|
|
|
let cpuInfo = document.createElement('div'); |
|
|
|
cpuInfo.className = 'cpu-info'; |
|
|
|
|
|
|
|
temperature_list_str = ""; |
|
|
|
serverData.cpu['temperature_list'].forEach(function(v){ |
|
|
|
temperature_list_str += v + " ℃ "; |
|
|
|
}); |
|
|
|
cpuInfo.innerHTML = "<strong>CPU型号 : </strong>" + serverData.cpu['name'] + "<br>" + |
|
|
|
"<strong>温度 : </strong>" + temperature_list_str + "<br>" + |
|
|
|
"<strong>占用率 : </strong>" + serverData.cpu['core_avg_occupy'] + "%"; |
|
|
|
|
|
|
|
serverCard.appendChild(cpuInfo); |
|
|
|
// 分割线
|
|
|
|
add_bar(serverCard); |
|
|
|
} |
|
|
|
|
|
|
|
// 内存
|
|
|
|
if ('memory' in serverData){ |
|
|
|
let memoryInfo = document.createElement('div'); |
|
|
@ -194,7 +211,7 @@ function displayServerData(data){ |
|
|
|
// 添加进程信息
|
|
|
|
let processInfo = document.createElement('div'); |
|
|
|
processInfo.classList.add('process-info'); |
|
|
|
processInfo.innerHTML = "<strong>使用情况:</strong>"; |
|
|
|
processInfo.innerHTML = "使用情况: "; |
|
|
|
|
|
|
|
gpu.process_list.sort((a, b) => b.memory - a.memory); |
|
|
|
gpu.process_list.forEach(function(item, index){ |
|
|
|