From de8f12d74faef5fa3f9e38d1340948cab2d06ea3 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Wed, 1 Jul 2020 13:33:31 +0200 Subject: Manually generate IDs --- .../app/sidebars/topology/rack/MachineContainer.js | 60 +++++++++++----------- 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'frontend/src/containers/app/sidebars/topology/rack/MachineContainer.js') diff --git a/frontend/src/containers/app/sidebars/topology/rack/MachineContainer.js b/frontend/src/containers/app/sidebars/topology/rack/MachineContainer.js index 8cd177e7..f205257e 100644 --- a/frontend/src/containers/app/sidebars/topology/rack/MachineContainer.js +++ b/frontend/src/containers/app/sidebars/topology/rack/MachineContainer.js @@ -1,40 +1,40 @@ -import { connect } from "react-redux"; -import { goFromRackToMachine } from "../../../../../actions/interaction-level"; -import MachineComponent from "../../../../../components/app/sidebars/topology/rack/MachineComponent"; -import { getStateLoad } from "../../../../../util/simulation-load"; +import { connect } from 'react-redux' +import { goFromRackToMachine } from '../../../../../actions/interaction-level' +import MachineComponent from '../../../../../components/app/sidebars/topology/rack/MachineComponent' +import { getStateLoad } from '../../../../../util/simulation-load' const mapStateToProps = (state, ownProps) => { - const machine = state.objects.machine[ownProps.machineId]; - const inSimulation = state.currentExperimentId !== -1; + const machine = state.objects.machine[ownProps.machineId] + const inSimulation = state.currentExperimentId !== -1 - let machineLoad = undefined; - if (inSimulation) { - if ( - state.states.machine[state.currentTick] && - state.states.machine[state.currentTick][machine.id] - ) { - machineLoad = getStateLoad( - state.loadMetric, - state.states.machine[state.currentTick][machine.id] - ); + let machineLoad = undefined + if (inSimulation) { + if ( + state.states.machine[state.currentTick] && + state.states.machine[state.currentTick][machine.id] + ) { + machineLoad = getStateLoad( + state.loadMetric, + state.states.machine[state.currentTick][machine.id], + ) + } } - } - return { - machine, - inSimulation, - machineLoad - }; -}; + return { + machine, + inSimulation, + machineLoad, + } +} const mapDispatchToProps = (dispatch, ownProps) => { - return { - onClick: () => dispatch(goFromRackToMachine(ownProps.position)) - }; -}; + return { + onClick: () => dispatch(goFromRackToMachine(ownProps.position)), + } +} const MachineContainer = connect(mapStateToProps, mapDispatchToProps)( - MachineComponent -); + MachineComponent, +) -export default MachineContainer; +export default MachineContainer -- cgit v1.2.3