Correct issue with hide on diskio

This commit is contained in:
nicolargo 2025-11-16 10:41:35 +01:00
parent e660520eb2
commit e7bd8d4768
3 changed files with 2 additions and 3 deletions

View File

@ -245,7 +245,7 @@ class DiskioPlugin(GlancesPluginModel):
# Disk list (sorted by name)
for i in self.sorted_stats():
# Hide stats if never be different from 0 (issue #1787)
if all(self.get_views(item=i[self.get_key()], key=f, option='hidden') for f in self.hide_zero_fields):
if self.hide_zero and all(i.get(f) == 0 for f in self.hide_zero_fields):
continue
# Is there an alias for the disk name ?
disk_name = i['alias'] if 'alias' in i else i['disk_name']

View File

@ -284,7 +284,7 @@ class NetworkPlugin(GlancesPluginModel):
if ('is_up' in i) and (i['is_up'] is False):
continue
# Hide stats if never be different from 0 (issue #1787)
if all(self.get_views(item=i[self.get_key()], key=f, option='hidden') for f in self.hide_zero_fields):
if self.hide_zero and all(i.get(f) == 0 for f in self.hide_zero_fields):
continue
# Format stats
# Is there an alias for the interface name ?

View File

@ -580,7 +580,6 @@ class GlancesPluginModel:
item_views = self.views
else:
item_views = self.views[item]
if key is None:
return item_views
if key not in item_views: