@@ -21,17 +21,13 @@ import React, {
21
21
useLayoutEffect ,
22
22
useState ,
23
23
} 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" ;
26
25
import debounce from "lodash/debounce" ;
27
- import createStyles from "@mui/styles/createStyles" ;
28
- import withStyles from "@mui/styles/withStyles" ;
29
26
import { Navigate , Route , Routes , useLocation } from "react-router-dom" ;
30
27
import { useSelector } from "react-redux" ;
31
28
import { selFeatures , selSession } from "./consoleSlice" ;
32
29
import { api } from "api" ;
33
30
import { AppState , useAppDispatch } from "../../store" ;
34
- import { snackBarCommon } from "./Common/FormComponents/common/styleLibrary" ;
35
31
import MainError from "./Common/MainError/MainError" ;
36
32
import {
37
33
CONSOLE_UI_RESOURCE ,
@@ -50,7 +46,6 @@ import {
50
46
setSnackBarMessage ,
51
47
} from "../../systemSlice" ;
52
48
import MenuWrapper from "./Menu/MenuWrapper" ;
53
- import { LinearProgress } from "@mui/material" ;
54
49
import LoadingComponent from "../../common/LoadingComponent" ;
55
50
import ComponentsScreen from "./Common/ComponentsScreen" ;
56
51
@@ -146,33 +141,7 @@ const AddReplicationSites = React.lazy(
146
141
147
142
const KMSRoutes = React . lazy ( ( ) => import ( "./KMS/KMSRoutes" ) ) ;
148
143
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 = ( ) => {
176
145
const dispatch = useAppDispatch ( ) ;
177
146
const { pathname = "" } = useLocation ( ) ;
178
147
const open = useSelector ( ( state : AppState ) => state . system . sidebarOpen ) ;
@@ -489,33 +458,59 @@ const Console = ({ classes }: IConsoleProps) => {
489
458
>
490
459
< Fragment >
491
460
{ 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
+ />
513
507
) }
514
508
{ loadingProgress < 100 && (
515
- < LinearProgress
516
- className = { classes . progress }
509
+ < ProgressBar
510
+ barHeight = { 3 }
517
511
variant = "determinate"
518
512
value = { loadingProgress }
513
+ sx = { { width : "100%" , position : "absolute" , top : 0 , left : 0 } }
519
514
/>
520
515
) }
521
516
< MainError />
@@ -580,4 +575,4 @@ const Console = ({ classes }: IConsoleProps) => {
580
575
) ;
581
576
} ;
582
577
583
- export default withStyles ( styles ) ( Console ) ;
578
+ export default Console ;
0 commit comments