diff options
author | Ernst Widerberg <ernst@sunet.se> | 2022-04-25 09:37:15 +0200 |
---|---|---|
committer | Ernst Widerberg <ernst@sunet.se> | 2022-04-25 09:37:15 +0200 |
commit | c8c7af947cabbe656da517189134276b94cfded9 (patch) | |
tree | 2a523386fc5dbba4cdec014c1a949b530dd765be | |
parent | baeb8b4cac1278ddd36fb6cd50320617cb6b0399 (diff) |
Support investigation_needed
m--------- | soc_collector | 0 | ||||
-rw-r--r-- | src/components/ListItem.js | 7 | ||||
-rw-r--r-- | src/components/ListView.js | 2 | ||||
-rw-r--r-- | src/components/ScanDetail.js | 19 | ||||
-rw-r--r-- | src/styles/main.css | 14 |
5 files changed, 37 insertions, 5 deletions
diff --git a/soc_collector b/soc_collector -Subproject e28a618db0505d8ba6fdd64a1bb5cddb170090f +Subproject 2aebcdeca17f9b46d90f5255dd4d03caa358701 diff --git a/src/components/ListItem.js b/src/components/ListItem.js index b85df4e..2951c48 100644 --- a/src/components/ListItem.js +++ b/src/components/ListItem.js @@ -28,7 +28,12 @@ class ListItem extends React.Component { <Card className={ "result" + - (this.props.vulnerable ? " vulnerable" : "") + (() => { + if (this.props.vulnerable) return " vulnerable"; + else if (this.props.investigation_needed) + return " investigation_needed"; + else return ""; + })() } variant="outlined" > diff --git a/src/components/ListView.js b/src/components/ListView.js index 2252f8c..f41e375 100644 --- a/src/components/ListView.js +++ b/src/components/ListView.js @@ -136,7 +136,7 @@ class ListView extends React.Component { ) .map(scan => Object.entries(scan.result) - .filter(([_, res]) => res.vulnerable) + .filter(([_, res]) => res.vulnerable || res.investigation_needed) .map(([id, res]) => ( <ListItem summary={true} diff --git a/src/components/ScanDetail.js b/src/components/ScanDetail.js index 36c52c2..34e7a12 100644 --- a/src/components/ScanDetail.js +++ b/src/components/ScanDetail.js @@ -72,13 +72,18 @@ class ScanDetail extends React.Component { <div id="results"> {Object.entries(this.props.result) - // Sort by vulnerable, reliability, name + // Sort by vulnerable, investigation_needed, reliability, name .sort((a, b) => a[1].display_name > b[1].display_name ? -1 : 1 ) .sort((a, b) => a[1].reliability < b[1].reliability ? -1 : 1 ) + .sort((a, b) => + a[1].vulnerable || a[1].investigation_needed + ? -1 + : 1 + ) .sort((a, b) => (a[1].vulnerable ? -1 : 1)) .map(([id, res]) => ( <Result key={id} {...res} /> @@ -122,7 +127,15 @@ function Result(props) { return ( <div className="resultContainer"> <Card - className={"result" + (props.vulnerable ? " vulnerable" : "")} + className={ + "result" + + (() => { + if (props.vulnerable) return " vulnerable"; + else if (props.investigation_needed) + return " investigation_needed"; + else return ""; + })() + } variant="outlined" > {props.display_name} @@ -132,7 +145,7 @@ function Result(props) { </Tooltip> )} </Card> - {props.vulnerable && ( + {(props.vulnerable || props.investigation_needed) && ( <Card className="reliability" variant="outlined"> {props.reliability} </Card> diff --git a/src/styles/main.css b/src/styles/main.css index 6bb6d5f..d30f205 100644 --- a/src/styles/main.css +++ b/src/styles/main.css @@ -92,6 +92,11 @@ a:visited { border: 3px solid #f74343; } +.scan-detail .result.investigation_needed { + background-color: #ffd078; + border: 3px solid #f5b642; +} + .scan-detail .result .MuiSvgIcon-root { vertical-align: middle; margin-left: 0.3em; @@ -102,6 +107,10 @@ a:visited { color: #f74343; } +.scan-detail .result.investigation_needed .MuiSvgIcon-root { + color: #ff8400; +} + .scan-detail .reliability { background-color: lightgrey; border: 3px solid darkgrey; @@ -158,6 +167,11 @@ a:visited { border: 3px solid #f74343; } +.list-item .result.investigation_needed { + background-color: #ffd078; + border: 3px solid #f5b642; +} + .list-item .reliability { background-color: lightgrey; border: 3px solid darkgrey; |