Skip to content

Commit

Permalink
revert to previous behavior for displaying stopped containers
Browse files Browse the repository at this point in the history
* Previously, a stopped container was completely removed from the chart/tooltip during the time period when it was not running. In the last few releases, the container remained in the chart with zero values if it was running at any time during the chart's duration. This restores the previous functionality.
  • Loading branch information
henrygd committed Nov 5, 2024
1 parent 640ee7a commit 98c4102
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions beszel/site/src/components/charts/container-chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ export default memo(function ContainerChart({
}
// data function
if (isNetChart) {
obj.dataFunction = (key: string, data: any) => (data[key]?.nr ?? 0) + (data[key]?.ns ?? 0)
obj.dataFunction = (key: string, data: any) => (data[key]?.nr ?? null) + (data[key]?.ns ?? null)
} else {
obj.dataFunction = (key: string, data: any) => data[key]?.[dataKey] ?? 0
obj.dataFunction = (key: string, data: any) => data[key]?.[dataKey] ?? null
}
return obj
}, [])
Expand Down

0 comments on commit 98c4102

Please sign in to comment.