diff --git a/CHANGELOG.md b/CHANGELOG.md index 6067c7ad..1e185910 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ NOTE: Add new changes BELOW THIS COMMENT. ### Fixed +- Statistics for 7 days displayed as 168 hours on the dashboard. - Pre-filling the Edit static lease window with data ([#6534]). - Names defined in the `/etc/hosts` for a single address family wrongly considered undefined for another family ([#6541]). diff --git a/internal/stats/unit.go b/internal/stats/unit.go index 84c6770b..478d9f66 100644 --- a/internal/stats/unit.go +++ b/internal/stats/unit.go @@ -484,7 +484,7 @@ func (s *StatsCtx) fillCollectedStats(data *StatsResp, units []*unitDB, curID ui data.TimeUnits = timeUnitsHours daysCount := size / 24 - if daysCount > 7 { + if daysCount >= 7 { size = daysCount data.TimeUnits = timeUnitsDays } @@ -510,6 +510,10 @@ func (s *StatsCtx) fillCollectedStats(data *StatsResp, units []*unitDB, curID ui // fillCollectedStatsDaily fills data with collected daily statistics. units // must contain data for the count of days. +// +// TODO(s.chzhen): Improve collection of statistics for frontend. Dashboard +// cards should contain statistics for the whole interval without rounding to +// days. func (s *StatsCtx) fillCollectedStatsDaily( data *StatsResp, units []*unitDB,