2022-05-25 14:28:19 -04:00
|
|
|
si = require('systeminformation')
|
|
|
|
|
|
|
|
window.onload = () ->
|
2022-05-25 16:23:42 -04:00
|
|
|
# Grab the static CPU information
|
2022-05-25 14:28:19 -04:00
|
|
|
si.cpu()
|
|
|
|
.then((data) ->
|
2022-05-25 14:43:54 -04:00
|
|
|
document.getElementById('cpuInfo').innerText = data.brand
|
2022-05-25 16:23:42 -04:00
|
|
|
document.getElementById('cpuCores').innerText = data.physicalCores
|
|
|
|
document.getElementById('cpuThreads').innerText = data.cores
|
2022-08-23 18:45:53 -04:00
|
|
|
document.getElementById('cpuClockBase').innerText = data.speed
|
|
|
|
document.getElementById('cpuClockBoost').innerText = data.speedMax
|
|
|
|
console.log(data)
|
2022-05-25 14:43:54 -04:00
|
|
|
).catch((error) ->
|
|
|
|
console.error(error)
|
|
|
|
)
|
2022-05-25 16:23:42 -04:00
|
|
|
|
|
|
|
# Start the CPU temperature loop
|
|
|
|
setCpuTemp()
|
|
|
|
|
|
|
|
setCpuTemp = () ->
|
2022-05-25 14:43:54 -04:00
|
|
|
si.cpuTemperature()
|
|
|
|
.then((data) ->
|
|
|
|
document.getElementById('cpuTemp').innerText = data.main
|
2022-06-08 22:46:56 -04:00
|
|
|
document.getElementById('cpuTempDisplay').children.item(0).style.height = ((100 - parseFloat(data.main)) + '%')
|
2022-05-25 14:43:54 -04:00
|
|
|
).catch((error) ->
|
|
|
|
console.error(error)
|
|
|
|
)
|
2022-05-25 16:23:42 -04:00
|
|
|
setTimeout(setCpuTemp, 2000)
|