added a lot of stuff
Some checks failed
checks-impure / test (pull_request) Successful in 33s
checks / test (pull_request) Failing after 2m47s

This commit is contained in:
sara-pervana
2024-01-26 00:44:53 +01:00
11 changed files with 199 additions and 100 deletions

View File

@@ -5,15 +5,10 @@ import CustomTable from "@/components/table";
import {
Alert,
Button,
Card,
CardContent,
CardHeader,
Snackbar,
Typography,
CircularProgress,
IconButton,
} from "@mui/material";
import CopyToClipboard from "@/components/copy_to_clipboard";
import {
attachEntity,
detachEntity,
@@ -27,6 +22,8 @@ import { useGetAllServices } from "@/api/services/services";
import axios from "axios";
import CloseIcon from "@mui/icons-material/Close";
import { useSearchParams } from "next/navigation";
import SummaryDetails from "@/components/summary_card";
import { projectConfig } from "@/config/config";
interface SnackMessage {
message: string;
@@ -136,13 +133,12 @@ export default function Client() {
useEffect(() => {
const interval = setInterval(() => {
onRefresh();
}, 5000);
}, projectConfig.REFRESH_FREQUENCY);
return () => clearInterval(interval);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
const cardContentRef = useRef<HTMLDivElement>(null);
const [snackbarOpen, setSnackbarOpen] = useState(false);
const [snackbarMessage, setSnackbarMessage] = useState<
SnackMessage | undefined
@@ -179,23 +175,16 @@ export default function Client() {
</div>
</div>
<Card variant="outlined">
<CardHeader
subheader="Summary"
action={<CopyToClipboard contentRef={cardContentRef} />}
/>
<CardContent ref={cardContentRef}>
<Typography color="text.primary" gutterBottom>
DID: <code>{entity?.did}</code>
</Typography>
<Typography color="text.primary" gutterBottom>
IP: <code>{entity?.ip}</code>
</Typography>
<Typography color="text.primary" gutterBottom>
Network: <code>{entity?.network}</code>
</Typography>
</CardContent>
</Card>
<SummaryDetails
entity={{
name: "",
details: [
{ label: "DID", value: entity?.did },
{ label: "IP", value: entity?.ip },
{ label: "Network", value: entity?.network },
],
}}
/>
<div>
<h4>Client View</h4>
<CustomTable