@@ -22,7 +22,7 @@ import DataUsageIcon from '@material-ui/icons/DataUsage';
22
22
import AutorenewIcon from '@material-ui/icons/Autorenew' ;
23
23
import RefreshIcon from '@material-ui/icons/Refresh' ;
24
24
25
- import { SYSTEM_STATUS_ENDPOINT , RESET_ENDPOINT } from '../constants/Endpoints' ;
25
+ import { SYSTEM_STATUS_ENDPOINT , RESTART_ENDPOINT } from '../constants/Endpoints' ;
26
26
import { restComponent } from '../components/RestComponent' ;
27
27
import LoadingNotification from '../components/LoadingNotification' ;
28
28
import SectionContent from '../components/SectionContent' ;
@@ -42,7 +42,7 @@ class SystemStatus extends Component {
42
42
super ( props ) ;
43
43
44
44
this . state = {
45
- confirmReset : false ,
45
+ confirmRestart : false ,
46
46
processing : false
47
47
}
48
48
}
@@ -112,53 +112,53 @@ class SystemStatus extends Component {
112
112
< Button startIcon = { < RefreshIcon /> } variant = "contained" color = "secondary" className = { classes . button } onClick = { this . props . loadData } >
113
113
Refresh
114
114
</ Button >
115
- < Button startIcon = { < AutorenewIcon /> } variant = "contained" color = "secondary" className = { classes . button } onClick = { this . onReset } >
116
- Reset
115
+ < Button startIcon = { < AutorenewIcon /> } variant = "contained" color = "secondary" className = { classes . button } onClick = { this . onRestart } >
116
+ Restart
117
117
</ Button >
118
118
</ div >
119
119
) ;
120
120
}
121
121
122
- onReset = ( ) => {
123
- this . setState ( { confirmReset : true } ) ;
122
+ onRestart = ( ) => {
123
+ this . setState ( { confirmRestart : true } ) ;
124
124
}
125
125
126
- onResetRejected = ( ) => {
127
- this . setState ( { confirmReset : false } ) ;
126
+ onRestartRejected = ( ) => {
127
+ this . setState ( { confirmRestart : false } ) ;
128
128
}
129
129
130
- onResetConfirmed = ( ) => {
130
+ onRestartConfirmed = ( ) => {
131
131
this . setState ( { processing : true } ) ;
132
- redirectingAuthorizedFetch ( RESET_ENDPOINT , { method : 'POST' } )
132
+ redirectingAuthorizedFetch ( RESTART_ENDPOINT , { method : 'POST' } )
133
133
. then ( response => {
134
134
if ( response . status === 200 ) {
135
- this . props . enqueueSnackbar ( "Device is resetting " , { variant : 'info' } ) ;
136
- this . setState ( { processing : false , confirmReset : false } ) ;
135
+ this . props . enqueueSnackbar ( "Device is restarting " , { variant : 'info' } ) ;
136
+ this . setState ( { processing : false , confirmRestart : false } ) ;
137
137
} else {
138
138
throw Error ( "Invalid status code: " + response . status ) ;
139
139
}
140
140
} )
141
141
. catch ( error => {
142
- this . props . enqueueSnackbar ( error . message || "Problem resetting device" , { variant : 'error' } ) ;
143
- this . setState ( { processing : false , confirmReset : false } ) ;
142
+ this . props . enqueueSnackbar ( error . message || "Problem restarting device" , { variant : 'error' } ) ;
143
+ this . setState ( { processing : false , confirmRestart : false } ) ;
144
144
} ) ;
145
145
}
146
146
147
- renderResetDialog ( ) {
147
+ renderRestartDialog ( ) {
148
148
return (
149
149
< Dialog
150
- open = { this . state . confirmReset }
151
- onClose = { this . onResetRejected }
150
+ open = { this . state . confirmRestart }
151
+ onClose = { this . onRestartRejected }
152
152
>
153
- < DialogTitle > Confirm Reset </ DialogTitle >
153
+ < DialogTitle > Confirm Restart </ DialogTitle >
154
154
< DialogContent dividers = { true } >
155
- Are you sure you want to reset the device?
155
+ Are you sure you want to restart the device?
156
156
</ DialogContent >
157
157
< DialogActions >
158
- < Button startIcon = { < AutorenewIcon /> } variant = "contained" onClick = { this . onResetConfirmed } disabled = { this . state . processing } color = "primary" autoFocus >
159
- Reset
158
+ < Button startIcon = { < AutorenewIcon /> } variant = "contained" onClick = { this . onRestartConfirmed } disabled = { this . state . processing } color = "primary" autoFocus >
159
+ Restart
160
160
</ Button >
161
- < Button variant = "contained" onClick = { this . onResetRejected } color = "secondary" >
161
+ < Button variant = "contained" onClick = { this . onRestartRejected } color = "secondary" >
162
162
Cancel
163
163
</ Button >
164
164
</ DialogActions >
@@ -171,14 +171,14 @@ class SystemStatus extends Component {
171
171
return (
172
172
< SectionContent title = "System Status" >
173
173
< LoadingNotification
174
- onReset = { loadData }
174
+ onRestart = { loadData }
175
175
fetched = { fetched }
176
176
errorMessage = { errorMessage }
177
177
render = {
178
178
( ) => this . renderSystemStatus ( data , classes )
179
179
}
180
180
/>
181
- { this . renderResetDialog ( ) }
181
+ { this . renderRestartDialog ( ) }
182
182
</ SectionContent >
183
183
)
184
184
}
0 commit comments