diff --git a/pkgs/ui/src/app/access-point/page.tsx b/pkgs/ui/src/app/access-point/page.tsx index da581a9..177073c 100644 --- a/pkgs/ui/src/app/access-point/page.tsx +++ b/pkgs/ui/src/app/access-point/page.tsx @@ -1,5 +1,36 @@ "use client"; +import SummaryDetails from "@/components/summary_card"; +import CustomTable from "@/components/table"; +import { + APSummaryDetails, + APAttachmentsDummyData, + APAttachmentsTableConfig, + APServiceRepositoryDummyData, + APServiceRepositoryTableConfig, +} from "@/mock/access_point"; + export default function AccessPoint() { - return
Access Point Page
; + return ( +
+ +
+

Attachment View

+ +
+
+

Service Repository View

+ +
+
+ ); } diff --git a/pkgs/ui/src/app/client-1/page.tsx b/pkgs/ui/src/app/client-1/page.tsx new file mode 100644 index 0000000..e290a0b --- /dev/null +++ b/pkgs/ui/src/app/client-1/page.tsx @@ -0,0 +1,19 @@ +"use client"; + +import SummaryDetails from "@/components/summary_card"; +import { Client1SummaryDetails } from "@/mock/client_1"; + +export default function Client1() { + return ( +
+ +
+ ); +} diff --git a/pkgs/ui/src/app/client-2/page.tsx b/pkgs/ui/src/app/client-2/page.tsx new file mode 100644 index 0000000..a9a4168 --- /dev/null +++ b/pkgs/ui/src/app/client-2/page.tsx @@ -0,0 +1,19 @@ +"use client"; + +import SummaryDetails from "@/components/summary_card"; +import { Client2SummaryDetails } from "@/mock/client_2"; + +export default function Client1() { + return ( +
+ +
+ ); +} diff --git a/pkgs/ui/src/app/distributed-ledger-gateway/page.tsx b/pkgs/ui/src/app/distributed-ledger-gateway/page.tsx index 4e20b89..cc1c15e 100644 --- a/pkgs/ui/src/app/distributed-ledger-gateway/page.tsx +++ b/pkgs/ui/src/app/distributed-ledger-gateway/page.tsx @@ -1,5 +1,30 @@ "use client"; +import { + DLGResolutionDummyData, + DLGResolutionTableConfig, + DLGSummaryDetails, +} from "@/mock/dlg"; +import CustomTable from "@/components/table"; +import SummaryDetails from "@/components/summary_card"; + export default function DLG() { - return
DLG Page
; + return ( +
+ +
+

DID Resolution View

+ +
+
+ ); } diff --git a/pkgs/ui/src/app/home/page.tsx b/pkgs/ui/src/app/home/page.tsx new file mode 100644 index 0000000..bfcddf8 --- /dev/null +++ b/pkgs/ui/src/app/home/page.tsx @@ -0,0 +1,27 @@ +"use client"; + +import { NoDataOverlay } from "@/components/noDataOverlay"; +import SummaryDetails from "@/components/summary_card"; +import CustomTable from "@/components/table"; + +export default function Home() { + return ( +
+ + +
+

Home View Table

+ +
+ +
+

Sequence Diagram

+ +
+
+ ); +} diff --git a/pkgs/ui/src/app/layout.tsx b/pkgs/ui/src/app/layout.tsx index 9b2c52f..50de272 100644 --- a/pkgs/ui/src/app/layout.tsx +++ b/pkgs/ui/src/app/layout.tsx @@ -47,9 +47,9 @@ export default function RootLayout({ return ( - Clan.lol + Service Aware Networks - + @@ -89,7 +89,7 @@ export default function RootLayout({
Clan Logo -
- -
+ return isLoading ? ( +
+
+
- ); - } else { - return ( -
-
-
- -
-
-
- ); - } +
+ ) : ( + + ); } diff --git a/pkgs/ui/src/app/theme/themes.ts b/pkgs/ui/src/app/theme/themes.ts index 13e7af1..3860409 100644 --- a/pkgs/ui/src/app/theme/themes.ts +++ b/pkgs/ui/src/app/theme/themes.ts @@ -21,10 +21,10 @@ const commonOptions: Partial = { const commonPalette: Partial = { primary: { - main: palette.green50.value, + main: palette.blue10.value, }, secondary: { - main: palette.green50.value, + main: palette.blue20.value, }, info: { main: palette.blue50.value, diff --git a/pkgs/ui/src/components/copy_to_clipboard/index.tsx b/pkgs/ui/src/components/copy_to_clipboard/index.tsx new file mode 100644 index 0000000..f380dbd --- /dev/null +++ b/pkgs/ui/src/components/copy_to_clipboard/index.tsx @@ -0,0 +1,26 @@ +import { useState } from "react"; +import { Button, Snackbar } from "@mui/material"; + +const CopyToClipboard = ({ contentRef }: { contentRef: any }) => { + const [open, setOpen] = useState(false); + const handleClick = () => { + if (contentRef.current) { + const text = contentRef.current.textContent; + navigator.clipboard.writeText(text); + setOpen(true); + } + }; + + return ( + <> + + setOpen(false)} + autoHideDuration={2000} + message="Copied to clipboard" + /> + + ); +}; +export default CopyToClipboard; diff --git a/pkgs/ui/src/components/noDataOverlay/index.tsx b/pkgs/ui/src/components/noDataOverlay/index.tsx index 11867cd..3d76c8e 100644 --- a/pkgs/ui/src/components/noDataOverlay/index.tsx +++ b/pkgs/ui/src/components/noDataOverlay/index.tsx @@ -35,7 +35,7 @@ interface NoDataOverlayProps { export function NoDataOverlay(props: NoDataOverlayProps) { const { label } = props; return ( - + { + const cardContentRef = useRef(null); + const hasDetails = entity.details && entity.details.length > 0; + + return ( + <> +
+

{entity.name}

+
+ {hasAttachDetach && ( + + )} + {hasRefreshButton && } +
+
+ {hasDetails && ( + + } + /> + + {entity.details.map((info: EntityDetails, index: number) => { + return ( + + {info.label}: {info.value} + + ); + })} + + + )} + + ); +}; +export default SummaryDetails; diff --git a/pkgs/ui/src/components/table/style.tsx b/pkgs/ui/src/components/table/style.tsx index b0e5429..59f1887 100644 --- a/pkgs/ui/src/components/table/style.tsx +++ b/pkgs/ui/src/components/table/style.tsx @@ -4,7 +4,8 @@ import TableRow from "@mui/material/TableRow"; export const StyledTableCell = styled(TableCell)(({ theme }) => ({ [`&.${tableCellClasses.head}`]: { - backgroundColor: theme.palette.common.black, + // backgroundColor: theme.palette.common.black, + backgroundColor: "#003258", color: theme.palette.common.white, }, [`&.${tableCellClasses.body}`]: { diff --git a/pkgs/ui/src/mock/access-point/index.ts b/pkgs/ui/src/mock/access_point/index.ts similarity index 88% rename from pkgs/ui/src/mock/access-point/index.ts rename to pkgs/ui/src/mock/access_point/index.ts index 9b139af..07ae286 100644 --- a/pkgs/ui/src/mock/access-point/index.ts +++ b/pkgs/ui/src/mock/access_point/index.ts @@ -1,3 +1,20 @@ +// AP - Summary + +export const APSummaryDetails = [ + { + label: "DID", + value: "did:sov:test:1274", + }, + { + label: "IP", + value: "127.0.0.2", + }, + { + label: "Network", + value: "Carlo's Home Network", + }, +]; + // AP - Attachements export const APAttachmentsDummyData = [ diff --git a/pkgs/ui/src/mock/client_1/index.ts b/pkgs/ui/src/mock/client_1/index.ts new file mode 100644 index 0000000..030cc7f --- /dev/null +++ b/pkgs/ui/src/mock/client_1/index.ts @@ -0,0 +1,16 @@ +// Client1 - Summary + +export const Client1SummaryDetails = [ + { + label: "DID", + value: "did:sov:test:1234", + }, + { + label: "IP", + value: "127.0.0.1", + }, + { + label: "Network", + value: "Carlo's Home Network", + }, +]; diff --git a/pkgs/ui/src/mock/client_2/index.ts b/pkgs/ui/src/mock/client_2/index.ts new file mode 100644 index 0000000..19e6936 --- /dev/null +++ b/pkgs/ui/src/mock/client_2/index.ts @@ -0,0 +1,16 @@ +// Client2 - Summary + +export const Client2SummaryDetails = [ + { + label: "DID", + value: "did:sov:test:1234", + }, + { + label: "IP", + value: "127.0.0.2", + }, + { + label: "Network", + value: "Carlo's Home Network", + }, +]; diff --git a/pkgs/ui/src/mock/dlg/index.ts b/pkgs/ui/src/mock/dlg/index.ts index 33b9992..0163634 100644 --- a/pkgs/ui/src/mock/dlg/index.ts +++ b/pkgs/ui/src/mock/dlg/index.ts @@ -1,3 +1,18 @@ +// DLG Summary Details + +export const DLGSummaryDetails = [ + { + label: "DID", + value: "did:sov:test:1274", + }, + { + label: "URL", + value: "dlg.tu-berlin.de", + }, +]; + +// DLG Resolution Table + export const DLGResolutionDummyData = [ { requester_name: "C1", diff --git a/pkgs/ui/src/types/index.ts b/pkgs/ui/src/types/index.ts index d4635d5..264feb4 100644 --- a/pkgs/ui/src/types/index.ts +++ b/pkgs/ui/src/types/index.ts @@ -8,3 +8,19 @@ export interface ICustomTable { configuration: CustomTableConfiguration[]; data: any; } + +export interface EntityDetails { + label: string; + value: string; +} + +export interface Entity { + name: string; + details: EntityDetails[]; +} + +export interface ISummaryDetails { + entity: Entity; + hasRefreshButton?: boolean; + hasAttachDetach?: boolean; +}