]> git.proxmox.com Git - flutter/pve_flutter_frontend.git/commitdiff
fix disk health check
authorTim Marx <t.marx@proxmox.com>
Mon, 20 Apr 2020 17:20:52 +0000 (19:20 +0200)
committerTim Marx <t.marx@proxmox.com>
Mon, 20 Apr 2020 18:21:06 +0000 (20:21 +0200)
Signed-off-by: Tim Marx <t.marx@proxmox.com>
lib/states/pve_node_overview_state.dart
lib/widgets/pve_node_overview.dart

index 1d3cbafc83025df6210e92746ab2096a40f82308..a978a8331c5de2daaa2e26d0d3a922ef83c80543 100644 (file)
@@ -28,6 +28,7 @@ abstract class PveNodeOverviewState
         }
         return s.state != 'running';
       });
+  bool get allDisksHealthy => !disks.any((s) => !isDiskHealthy(s));
 
   PveNodeOverviewState._();
 
@@ -43,4 +44,8 @@ abstract class PveNodeOverviewState
         ..isSuccess = false
         //class
         ..standalone = standalone);
+
+  bool isDiskHealthy(PveNodesDisksListModel disk) {
+    return ['OK', 'PASSED'].contains(disk.health);
+  }
 }
index 9d8df4f31e874d28ec4da3302fd9d59e93a10eee..977234be4fb80b07569f98302069fe01aedb35bf 100644 (file)
@@ -364,7 +364,10 @@ class PveNodeOverview extends StatelessWidget {
                                 .map(
                                   (d) => ListTile(
                                     dense: true,
-                                    leading: Icon(FontAwesomeIcons.solidHdd),
+                                    leading: Icon(FontAwesomeIcons.solidHdd,
+                                        color: state.isDiskHealthy(d)
+                                            ? Colors.grey
+                                            : Colors.red),
                                     title: Text(
                                         '${d.type.toUpperCase()}: ${d.devPath}'),
                                     subtitle: Text(