Spaces:
Build error
Build error
Update Page
Browse files- frontend/app/status/page.tsx +1 -32
frontend/app/status/page.tsx
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
"use client";
|
2 |
|
3 |
import useSWR from 'swr';
|
4 |
-
import { NextPage } from 'next';
|
5 |
import { Button } from "@nextui-org/react";
|
6 |
import { IconSpinner } from '@/app/components/ui/icons';
|
7 |
import Header from "@/app/components/header";
|
@@ -10,13 +9,7 @@ import Main from "@/app/components/ui/main-container";
|
|
10 |
// Define the API endpoint
|
11 |
const healthcheck_api = process.env.NEXT_PUBLIC_HEALTHCHECK_API;
|
12 |
|
13 |
-
const StatusPage
|
14 |
-
|
15 |
-
// Define a function to clear the cache
|
16 |
-
const clearCache = () => mutate(
|
17 |
-
() => true,
|
18 |
-
undefined,
|
19 |
-
)
|
20 |
// Use SWR hook to fetch data with caching and revalidation
|
21 |
const { data, error, isValidating, mutate } = useSWR(healthcheck_api, async (url) => {
|
22 |
try {
|
@@ -83,28 +76,4 @@ const StatusPage: NextPage = () => {
|
|
83 |
);
|
84 |
};
|
85 |
|
86 |
-
// StatusPage.getInitialProps = async () => {
|
87 |
-
// try {
|
88 |
-
// // Ensure healthcheck_api is defined before making the fetch request
|
89 |
-
// const healthcheck_api = process.env.NEXT_PUBLIC_HEALTHCHECK_API;
|
90 |
-
|
91 |
-
// if (!healthcheck_api) {
|
92 |
-
// throw new Error('NEXT_PUBLIC_HEALTHCHECK_API is not defined');
|
93 |
-
// }
|
94 |
-
|
95 |
-
// const response = await fetch(healthcheck_api);
|
96 |
-
|
97 |
-
// if (!response.ok) {
|
98 |
-
// throw new Error(response.statusText || 'Unknown Error');
|
99 |
-
// }
|
100 |
-
|
101 |
-
// const data = await response.json();
|
102 |
-
// return { initialStatus: data.status };
|
103 |
-
// } catch (error: any) {
|
104 |
-
// console.error('Error fetching Backend API Status:', error.message);
|
105 |
-
// throw error;
|
106 |
-
// }
|
107 |
-
// };
|
108 |
-
|
109 |
-
|
110 |
export default StatusPage;
|
|
|
1 |
"use client";
|
2 |
|
3 |
import useSWR from 'swr';
|
|
|
4 |
import { Button } from "@nextui-org/react";
|
5 |
import { IconSpinner } from '@/app/components/ui/icons';
|
6 |
import Header from "@/app/components/header";
|
|
|
9 |
// Define the API endpoint
|
10 |
const healthcheck_api = process.env.NEXT_PUBLIC_HEALTHCHECK_API;
|
11 |
|
12 |
+
const StatusPage = () => {
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
// Use SWR hook to fetch data with caching and revalidation
|
14 |
const { data, error, isValidating, mutate } = useSWR(healthcheck_api, async (url) => {
|
15 |
try {
|
|
|
76 |
);
|
77 |
};
|
78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
export default StatusPage;
|