Sentry/assets/coffee/cpu.coffee
Gregory Ballantine 4d4c5b2f16
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Added more CPU information the CPU page
2022-08-23 18:45:53 -04:00

29 lines
931 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('cpuClockBase').innerText = data.speed
document.getElementById('cpuClockBoost').innerText = data.speedMax
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
document.getElementById('cpuTempDisplay').children.item(0).style.height = ((100 - parseFloat(data.main)) + '%')
).catch((error) ->
console.error(error)
)
setTimeout(setCpuTemp, 2000)