[pbs-devel] [PATCH proxmox-widget-toolkit 1/2] panel: disk list: return consistent value for unknown smart status

Christian Ebner c.ebner at proxmox.com
Fri Nov 29 11:41:33 CET 2024


Until now, the reported smart value is returned unconditionally, even
if the drive might report an `UNKNOWN` status.
To allow for better handling of the unknown smart state, also return
the utils helper text in that case. This allows for better handling
of e.g. conditionally showing the smart values window.

Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
 src/panel/DiskList.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/panel/DiskList.js b/src/panel/DiskList.js
index dc10ac5..dfd8c8e 100644
--- a/src/panel/DiskList.js
+++ b/src/panel/DiskList.js
@@ -7,7 +7,12 @@ Ext.define('pmx-disk-list', {
 	{
 	    name: 'status',
 	    convert: function(value, rec) {
-		if (value) return value;
+		if (value) {
+		    if (value.toLowerCase() === 'unknown') {
+			return Proxmox.Utils.unknownText;
+		    }
+		    return value;
+		}
 		if (rec.data.health) {
 		    return rec.data.health;
 		}
-- 
2.39.5





More information about the pbs-devel mailing list