From 4aee6b3ab1bb21ab1e9ff8f0725c662fd8431f5b Mon Sep 17 00:00:00 2001 From: Ernst Widerberg Date: Thu, 25 Nov 2021 10:29:32 +0100 Subject: Edit ObjectComponent content and style --- src/components/ObjectComponent.js | 100 ++++++++++++++++++++------------------ 1 file changed, 52 insertions(+), 48 deletions(-) (limited to 'src/components') diff --git a/src/components/ObjectComponent.js b/src/components/ObjectComponent.js index 2ffea3a..5074aa9 100644 --- a/src/components/ObjectComponent.js +++ b/src/components/ObjectComponent.js @@ -1,50 +1,57 @@ import React from "react"; +import Alert from "@mui/material/Alert"; import Card from "@mui/material/Card"; class ObjectComponent extends React.Component { render() { - let { - _id, - _rev, - document_version, - user_presentation, - ip, - port, - whois_description, - asn, - asn_country_code, - ...rest - } = this.props; return (
- #{_id} + #{this.props._id}
- - + + + + + + + + + + - + - + + + + + + + + + - {/* TODO: Fill out with more info */}
Address{`${ip}:${port}`}Domain{this.props.domain}
Endpoint{`${this.props.ip}:${this.props.port}`}
Hostname{this.props.ptr}
Owner{whois_description}{this.props.whois_description}
ASN{`${asn} (${asn_country_code})`}{`${this.props.asn} (${this.props.asn_country_code})`}
Abuse mail{this.props.abuse_mail}
Scan finished at{this.props.timestamp_in_utc}
- {/* TODO */} - {/* */} + {this.props.user_presentation.description && ( + + {this.props.user_presentation.description} + + )}
); @@ -70,35 +77,32 @@ function GenericTable(props) { function UserPresentation(props) { return ( -
-
- {props.description && ( -
{props.description}
+
+ {Object.entries(props.data).map( + ([key, { data, display_name, description }]) => ( + + ) )} - - - {Object.entries(props.data).map( - ([key, { data, display_name, description }]) => { - return ( - - - - - - {description && ( - - - - )} - - - ); - } - )} - -
{display_name}{data.toString()}
{description}
); } +function UserPresentationElement(props) { + return ( + + {props.display_name}: {props.data.toString()} + {props.description && ( + + {props.description} + + )} + + ); +} + export default ObjectComponent; -- cgit v1.1