final changes and fixes added

This commit is contained in:
sara-pervana
2024-01-16 22:05:09 +01:00
committed by Sara Pervana
parent 13de134bb0
commit 51859b148b
3 changed files with 79 additions and 30 deletions

View File

@@ -133,7 +133,7 @@ const SequenceDiagram = () => {
<div className="flex flex-col items-end"> <div className="flex flex-col items-end">
{hasData ? ( {hasData ? (
<> <>
<div className="flex justify-end gap-2.5 mb-5"> <div className="flex justify-end">
<Tooltip placement="top" title="Refresh Diagram"> <Tooltip placement="top" title="Refresh Diagram">
<IconButton color="default" onClick={onRefresh}> <IconButton color="default" onClick={onRefresh}>
<RefreshIcon /> <RefreshIcon />
@@ -170,7 +170,7 @@ const SequenceDiagram = () => {
</div> </div>
</> </>
) : ( ) : (
<div className="flex w-full justify-center items-center"> <div className="flex w-full justify-center">
<NoDataOverlay label="No Activity yet" /> <NoDataOverlay label="No Activity yet" />
</div> </div>
)} )}

View File

@@ -59,22 +59,31 @@ export const APServiceRepositoryTableConfig = [
{ {
key: "status", key: "status",
label: "Status", label: "Status",
},
{
key: "other",
label: "Type",
render: (value: any) => { render: (value: any) => {
let renderedValue: any = ""; let renderedValue: any = "";
if (typeof value === "object") { if (Array.isArray(value.data)) {
const label = Object.keys(value)[0]; renderedValue = value.data.join(", ");
const info = value[label]; } else {
renderedValue = ( console.error("Status is not an array", value);
<code>
{label} {info}
</code>
);
} }
return renderedValue; return renderedValue;
}, },
}, },
// {
// key: "other",
// label: "Type",
// render: (value: any) => {
// let renderedValue: any = "";
// if (typeof value === "object") {
// const label = Object.keys(value)[0];
// const info = value[label];
// renderedValue = (
// <code>
// {label} {info}
// </code>
// );
// }
// return renderedValue;
// },
// },
]; ];

View File

@@ -1,4 +1,7 @@
import { Button } from "@mui/material"; import { Button, IconButton, Tooltip } from "@mui/material";
import AddCircleIcon from "@mui/icons-material/AddCircle";
import RemoveCircleIcon from "@mui/icons-material/RemoveCircle";
import DeleteIcon from "@mui/icons-material/Delete";
export const ClientTableConfig = [ export const ClientTableConfig = [
{ {
@@ -51,6 +54,24 @@ export const ServiceTableConfig = [
key: "entity_did", key: "entity_did",
label: "Entity DID", label: "Entity DID",
}, },
{
key: "usage",
label: "Usage",
render: (value: any) => {
let renderedValue = "";
if (value.length > 0) {
renderedValue = value.map((item: any, index: number) => {
return (
<div key={index}>
{item.consumer_entity_did} ({item.times_consumed})
</div>
);
});
}
return renderedValue;
},
},
{ {
key: "status", key: "status",
label: "Status", label: "Status",
@@ -66,21 +87,40 @@ export const ServiceTableConfig = [
}, },
{ {
key: "action", key: "action",
label: "Action", label: "Actions",
render: (value: any) => { render: () => {
let renderedValue: any = ""; return (
console.log("value", value.data); <>
if (typeof value === "object") <Tooltip title="Register" placement="top">
renderedValue = ( <IconButton disabled size="small">
<> <AddCircleIcon />
{value.data.map((actionType: any) => ( </IconButton>
<> </Tooltip>
<Button>{actionType.name}</Button>
</> <Tooltip title="De-register" placement="top">
))} <IconButton disabled size="small">
</> <RemoveCircleIcon />
); </IconButton>
return renderedValue; </Tooltip>
<Tooltip title="Delete" placement="top">
<IconButton disabled size="small" color="secondary">
<DeleteIcon />
</IconButton>
</Tooltip>
</>
);
// let renderedValue: any = "";
// if (typeof value === "object")
// renderedValue = (
// <>
// {[...value.data, { name: 'Delete', endpoint: '' }].map((actionType: any) => (
// <>
// <Button disabled style={{ marginRight: 8 }} variant="outlined" size="small">{actionType.name}</Button>
// </>
// ))}
// </>
// );
// return renderedValue;
}, },
}, },
]; ];