Improve dashboard UI layout and status aggregation
All checks were successful
Build and Release / build-and-release (push) Successful in 1m36s
All checks were successful
Build and Release / build-and-release (push) Successful in 1m36s
- Move hosts panel to left side above system panel - Add dynamic column layout for hosts based on available width - Fix status aggregation to properly calculate host status from widgets - Align service panel columns with header - Use blue color for metrics without status indicators - Add offline host popup overlay - Use foreground color for panel titles
This commit is contained in:
@@ -178,6 +178,36 @@ impl SystemWidget {
|
||||
pub fn get_kernel_version(&self) -> Option<String> {
|
||||
self.kernel_version.clone()
|
||||
}
|
||||
|
||||
/// Get overall status by aggregating all component statuses
|
||||
pub fn get_overall_status(&self) -> Status {
|
||||
if !self.has_data {
|
||||
return Status::Offline;
|
||||
}
|
||||
|
||||
let mut statuses = vec![self.cpu_status, self.memory_status, self.backup_status];
|
||||
|
||||
// Add storage pool and drive statuses
|
||||
for pool in &self.storage_pools {
|
||||
statuses.push(pool.status);
|
||||
for drive in &pool.drives {
|
||||
statuses.push(drive.status);
|
||||
}
|
||||
for drive in &pool.data_drives {
|
||||
statuses.push(drive.status);
|
||||
}
|
||||
for drive in &pool.parity_drives {
|
||||
statuses.push(drive.status);
|
||||
}
|
||||
}
|
||||
|
||||
// Add backup repository statuses
|
||||
for repo in &self.backup_repositories {
|
||||
statuses.push(repo.status);
|
||||
}
|
||||
|
||||
Status::aggregate(&statuses)
|
||||
}
|
||||
}
|
||||
|
||||
use super::Widget;
|
||||
|
||||
Reference in New Issue
Block a user