Skip to content

Commit 056d487

Browse files
authored
Show progress bar when loading Usage Info (#2784)
1 parent b808321 commit 056d487

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

portal-ui/src/screens/Console/Dashboard/Prometheus/PrDashboard.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ const styles = (theme: Theme) =>
6363

6464
const PrDashboard = ({ apiPrefix = "admin", usage }: IPrDashboard) => {
6565
const dispatch = useAppDispatch();
66+
const loadingUsage = useSelector(
67+
(state: AppState) => state.dashboard.loadingUsage
68+
);
6669
const zoomOpen = useSelector(
6770
(state: AppState) => state.dashboard.zoom.openZoom
6871
);
@@ -237,6 +240,7 @@ const PrDashboard = ({ apiPrefix = "admin", usage }: IPrDashboard) => {
237240
onClick={() => {
238241
dispatch(getUsageAsync());
239242
}}
243+
disabled={loadingUsage}
240244
icon={<SyncIcon />}
241245
label={"Sync"}
242246
/>
@@ -328,8 +332,8 @@ const PrDashboard = ({ apiPrefix = "admin", usage }: IPrDashboard) => {
328332
index={usage?.advancedMetricsStatus === "not configured" ? 0 : 3}
329333
value={curTab}
330334
>
331-
{!usage && <LinearProgress />}
332-
{usage && <BasicDashboard usage={usage} />}
335+
{(!usage || loadingUsage) && <LinearProgress />}
336+
{usage && !loadingUsage && <BasicDashboard usage={usage} />}
333337
</TabPanel>
334338
</Grid>
335339
</PageLayout>

0 commit comments

Comments
 (0)