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

@@ -11,6 +11,7 @@ import {
} from "@/config/access_point";
import { useEffect } from "react";
import useGetEntityByNameOrDid from "@/components/hooks/useGetEntityByNameOrDid";
import { projectConfig } from "@/config/config";
export default function AccessPoint() {
const { entity } = useGetEntityByNameOrDid("AP");
@@ -46,7 +47,7 @@ export default function AccessPoint() {
useEffect(() => {
const interval = setInterval(() => {
onRefresh();
}, 5000);
}, projectConfig.REFRESH_FREQUENCY);
return () => clearInterval(interval);
// eslint-disable-next-line react-hooks/exhaustive-deps

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

View File

@@ -7,6 +7,7 @@ import { useEffect } from "react";
import { useGetAllResolutions } from "@/api/resolution/resolution";
import { mutate } from "swr";
import useGetEntityByNameOrDid from "@/components/hooks/useGetEntityByNameOrDid";
import { projectConfig } from "@/config/config";
export default function DLG() {
const { entity } = useGetEntityByNameOrDid("DLG");
@@ -30,7 +31,7 @@ export default function DLG() {
useEffect(() => {
const interval = setInterval(() => {
onRefresh();
}, 5000);
}, projectConfig.REFRESH_FREQUENCY);
return () => clearInterval(interval);
// eslint-disable-next-line react-hooks/exhaustive-deps

View File

@@ -8,6 +8,7 @@ import dynamic from "next/dynamic";
import { useEffect } from "react";
import { mutate } from "swr";
import ErrorBoundary from "@/components/error_boundary";
import { projectConfig } from "@/config/config";
const NoSSRSequenceDiagram = dynamic(
() => import("../../components/sequence_diagram"),
@@ -30,7 +31,7 @@ export default function Home() {
useEffect(() => {
const interval = setInterval(() => {
onRefresh();
}, 5000);
}, projectConfig.REFRESH_FREQUENCY);
return () => clearInterval(interval);
// eslint-disable-next-line react-hooks/exhaustive-deps