[pve-devel] [PATCH proxmox-widget-toolkit 1/2] panel: disk list: return consistent value for unknown smart status
Thomas Lamprecht
t.lamprecht at proxmox.com
Tue Feb 25 17:17:33 CET 2025
Am 29.11.24 um 11:41 schrieb Christian Ebner:
> 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;
> + }
hmm, using translated strings for internal state is not fully ideal IMO.
Maybe just normalize it here to lowercase and place a renderer on where
it matters?
> + return value;
> + }
> if (rec.data.health) {
> return rec.data.health;
> }
More information about the pve-devel
mailing list