更新 simpleadmin/www/index.html

This commit is contained in:
sky 2024-12-08 20:03:41 +08:00
parent e18e39db35
commit d3abaf7810

View File

@ -2031,7 +2031,7 @@
.then(response => response.text()) .then(response => response.text())
.then(data => { .then(data => {
const lines = data.split("\n"); const lines = data.split("\n");
// 跳过空行和Content-Type行 // Skip blank lines and Content-Type lines.
const validLines = lines.filter(line => line.trim() !== '' && line.includes(": ")).map(line => line.trim()); const validLines = lines.filter(line => line.trim() !== '' && line.includes(": ")).map(line => line.trim());
this.cpuUsage = parseFloat(validLines[0].split(": ")[1]).toFixed(1); this.cpuUsage = parseFloat(validLines[0].split(": ")[1]).toFixed(1);