feat: add operational Dashboard
This commit is contained in:
1 parent
4a1959ecd6
commit
b8b741ccee
23 files changed
+1278
-59
No files matched your search
@@ -14,6 +14,8 @@ from app.inventory.exceptions import (
|
||||
from app.inventory.models import (
|
||||
InventoryAssetIDHistoryEntry,
|
||||
InventoryCreateRequest,
|
||||
InventoryFleetAttentionSummary,
|
||||
InventoryFleetSummary,
|
||||
InventoryMetadataUpdateRequest,
|
||||
InventoryMinerDetail,
|
||||
InventoryMinerSummary,
|
||||
@@ -157,6 +159,24 @@ class InventoryService:
|
||||
for row in self.repository.list_miners(limit=limit, offset=offset)
|
||||
]
|
||||
|
||||
def summarize_fleet(self) -> InventoryFleetSummary:
|
||||
row = self.repository.summarize_fleet()
|
||||
return InventoryFleetSummary(
|
||||
total=row["total"],
|
||||
runtime_online=row["runtime_online"],
|
||||
runtime_offline=row["runtime_offline"],
|
||||
runtime_unknown=row["runtime_unknown"],
|
||||
lifecycle_in_repair=row["lifecycle_in_repair"],
|
||||
lifecycle_spare=row["lifecycle_spare"],
|
||||
lifecycle_retired=row["lifecycle_retired"],
|
||||
attention=InventoryFleetAttentionSummary(
|
||||
offline=row["attention_offline"],
|
||||
unknown=row["attention_unknown"],
|
||||
unstable=row["attention_unstable"],
|
||||
repair=row["attention_repair"],
|
||||
),
|
||||
)
|
||||
|
||||
def search_miners(
|
||||
self,
|
||||
filters: InventorySearchFilters,
|
||||
|
||||
Reference in new issue
Block a user