Sentry/assets/coffee/cpu.coffee

28 lines
760 B
CoffeeScript
Raw Normal View History

2022-05-25 14:28:19 -04:00
si = require('systeminformation')
window.onload = () ->
# 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
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)
)
# 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)
)
setTimeout(setCpuTemp, 2000)