Skip to content

Commit

Permalink
bug fixed on amd cpu temp
Browse files Browse the repository at this point in the history
  • Loading branch information
tahsinkoc committed Feb 21, 2024
1 parent 62aba96 commit 012ec93
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/js/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,16 @@ const events = {
let colored = '#209EE7'
indicator.drawIndicator('clock-val', 'clock', Math.floor(parsed['CPU Core #1']), Math.floor(parsed['CPU Core #1Max']), ' Mhz')
}

},
4: function render(parsed) {

let hardwareName = parsed.hwn
// console.log(parsed);
if (hardwareName.includes('AMD')) {

cpuTempBar.style.width = Math.floor(parsed['Core #1']) / 105 * 100 + '%'
cpuTemp.textContent = Math.floor(parsed['Core #1']) + ' °C'

cpuTempBar.style.width = Math.floor(parsed['Core (Tctl/Tdie)']) / 105 * 100 + '%'
cpuTemp.textContent = Math.floor(parsed['Core (Tctl/Tdie)']) + ' °C'

// indicator.drawIndicator('temp-val', 'temp', Math.floor(parsed['Core #1']))
} else {
Expand Down Expand Up @@ -146,17 +146,17 @@ const events = {
if (isVramLoaded) {

} else {

si.graphics().then(data => {
console.log(data.controllers[0]);
if (data.controllers[1] === undefined) {
document.getElementById('gmem-val').textContent = (data.controllers[0].memoryUsed / 1024 ).toFixed(3) + ' GB';
document.getElementById('gmem-val').textContent = (data.controllers[0].memoryUsed / 1024).toFixed(3) + ' GB';
indicator.drawGpuMemIndi('gmem-clock', 'gmem', Math.floor(data.controllers[0].memoryUsed / data.controllers[0].memoryTotal * 100), 100, '', Math.floor(parsed['GPU Memory']))
}else {
} else {
document.getElementById('gmem-val').textContent = data.controllers[1].vram / 1024 + ' GB';
}
// document.getElementById('gmem-val').textContent = ;
// console.log(data.controllers[0]);
// document.getElementById('gmem-val').textContent = ;
// console.log(data.controllers[0]);
})
// isVramLoaded = true
}
Expand Down Expand Up @@ -332,7 +332,7 @@ class Incicator {
element.style.strokeDashoffset = length - value / max * length;
glow.style.strokeDashoffset = length - value / max * length;
}
drawGpuMemV(id, value, max){
drawGpuMemV(id, value, max) {
let element = document.getElementById(id)
let glow = document.getElementById(id + 'g')
let length = element.getTotalLength();
Expand Down

0 comments on commit 012ec93

Please sign in to comment.