-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add cve summary in vulnerability tab
Signed-off-by: Laurentiu Niculae <[email protected]>
- Loading branch information
1 parent
a9db66b
commit 58aa21e
Showing
4 changed files
with
179 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
import React from 'react'; | ||
|
||
import makeStyles from '@mui/styles/makeStyles'; | ||
import { Stack, Tooltip } from '@mui/material'; | ||
|
||
const criticalColor = '#ff5c74'; | ||
const criticalBorderColor = '#f9546d'; | ||
|
||
const highColor = '#ff6840'; | ||
const highBorderColor = '#ee6b49'; | ||
|
||
const mediumColor = '#ffa052'; | ||
const mediumBorderColor = '#f19d5b'; | ||
|
||
const lowColor = '#f9f486'; | ||
const lowBorderColor = '#f0ed94'; | ||
|
||
const unknownColor = '#f2ffdd'; | ||
const unknownBorderColor = '#e9f4d7'; | ||
|
||
const useStyles = makeStyles((theme) => ({ | ||
cveCountCard: { | ||
display: 'flex', | ||
alignItems: 'center', | ||
paddingLeft: '0.5rem', | ||
paddingRight: '0.5rem', | ||
color: theme.palette.primary.main, | ||
fontSize: '1rem', | ||
fontWeight: '600', | ||
borderRadius: '3px', | ||
marginBottom: '0' | ||
}, | ||
criticalSeverity: { | ||
backgroundColor: criticalColor, | ||
border: '1px solid ' + criticalBorderColor | ||
}, | ||
highSeverity: { | ||
backgroundColor: highColor, | ||
border: '1px solid ' + highBorderColor | ||
}, | ||
mediumSeverity: { | ||
backgroundColor: mediumColor, | ||
border: '1px solid ' + mediumBorderColor | ||
}, | ||
lowSeverity: { | ||
backgroundColor: lowColor, | ||
border: '1px solid ' + lowBorderColor | ||
}, | ||
unknownSeverity: { | ||
backgroundColor: unknownColor, | ||
border: '1px solid ' + unknownBorderColor | ||
}, | ||
severityList: { | ||
display: 'flex', | ||
flexWrap: 'wrap', | ||
alignItems: 'center', | ||
gap: '0.5em' | ||
} | ||
})); | ||
|
||
function VulnerabilitiyCountCard(props) { | ||
const classes = useStyles(); | ||
const { total, critical, high, medium, low, unknown } = props; | ||
|
||
return ( | ||
<Stack direction="row" spacing="0.5em"> | ||
<div className={[classes.cveCountCard].join(' ')}>Total {total}</div> | ||
<div className={classes.severityList}> | ||
<Tooltip title="Critical"> | ||
<div className={[classes.cveCountCard, classes.criticalSeverity].join(' ')}>C {critical}</div> | ||
</Tooltip> | ||
<Tooltip title="High"> | ||
<div className={[classes.cveCountCard, classes.highSeverity].join(' ')}>H {high}</div> | ||
</Tooltip> | ||
<Tooltip title="Medium"> | ||
<div className={[classes.cveCountCard, classes.mediumSeverity].join(' ')}>M {medium}</div> | ||
</Tooltip> | ||
<Tooltip title="Low"> | ||
<div className={[classes.cveCountCard, classes.lowSeverity].join(' ')}>L {low}</div> | ||
</Tooltip> | ||
<Tooltip title="Unknown"> | ||
<div className={[classes.cveCountCard, classes.unknownSeverity].join(' ')}>U {unknown}</div> | ||
</Tooltip> | ||
</div> | ||
</Stack> | ||
); | ||
} | ||
|
||
export default VulnerabilitiyCountCard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
const hostConfig = { | ||
auto: true, | ||
auto: false, | ||
default: 'http://localhost:5000' | ||
}; | ||
|
||
|