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 ++++++++++++++++++++------------------ src/styles/main.css | 23 ++------- 2 files changed, 57 insertions(+), 66 deletions(-) (limited to 'src') 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; diff --git a/src/styles/main.css b/src/styles/main.css index 794b217..049800a 100644 --- a/src/styles/main.css +++ b/src/styles/main.css @@ -5,6 +5,11 @@ body { line-height: 1.2; } +a, +a:visited { + color: blue; +} + #root { display: flex; } @@ -61,24 +66,6 @@ body { padding-right: 2em; } -.object .user-presentation { - margin-top: 2em; -} - -.object > .user-presentation > .description { - margin-top: 2em; - font-style: italic; - margin-bottom: 1em; -} - -.object > .user-presentation > table .description { - font-style: italic; -} - -.object > .user-presentation > table .spacer { - height: 1em; -} - /* List */ #list-container > #controls { -- cgit v1.1