refactor(operational): migrate Reports/Operations pages to v2 metrics endpoints#76
Open
efr-nox wants to merge 12 commits intotetherto:developfrom
Open
refactor(operational): migrate Reports/Operations pages to v2 metrics endpoints#76efr-nox wants to merge 12 commits intotetherto:developfrom
efr-nox wants to merge 12 commits intotetherto:developfrom
Conversation
# Conflicts: # src/app/services/api/index.ts # src/types/api.d.ts
arif-dewi
previously approved these changes
May 5, 2026
arif-dewi
approved these changes
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates the single-site Reports > Operations pages to the v2
/auth/metrics/*API. Mirrors the pattern of #73 for Financial. Each refactored hook collapses the legacytail-log+ FE unwrap/reduce into a thinuseGetMetrics*Querywrapper. Response shapes match handlers inminingos-app-node:developand were verified live againstdev-moria.tether.to.Per-page status
groupBy. See granularity note below.summary.avgEfficiencyWThs. MinerType + MinerUnit tabs on legacy until BE shipsgroupByon/auth/metrics/efficiency.type_cnt); no v2 endpoint surfaces that. Historical card needserror+notMiningon/metrics/miner-status.Energy MinerView granularity
Migrated from
tail-log stat-5m, limit=1(latest 5-minute snapshot) to/auth/metrics/consumption?groupBy=...(daily aggregate,stat-1D). The selector only exposes 1D / 7D / 30D / Custom day-range, so_last(log)is "yesterday's per-group avg power", which is the meaningful snapshot for this view. Confirmed with BE.Remaining BE gaps
/auth/metrics/miner-statusmissing categories. Returns only{ online, offline, sleep, maintenance }; folds error and not-mining counts silently intoonline. Dashboard MinersStatusChart and MinersReport historical card stay on legacy untilerror+notMiningare surfaced.groupBynot yet on/auth/metrics/efficiency. Blocks Efficiency MinerType/MinerUnit tabs.Verified
dev-moriawith grouped + non-grouped variants).