@@ -21,17 +21,13 @@ import React, {
2121 useLayoutEffect ,
2222 useState ,
2323} from "react" ;
24- import { Theme } from "@mui/material/styles" ;
25- import { Button , MainContainer , Snackbar } from "mds" ;
24+ import { Box , Button , MainContainer , ProgressBar , Snackbar } from "mds" ;
2625import debounce from "lodash/debounce" ;
27- import createStyles from "@mui/styles/createStyles" ;
28- import withStyles from "@mui/styles/withStyles" ;
2926import { Navigate , Route , Routes , useLocation } from "react-router-dom" ;
3027import { useSelector } from "react-redux" ;
3128import { selFeatures , selSession } from "./consoleSlice" ;
3229import { api } from "api" ;
3330import { AppState , useAppDispatch } from "../../store" ;
34- import { snackBarCommon } from "./Common/FormComponents/common/styleLibrary" ;
3531import MainError from "./Common/MainError/MainError" ;
3632import {
3733 CONSOLE_UI_RESOURCE ,
@@ -50,7 +46,6 @@ import {
5046 setSnackBarMessage ,
5147} from "../../systemSlice" ;
5248import MenuWrapper from "./Menu/MenuWrapper" ;
53- import { LinearProgress } from "@mui/material" ;
5449import LoadingComponent from "../../common/LoadingComponent" ;
5550import ComponentsScreen from "./Common/ComponentsScreen" ;
5651
@@ -146,33 +141,7 @@ const AddReplicationSites = React.lazy(
146141
147142const KMSRoutes = React . lazy ( ( ) => import ( "./KMS/KMSRoutes" ) ) ;
148143
149- const styles = ( theme : Theme ) =>
150- createStyles ( {
151- warningBar : {
152- background : theme . palette . primary . main ,
153- color : "white" ,
154- heigh : "60px" ,
155- widht : "100%" ,
156- lineHeight : "60px" ,
157- display : "flex" ,
158- justifyContent : "center" ,
159- alignItems : "center" ,
160- "& button" : {
161- marginLeft : 8 ,
162- } ,
163- } ,
164- progress : {
165- height : "3px" ,
166- backgroundColor : "#eaeaea" ,
167- } ,
168- ...snackBarCommon ,
169- } ) ;
170-
171- interface IConsoleProps {
172- classes : any ;
173- }
174-
175- const Console = ( { classes } : IConsoleProps ) => {
144+ const Console = ( ) => {
176145 const dispatch = useAppDispatch ( ) ;
177146 const { pathname = "" } = useLocation ( ) ;
178147 const open = useSelector ( ( state : AppState ) => state . system . sidebarOpen ) ;
@@ -489,33 +458,59 @@ const Console = ({ classes }: IConsoleProps) => {
489458 >
490459 < Fragment >
491460 { needsRestart && (
492- < div className = { classes . warningBar } >
493- { isServerLoading ? (
494- < Fragment >
495- The server is restarting.
496- < LinearProgress className = { classes . progress } />
497- </ Fragment >
498- ) : (
499- < Fragment >
500- The instance needs to be restarted for configuration changes
501- to take effect.{ " " }
502- < Button
503- id = { "restart-server" }
504- variant = "secondary"
505- onClick = { ( ) => {
506- restartServer ( ) ;
507- } }
508- label = { "Restart" }
509- />
510- </ Fragment >
511- ) }
512- </ div >
461+ < Snackbar
462+ onClose = { ( ) => { } }
463+ open = { needsRestart }
464+ variant = { "warning" }
465+ message = {
466+ < Box
467+ sx = { {
468+ display : "flex" ,
469+ gap : 8 ,
470+ justifyContent : "center" ,
471+ alignItems : "center" ,
472+ width : "100%" ,
473+ } }
474+ >
475+ { isServerLoading ? (
476+ < Fragment >
477+ < ProgressBar
478+ barHeight = { 3 }
479+ transparentBG
480+ sx = { {
481+ width : "100%" ,
482+ position : "absolute" ,
483+ top : 0 ,
484+ left : 0 ,
485+ } }
486+ />
487+ < span > The server is restarting.</ span >
488+ </ Fragment >
489+ ) : (
490+ < Fragment >
491+ The instance needs to be restarted for configuration
492+ changes to take effect.{ " " }
493+ < Button
494+ id = { "restart-server" }
495+ variant = "secondary"
496+ onClick = { ( ) => {
497+ restartServer ( ) ;
498+ } }
499+ label = { "Restart" }
500+ />
501+ </ Fragment >
502+ ) }
503+ </ Box >
504+ }
505+ autoHideDuration = { 0 }
506+ />
513507 ) }
514508 { loadingProgress < 100 && (
515- < LinearProgress
516- className = { classes . progress }
509+ < ProgressBar
510+ barHeight = { 3 }
517511 variant = "determinate"
518512 value = { loadingProgress }
513+ sx = { { width : "100%" , position : "absolute" , top : 0 , left : 0 } }
519514 />
520515 ) }
521516 < MainError />
@@ -580,4 +575,4 @@ const Console = ({ classes }: IConsoleProps) => {
580575 ) ;
581576} ;
582577
583- export default withStyles ( styles ) ( Console ) ;
578+ export default Console ;
0 commit comments