system-monitor-graph@rcassani: Bugfix: switch structures in JavaScript are fall-through (#1399)

* https://www.freecodecamp.org/news/fall-through-in-javascript-switch-statements/
This commit is contained in:
Raymundo Cassani 2025-02-09 16:08:41 -05:00 committed by GitHub
parent 1ca999d361
commit 6bf74d5969
2 changed files with 6 additions and 2 deletions

View File

@ -228,8 +228,10 @@ SystemMonitorGraph.prototype = {
switch (this.gpu_manufacturer) {
case "nvidia":
this.get_nvidia_gpu_use();
break;
case "amdgpu":
this.get_amdgpu_gpu_use();
break;
}
value = this.gpu_use / 100;
text1 = _("GPU Usage");
@ -239,8 +241,10 @@ SystemMonitorGraph.prototype = {
switch (this.gpu_manufacturer) {
case "nvidia":
this.get_nvidia_gpu_mem();
break;
case "amdgpu":
this.get_amdgpu_gpu_mem();
break;
}
let gpu_mem_use = 100 * this.gpu_mem[1] / this.gpu_mem[0];
value = gpu_mem_use / 100;
@ -257,7 +261,7 @@ SystemMonitorGraph.prototype = {
text3 = this.gpu_mem[1].toFixed(1) + " / "
+ this.gpu_mem[0].toFixed(1) + " " + gpumem_prefix;
break;
}
}
}
// concatenate new value

View File

@ -3,6 +3,6 @@
"uuid": "system-monitor-graph@rcassani",
"name": "System monitor graph",
"description": "Creates graphs for system variables.",
"version": "1.7",
"version": "1.8",
"prevent-decorations": true
}