Skip to content

Commit

Permalink
feat(dashboards): Show badge on refresh button when auto refresh on (#…
Browse files Browse the repository at this point in the history
…22944)

* feat(dashboards): Show badge on refresh button when auto refresh on

* Make badge muted

* Update UI snapshots for `chromium` (2)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
Twixes and github-actions[bot] authored Jun 13, 2024
1 parent 6290dae commit dcc3d78
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions frontend/src/lib/components/CommandPalette/DebugCHQueries.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,11 @@ function DebugCHQueries(): JSX.Element {
<td>Page cache hit rate</td>
<td>
{event['OSReadBytes'] != null && event['OSReadChars'] != null ? (
`${
`${Math.round(
((event['OSReadChars'] - event['OSReadBytes']) /
event['OSReadChars']) *
100
}%`
100
)}%`
) : (
<i>unknown</i>
)}
Expand Down
17 changes: 14 additions & 3 deletions frontend/src/scenes/dashboard/DashboardReloadAction.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LemonButton, LemonSwitch } from '@posthog/lemon-ui'
import { LemonBadge, LemonButton, LemonSwitch } from '@posthog/lemon-ui'
import clsx from 'clsx'
import { useActions, useValues } from 'kea'
import { dayjs } from 'lib/dayjs'
Expand Down Expand Up @@ -43,7 +43,7 @@ export function DashboardReloadAction(): JSX.Element {
})

return (
<>
<div className="relative">
<LemonButton
onClick={() => refreshAllDashboardItemsManual()}
type="secondary"
Expand Down Expand Up @@ -115,6 +115,17 @@ export function DashboardReloadAction(): JSX.Element {
)}
</span>
</LemonButton>
</>
<LemonBadge
size="small"
content={
<>
<IconRefresh className="mr-0" /> {humanFriendlyDuration(autoRefresh.interval)}
</>
}
visible={autoRefresh.enabled}
position="top-right"
status="muted"
/>
</div>
)
}

0 comments on commit dcc3d78

Please sign in to comment.