Skip to content

Commit

Permalink
all: hourly graphs
Browse files Browse the repository at this point in the history
  • Loading branch information
schzhn committed Mar 7, 2024
1 parent 5df1d32 commit 9d6154a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions client/src/components/Dashboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ const Dashboard = ({
return t('stats_disabled_short');
}

if (stats.timeUnits === TIME_UNITS.HOURS && stats.interval === 604800000) {
return t('for_last_days', { count: msToDays(stats.interval) });
}

return stats.timeUnits === TIME_UNITS.HOURS
? t('for_last_hours', { count: msToHours(stats.interval) })
: t('for_last_days', { count: msToDays(stats.interval) });
Expand Down
2 changes: 1 addition & 1 deletion internal/stats/unit.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 9d6154a

Please sign in to comment.