diff --git a/src/containers/simulators.js b/src/containers/simulators.js index 3105755..48c9b2b 100644 --- a/src/containers/simulators.js +++ b/src/containers/simulators.js @@ -165,6 +165,42 @@ class Simulators extends Component { } } + labelSimulatorState = state => { + if (state === 'unknown' || state === 'shutdown') { + return + + + {state} + ; + } + + return + + + {state} + ; + } + + isSimulatorOnline(state) { + return state !== 'shutdown' && state !== 'unknown'; + } + + stateLabelStyle = state => { + if (this.isSimulatorOnline(state)) { + return 'success'; + } + + return 'danger'; + } + + stateLabelModifier = state => { + if (this.isSimulatorOnline(state)) { + return 'online'; + } + + return 'offline'; + } + render() { const buttonStyle = { marginLeft: '10px' @@ -177,7 +213,7 @@ class Simulators extends Component { this.onSimulatorChecked(index, event)} width='30' /> - +