frontend #35

Merged
merge-bot merged 18 commits from frontend into main 2023-12-09 18:43:16 +00:00
2 changed files with 34 additions and 16 deletions
Showing only changes of commit 647fc33acd - Show all commits

View File

@@ -1,11 +1,29 @@
"use client";
import { NoDataOverlay } from "@/components/noDataOverlay";
import {NoDataOverlay} from "@/components/noDataOverlay";
import SummaryDetails from "@/components/summary_card";
import CustomTable from "@/components/table";
import { HomeDummyData, HomeTableConfig } from "@/mock/home";
import {HomeDummyData, HomeTableConfig} from "@/mock/home";
import {useEffect, useState} from "react";
export default function Home() {
const [homeData, setHomeData] = useState([]);
useEffect(() => {
fetch("http://localhost:2979/api/v1/get_entities", {
method: "GET",
// credentials: 'include',
})
.then((resp) =>
resp.json().then((jsonData) => {
console.log(jsonData);
jsonData.length > 0 ? setHomeData(jsonData) : setHomeData(HomeDummyData);
}),
)
.then()
.catch();
}, []);
return (
<div className="m-10">
<SummaryDetails
@@ -16,7 +34,7 @@ export default function Home() {
<div>
<h4>Home View Table</h4>
<CustomTable data={HomeDummyData} configuration={HomeTableConfig} />
<CustomTable data={homeData} configuration={HomeTableConfig} />
</div>
<div>

View File

@@ -21,27 +21,27 @@ export const HomeDummyData = [
export const HomeTableConfig = [
{
key: "entity_name",
key: "name",
label: "Entity name",
},
{
key: "entity_DID",
key: "did",
label: "Entity DID",
},
// {
// key: "network",
// label: "Network",
// },
{
key: "network",
label: "Network",
},
{
key: "ip_address",
key: "ip",
label: "IP address",
},
// {
// key: "roles",
// label: "Roles",
// },
{
key: "roles",
label: "Roles",
},
{
key: "visible",
label: "Visible",
key: "attached",
label: "Attached",
},
];