Sentry/assets/coffee/cpu.coffee
Gregory Ballantine ae155b2d7e
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Made the tabs look better
2022-10-29 01:14:08 -04:00

29 lines
932 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
).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)