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.eb...@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



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to