Sentry/assets/coffee/cpu.coffee
Gregory Ballantine fb1d0fc664
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Added a CPU info page with some rudimentary CPU temperature polling
2022-05-25 16:23:42 -04:00

28 lines
760 B
CoffeeScript

si = require('systeminformation')
window.onload = () ->
# Grab the static CPU information
si.cpu()
.then((data) ->
document.getElementById('cpuInfo').innerText = data.brand
document.getElementById('cpuCores').innerText = data.physicalCores
document.getElementById('cpuThreads').innerText = data.cores
document.getElementById('cpuClock').innerText = data.speed
console.log(data)
).catch((error) ->
console.error(error)
)
# Start the CPU temperature loop
setCpuTemp()
setCpuTemp = () ->
si.cpuTemperature()
.then((data) ->
document.getElementById('cpuTemp').innerText = data.main
console.log(data)
).catch((error) ->
console.error(error)
)
setTimeout(setCpuTemp, 2000)