Sentry/assets/coffee/cpu.coffee
Gregory Ballantine c878447c45
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Changed to using a tabbed layout instead of separate pages for everything
2022-10-28 01:06:09 -04:00

30 lines
956 B
CoffeeScript

si = require('systeminformation')
window.addEventListener('load', () ->
# 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()
, false)
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)