-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(webapp): add health indicator to endpoints list
- Add endpoints query using new tables - Temporary mofication of endpointsList components - Add HealthCheck component
- Loading branch information
1 parent
38cefd2
commit 2effe9a
Showing
6 changed files
with
149 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React from 'react' | ||
import { makeStyles } from '@mui/styles' | ||
|
||
import ReportIcon from '@mui/icons-material/Report' | ||
import VerifiedIcon from '@mui/icons-material/Verified' | ||
import TimerOffIcon from '@mui/icons-material/TimerOff' | ||
import WarningIcon from '@mui/icons-material/Warning' | ||
|
||
import styles from './styles' | ||
|
||
const useStyles = makeStyles(styles) | ||
|
||
const HealthCheck = ({children, status}) => { | ||
const classes = useStyles() | ||
|
||
const getIcon = (status) => { | ||
switch (status) { | ||
case 'updated': | ||
return <VerifiedIcon className={classes.success}/> | ||
case 'outdated': | ||
return <TimerOffIcon className={classes.timerOff}/> | ||
case 'error': | ||
return <WarningIcon className={classes.warning}/> | ||
default: | ||
return <ReportIcon className={classes.fail}/> | ||
} | ||
} | ||
|
||
return ( | ||
<div className={classes.icon}> | ||
{status !== undefined && getIcon(status)} {children} | ||
</div> | ||
) | ||
} | ||
|
||
export default HealthCheck |
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,20 @@ | ||
export default (theme) => ({ | ||
icon: { | ||
'& svg': { | ||
width: '16px !important', | ||
height: '16px !important', | ||
} | ||
}, | ||
success:{ | ||
color: 'darkgreen', | ||
}, | ||
timerOff:{ | ||
color: 'orange', | ||
}, | ||
warning:{ | ||
color: 'orangered', | ||
}, | ||
fail:{ | ||
color: 'darkred', | ||
} | ||
}) |
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
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