From 6bf74d59690318bdc3eaa92eb5660cda153a85df Mon Sep 17 00:00:00 2001 From: Raymundo Cassani Date: Sun, 9 Feb 2025 16:08:41 -0500 Subject: [PATCH] system-monitor-graph@rcassani: Bugfix: `switch` structures in JavaScript are fall-through (#1399) * https://www.freecodecamp.org/news/fall-through-in-javascript-switch-statements/ --- files/system-monitor-graph@rcassani/desklet.js | 6 +++++- files/system-monitor-graph@rcassani/metadata.json | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/files/system-monitor-graph@rcassani/desklet.js b/files/system-monitor-graph@rcassani/desklet.js index b7382a4..c82c49f 100644 --- a/files/system-monitor-graph@rcassani/desklet.js +++ b/files/system-monitor-graph@rcassani/desklet.js @@ -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 diff --git a/files/system-monitor-graph@rcassani/metadata.json b/files/system-monitor-graph@rcassani/metadata.json index dcf8a15..b356efa 100644 --- a/files/system-monitor-graph@rcassani/metadata.json +++ b/files/system-monitor-graph@rcassani/metadata.json @@ -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 }