From 4dd809585e77da4ac0205a906b98143a2b2e5ed8 Mon Sep 17 00:00:00 2001
From: ml729 <85370083+ml729@users.noreply.github.com>
Date: Sat, 21 Jan 2023 12:24:15 -0500
Subject: [PATCH] handle error/loading case correctly in status page
---
website/src/pages/admin/status/index.tsx | 24 +++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)
diff --git a/website/src/pages/admin/status/index.tsx b/website/src/pages/admin/status/index.tsx
index 8894888f..efb734b2 100644
--- a/website/src/pages/admin/status/index.tsx
+++ b/website/src/pages/admin/status/index.tsx
@@ -1,9 +1,8 @@
import {
Box,
Card,
- Button,
+ CardBody,
CircularProgress,
- Container,
SimpleGrid,
Text,
Table,
@@ -14,7 +13,6 @@ import {
Th,
Thead,
Tr,
- View,
useColorMode,
useToast,
} from "@chakra-ui/react";
@@ -81,9 +79,13 @@ const StatusIndex = ({ user }) => {
/api/v1/tasks/availability
- {tasksAvailability ? JSON.stringify(tasksAvailability, null, 2) :
+ {tasksAvailability ? (
+ {JSON.stringify(tasksAvailability, null, 2)}
+ ) : errorStatus ? (
+ {JSON.stringify(errorStatus, null, 2)}
+ ) : (
+ {stats ? JSON.stringify(stats, null, 2) :
+ {stats ? (
+ {JSON.stringify(stats, null, 2)}
+ ) : errorStatus ? (
+ {JSON.stringify(errorStatus, null, 2)}
+ ) : (
+
{JSON.stringify(errorStatus, null, 2)}
) : (