Skip to content

Commit 2ddcbe7

Browse files
committed
move refresh button closer to last check, make smaller
1 parent d07f713 commit 2ddcbe7

File tree

1 file changed

+22
-26
lines changed

1 file changed

+22
-26
lines changed

site/src/pages/HealthPage/HealthPage.tsx

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ import {
1919
import { Stats, StatsItem } from "components/Stats/Stats";
2020
import { createDayString } from "utils/createDayString";
2121
import { DashboardFullPage } from "components/Dashboard/DashboardLayout";
22-
import { LoadingButton } from "@mui/lab";
2322
import ReplayIcon from "@mui/icons-material/Replay";
24-
import { FC } from "react";
23+
import IconButton from "@mui/material/IconButton";
2524
import { health, refreshHealth } from "api/queries/debug";
2625

2726
const sections = {
@@ -111,15 +110,34 @@ export function HealthPageView({
111110
<StatsItem
112111
css={styles.statsItem}
113112
label="Last check"
114-
value={createDayString(healthStatus.time)}
113+
value={
114+
<span css={styles.statsItem}>
115+
{createDayString(healthStatus.time)}
116+
<IconButton
117+
disabled={isRefreshing}
118+
size="small"
119+
title="Refresh health data"
120+
onClick={forceRefresh}
121+
sx={{
122+
width: 16,
123+
height: 16,
124+
"& svg.MuiSvgIcon-root": {
125+
width: 16,
126+
height: 16,
127+
},
128+
}}
129+
>
130+
<ReplayIcon />
131+
</IconButton>
132+
</span>
133+
}
115134
/>
116135
<StatsItem
117136
css={styles.statsItem}
118137
label="Coder version"
119138
value={healthStatus.coder_version}
120139
/>
121140
</Stats>
122-
<RefreshButton loading={isRefreshing} handleAction={forceRefresh} />
123141
</FullWidthPageHeader>
124142
<Box
125143
sx={{
@@ -254,25 +272,3 @@ const styles = {
254272
},
255273
},
256274
} satisfies Record<string, Interpolation<Theme>>;
257-
258-
interface HealthcheckAction {
259-
handleAction: () => void;
260-
loading: boolean;
261-
}
262-
263-
export const RefreshButton: FC<HealthcheckAction> = ({
264-
handleAction,
265-
loading,
266-
}) => {
267-
return (
268-
<LoadingButton
269-
loading={loading}
270-
loadingPosition="start"
271-
data-testid="healthcheck-refresh-button"
272-
startIcon={<ReplayIcon />}
273-
onClick={handleAction}
274-
>
275-
Refresh
276-
</LoadingButton>
277-
);
278-
};

0 commit comments

Comments
 (0)