-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(admin-ui): show message based on error code in Admin UI #1316
Signed-off-by: Jeet Viramgama <jviramgama5@gmail.com>
- Loading branch information
1 parent
a0429f1
commit 9ceaf8d
Showing
8 changed files
with
128 additions
and
96 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
import { Box } from '@mui/material' | ||
import React from 'react' | ||
import { useSelector } from 'react-redux' | ||
|
||
function GluuServiceDownModal({ message = '', statusCode }) { | ||
const { authServerHost } = useSelector((state) => state.authReducer.config) | ||
|
||
const handleRefresh = () => { | ||
const host = authServerHost ? `${authServerHost}/admin` : null | ||
|
||
if (host) { | ||
window.location.href = host | ||
} else { | ||
window.location.reload() | ||
} | ||
} | ||
|
||
return ( | ||
<Box | ||
sx={{ | ||
position: 'absolute', | ||
top: 0, | ||
bottom: 0, | ||
right: 0, | ||
left: 0, | ||
backgroundColor: '#110000', | ||
color: 'white', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
display: 'flex', | ||
flexDirection: 'column', | ||
}} | ||
> | ||
<Box sx={{ position: 'absolute', top: 0, left: 0 }}> | ||
<img | ||
src={require('Images/logos/logo192.png')} | ||
style={{ | ||
width: '120px', | ||
height: 'auto', | ||
margin: 50, | ||
}} | ||
/> | ||
</Box> | ||
|
||
<div | ||
style={{ | ||
position: 'absolute', | ||
top: 0, | ||
bottom: 0, | ||
right: 0, | ||
left: 0, | ||
color: 'white', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
display: 'flex', | ||
maxWidth: '60%', | ||
maxHeight: '60%', | ||
margin: 'auto', | ||
gap: '40px', | ||
flexWrap: 'wrap' | ||
}} | ||
> | ||
<img | ||
src={require('Images/backend-down.png')} | ||
style={{ | ||
width: 'auto', | ||
height: 'auto', | ||
fill: '#fff' | ||
}} | ||
/> | ||
<Box display='flex' alignItems='start' flexDirection='column' gap={2} maxWidth={{ sm: '100%', md: '70%' }}> | ||
{statusCode ? <h2 style={{ color: 'white', fontWeight: 'bolder', }}>Error code: {statusCode}</h2> : null} | ||
<h3 | ||
style={{ | ||
color: 'white', | ||
fontWeight: 'bolder', | ||
}} | ||
> | ||
{message} | ||
</h3> | ||
<button | ||
style={{ | ||
border: 0, | ||
backgroundColor: 'transparent', | ||
color: 'white', | ||
textDecoration: 'underline', | ||
}} | ||
onClick={handleRefresh} | ||
> | ||
Try Again | ||
</button> | ||
</Box> | ||
</div> | ||
</Box> | ||
) | ||
} | ||
|
||
export default GluuServiceDownModal |
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 was deleted.
Oops, something went wrong.