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
|
|
|
|
document.getElementById('cpuClock').innerText = data.speed
|
2022-05-25 14:43:54 -04:00
|
|
|
console.log(data)
|
|
|
|
).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
|
|
|
|
console.log(data)
|
|
|
|
).catch((error) ->
|
|
|
|
console.error(error)
|
|
|
|
)
|
2022-05-25 16:23:42 -04:00
|
|
|
setTimeout(setCpuTemp, 2000)
|