Skip to content
This repository was archived by the owner on Oct 22, 2021. It is now read-only.

Commit 8eb160a

Browse files
committed
Do not display more than 4 cores (mod_cpuinfo)
1 parent 404451c commit 8eb160a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/classes/cpuinfo.class.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Cpuinfo {
2828
<canvas id="mod_cpuinfo_canvas_${i}" height="60"></canvas>
2929
</div>`;
3030

31-
if (i === data.cores-1) {
31+
if (i === data.cores-1 || i === 3) { // Do not display more than 4 cores, for UX reasons
3232
clearTimeout(timeId); // Clear fail timer
3333
resolve(true);
3434
}
@@ -41,6 +41,8 @@ class Cpuinfo {
4141
}
4242
waitForCoresDOM().then(() => {
4343
for (var i = 0; i < data.cores; i++) {
44+
if (i >= 4) break;
45+
4446
// Create TimeSeries
4547
this.series.push(new TimeSeries());
4648

@@ -83,6 +85,7 @@ class Cpuinfo {
8385
updateInfo() {
8486
this.si.currentLoad((data) => {
8587
data.cpus.forEach((e, i) => {
88+
if (i >= 4) break;
8689
this.series[i].append(new Date().getTime(), e.load);
8790
});
8891
});

0 commit comments

Comments
 (0)