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) { switch (this.gpu_manufacturer) {
case "nvidia": case "nvidia":
this.get_nvidia_gpu_use(); this.get_nvidia_gpu_use();
break;
case "amdgpu": case "amdgpu":
this.get_amdgpu_gpu_use(); this.get_amdgpu_gpu_use();
break;
} }
value = this.gpu_use / 100; value = this.gpu_use / 100;
text1 = _("GPU Usage"); text1 = _("GPU Usage");
@ -239,8 +241,10 @@ SystemMonitorGraph.prototype = {
switch (this.gpu_manufacturer) { switch (this.gpu_manufacturer) {
case "nvidia": case "nvidia":
this.get_nvidia_gpu_mem(); this.get_nvidia_gpu_mem();
break;
case "amdgpu": case "amdgpu":
this.get_amdgpu_gpu_mem(); this.get_amdgpu_gpu_mem();
break;
} }
let gpu_mem_use = 100 * this.gpu_mem[1] / this.gpu_mem[0]; let gpu_mem_use = 100 * this.gpu_mem[1] / this.gpu_mem[0];
value = gpu_mem_use / 100; value = gpu_mem_use / 100;

View File

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