diff --git a/src/pages/JVM/index.js b/src/pages/JVM/index.js index a719cad..c79c0b9 100644 --- a/src/pages/JVM/index.js +++ b/src/pages/JVM/index.js @@ -11,7 +11,7 @@ import { Button } from '@mui/material'; import * as React from "react"; -import { GET_JVM_INFO } from "utils/ApiPathConst"; +import { GET_JVM_INFO, GET_NOTIFICATION_QUEUE_STATUS } from "utils/ApiPathConst"; import axios from "axios"; import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' @@ -20,7 +20,11 @@ const JVMDefault = () => { const [jvmInfo, setJvmInfo] = React.useState(null); const [loading, setLoading] = React.useState(true); const [error, setError] = React.useState(null); - + + const [queueStatus, setQueueStatus] = React.useState(null); + const [queueLoading, setQueueLoading] = React.useState(false); + const [queueError, setQueueError] = React.useState(null); + const fetchJvmInfo = () => { setLoading(true); setError(null); @@ -37,6 +41,24 @@ const JVMDefault = () => { }); }; + const fetchNotificationQueueStatus = () => { + setQueueLoading(true); + setQueueError(null); + setQueueStatus(null); + axios.get(`${GET_NOTIFICATION_QUEUE_STATUS}`) + .then((response) => { + if (response.status === 200) { + setQueueStatus(response.data); + } + }) + .catch(err => { + setQueueError(err); + }) + .finally(() => { + setQueueLoading(false); + }); + }; + React.useEffect(() => { localStorage.setItem('searchCriteria', ""); setLoading(false); @@ -66,25 +88,40 @@ const JVMDefault = () => {
- JVM Information + System Background Status
- + + + + @@ -114,6 +151,35 @@ const JVMDefault = () => { )} + + + Notification Queue Status + {queueLoading ? ( + + + + ) : queueError ? ( + Error: {queueError.message} + ) : queueStatus ? ( + + {JSON.stringify(queueStatus, null, 2)} + + ) : ( + Click "Notification Queue Status" to load data. + )} + + ); }; diff --git a/src/routes/GLDUserRoutes.js b/src/routes/GLDUserRoutes.js index 1fd1668..e096bb3 100644 --- a/src/routes/GLDUserRoutes.js +++ b/src/routes/GLDUserRoutes.js @@ -197,7 +197,7 @@ const GLDUserRoutes = { }:{}, isGranted("MAINTAIN_SETTING")? { - path: '/jvm', + path: '/sys-status', element: }:{}, diff --git a/src/utils/ApiPathConst.js b/src/utils/ApiPathConst.js index ffc148d..38daac3 100644 --- a/src/utils/ApiPathConst.js +++ b/src/utils/ApiPathConst.js @@ -253,3 +253,4 @@ export const GET_HOLIDAY_TEMPLATE = apiPath+'/holiday/export'; //GET export const GET_JVM_INFO = apiPath+'/jvm-info'; //GET +export const GET_NOTIFICATION_QUEUE_STATUS = apiPath+'/notification-queue-status'; //GET \ No newline at end of file