Skip to content

Commit

Permalink
feat: add relation indicator for CA certificates in tables (#52)
Browse files Browse the repository at this point in the history
Signed-off-by: haritz <hsaizsierra@gmail.com>
  • Loading branch information
haritzsaiz authored Jan 22, 2025
1 parent fdd0041 commit 1646561
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/components/Certificates/CertificatesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,23 @@ const Table = React.forwardRef((props: Props, ref: Ref<FetchHandle>) => {
return <Label color={row.status === CertificateStatus.Active ? ["#ffffff", "#008000"] : (row.status === CertificateStatus.Revoked ? "error" : "grey")}>{row.status}</Label>;
}
},
{
field: "cert_hierarchy",
headerName: "Relation",
headerAlign: "center",
align: "center",
minWidth: 100,
renderCell: ({ value, row, id }) => {
if (row.is_ca) {
if (row.serial_number === row.issuer_metadata.serial_number) {
return <Label color={"black"}>Root</Label>;
}
return <Label color={"grey"}>Sub CA</Label>;
}

return <></>;
}
},
{ field: "subject.common_name", valueGetter: (value, row) => { return row.subject.common_name; }, headerName: "Common Name", width: 150, flex: 0.2 },
{
field: "key",
Expand Down
1 change: 1 addition & 0 deletions src/ducks/features/cas/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export type Certificate = {
id: string
serial_number: string
},
is_ca: boolean
}

export interface CAStats {
Expand Down

0 comments on commit 1646561

Please sign in to comment.