// import { useState } from 'react'; // material-ui import { Grid, Typography, Stack, Paper, Box, CircularProgress, Button } from '@mui/material'; import * as React from "react"; import { GET_JVM_INFO } from "utils/ApiPathConst"; import axios from "axios"; import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' const JVMDefault = () => { const [jvmInfo, setJvmInfo] = React.useState(null); const [loading, setLoading] = React.useState(true); const [error, setError] = React.useState(null); const fetchJvmInfo = () => { setLoading(true); setError(null); axios.get(`${GET_JVM_INFO}`) .then((response) => { if (response.status === 200) { console.log(response) setJvmInfo(response.data); } }) .catch(error => { setError(error); setLoading(false); }); }; React.useEffect(() => { localStorage.setItem('searchCriteria', ""); setLoading(false); }, []); React.useEffect(() => { if(jvmInfo != null) { if (Object.keys(jvmInfo).length > 0 && jvmInfo !== undefined) { setLoading(false); } } }, [jvmInfo]); const BackgroundHead = { backgroundImage: `url(${titleBackgroundImg})`, width: '100%', height: '100%', backgroundSize: 'contain', backgroundRepeat: 'no-repeat', backgroundColor: '#0C489E', backgroundPosition: 'right' }; return (
JVM Information
{loading ? ( ) : error ? ( Error: {error.message} ) : jvmInfo ? ( {JSON.stringify(jvmInfo, null, 2)} ) : ( No data available )}
); }; export default JVMDefault;