summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorErnst Widerberg <ernst@sunet.se>2022-03-30 13:13:32 +0200
committerErnst Widerberg <ernst@sunet.se>2022-03-30 13:13:32 +0200
commitbc3391d39fd987dafb7f8027b4475982bc37a50c (patch)
tree0659c7729210f02236ac3d6b605c9b79f5e25279 /src
parentc21b3cc14a655f2709b26d77036dfeb81f6c6ff1 (diff)
Edit data format
Diffstat (limited to 'src')
-rw-r--r--src/components/ScanDetail.js47
1 files changed, 18 insertions, 29 deletions
diff --git a/src/components/ScanDetail.js b/src/components/ScanDetail.js
index a5f6d16..dfc6722 100644
--- a/src/components/ScanDetail.js
+++ b/src/components/ScanDetail.js
@@ -41,17 +41,15 @@ class ScanDetail extends React.Component {
</tbody>
</table>
- {this.props.user_presentation.description && (
+ {this.props.description && (
<>
<br />
- <Alert severity="info">
- {this.props.user_presentation.description}
- </Alert>
+ <Alert severity="info">{this.props.description}</Alert>
</>
)}
<h2>Custom info</h2>
- <Details {...this.props} />
+ <Custom {...this.props.custom_data} />
<h2>Latest scan | {this.props.timestamp_in_utc}</h2>
<div id="cves">
@@ -66,35 +64,26 @@ class ScanDetail extends React.Component {
}
}
-function Details(props) {
+function Custom(props) {
return (
- <>
- <UserPresentation
- description={props.user_presentation.description}
- data={props.user_presentation.data}
- />
- </>
- );
-}
-
-function UserPresentation(props) {
- return (
- <table className="user-presentation">
- {Object.entries(props.data).map(
- ([key, { data, display_name, description }]) => (
- <UserPresentationElement
- key={key}
- data={data}
- display_name={display_name}
- description={description}
- />
- )
- )}
+ <table>
+ <tbody>
+ {Object.entries(props).map(
+ ([key, { data, display_name, description }]) => (
+ <CustomElement
+ key={key}
+ data={data}
+ display_name={display_name}
+ description={description}
+ />
+ )
+ )}
+ </tbody>
</table>
);
}
-function UserPresentationElement(props) {
+function CustomElement(props) {
return (
<tr>
<td>{props.display_name}</td>