diff options
Diffstat (limited to 'frontend/src/containers/app/sidebars')
15 files changed, 19 insertions, 90 deletions
diff --git a/frontend/src/containers/app/sidebars/simulation/ExperimentMetadataContainer.js b/frontend/src/containers/app/sidebars/simulation/ExperimentMetadataContainer.js index 06d0b88a..0dc20ea7 100644 --- a/frontend/src/containers/app/sidebars/simulation/ExperimentMetadataContainer.js +++ b/frontend/src/containers/app/sidebars/simulation/ExperimentMetadataContainer.js @@ -5,21 +5,21 @@ const mapStateToProps = state => { if (!state.objects.experiment[state.currentExperimentId]) { return { experimentName: 'Loading experiment', - pathName: '', + topologyName: '', traceName: '', schedulerName: '', } } - const path = - state.objects.path[ - state.objects.experiment[state.currentExperimentId].pathId + const topology = + state.objects.topology[ + state.objects.experiment[state.currentExperimentId].topologyId ] - const pathName = path.name ? path.name : 'Path ' + path.id + const topologyName = topology.name return { experimentName: state.objects.experiment[state.currentExperimentId].name, - pathName, + topologyName, traceName: state.objects.trace[ state.objects.experiment[state.currentExperimentId].traceId diff --git a/frontend/src/containers/app/sidebars/simulation/TaskContainer.js b/frontend/src/containers/app/sidebars/simulation/TaskContainer.js deleted file mode 100644 index c4c86284..00000000 --- a/frontend/src/containers/app/sidebars/simulation/TaskContainer.js +++ /dev/null @@ -1,26 +0,0 @@ -import { connect } from 'react-redux' -import TaskComponent from '../../../../components/app/sidebars/simulation/TaskComponent' - -const mapStateToProps = (state, ownProps) => { - let flopsLeft = state.objects.task[ownProps.taskId].totalFlopCount - - if ( - state.states.task[state.currentTick] && - state.states.task[state.currentTick][ownProps.taskId] - ) { - flopsLeft = state.states.task[state.currentTick][ownProps.taskId].flopsLeft - } else if ( - state.objects.task[ownProps.taskId].startTick < state.currentTick - ) { - flopsLeft = 0 - } - - return { - task: state.objects.task[ownProps.taskId], - flopsLeft, - } -} - -const TaskContainer = connect(mapStateToProps)(TaskComponent) - -export default TaskContainer diff --git a/frontend/src/containers/app/sidebars/simulation/TraceContainer.js b/frontend/src/containers/app/sidebars/simulation/TraceContainer.js deleted file mode 100644 index 907c8874..00000000 --- a/frontend/src/containers/app/sidebars/simulation/TraceContainer.js +++ /dev/null @@ -1,25 +0,0 @@ -import { connect } from 'react-redux' -import TraceComponent from '../../../../components/app/sidebars/simulation/TraceComponent' - -const mapStateToProps = state => { - if ( - !state.objects.experiment[state.currentExperimentId] || - !state.objects.trace[ - state.objects.experiment[state.currentExperimentId].traceId - ].jobIds - ) { - return { - jobs: [], - } - } - - return { - jobs: state.objects.trace[ - state.objects.experiment[state.currentExperimentId].traceId - ].jobIds.map(id => state.objects.job[id]), - } -} - -const TraceContainer = connect(mapStateToProps)(TraceComponent) - -export default TraceContainer diff --git a/frontend/src/containers/app/sidebars/topology/building/BuildingSidebarContainer.js b/frontend/src/containers/app/sidebars/topology/building/BuildingSidebarContainer.js index 711b2b82..1869705a 100644 --- a/frontend/src/containers/app/sidebars/topology/building/BuildingSidebarContainer.js +++ b/frontend/src/containers/app/sidebars/topology/building/BuildingSidebarContainer.js @@ -1,6 +1,5 @@ import { connect } from 'react-redux' -import BuildingSidebarComponent - from '../../../../../components/app/sidebars/topology/building/BuildingSidebarComponent' +import BuildingSidebarComponent from '../../../../../components/app/sidebars/topology/building/BuildingSidebarComponent' const mapStateToProps = state => { return { diff --git a/frontend/src/containers/app/sidebars/topology/machine/MachineSidebarContainer.js b/frontend/src/containers/app/sidebars/topology/machine/MachineSidebarContainer.js index f5baee44..a39bd2d6 100644 --- a/frontend/src/containers/app/sidebars/topology/machine/MachineSidebarContainer.js +++ b/frontend/src/containers/app/sidebars/topology/machine/MachineSidebarContainer.js @@ -6,7 +6,7 @@ const mapStateToProps = state => { inSimulation: state.currentExperimentId !== -1, machineId: state.objects.rack[ - state.objects.tile[state.interactionLevel.tileId].objectId + state.objects.tile[state.interactionLevel.tileId].rackId ].machineIds[state.interactionLevel.position - 1], } } diff --git a/frontend/src/containers/app/sidebars/topology/machine/UnitContainer.js b/frontend/src/containers/app/sidebars/topology/machine/UnitContainer.js index 1a01cad0..d8e549a7 100644 --- a/frontend/src/containers/app/sidebars/topology/machine/UnitContainer.js +++ b/frontend/src/containers/app/sidebars/topology/machine/UnitContainer.js @@ -4,8 +4,8 @@ import UnitComponent from '../../../../../components/app/sidebars/topology/machi const mapStateToProps = (state, ownProps) => { return { - unit: state.objects[ownProps.unitType][ownProps.unitId], inSimulation: state.currentExperimentId !== -1, + unit: state.objects[ownProps.unitType][ownProps.unitId], } } diff --git a/frontend/src/containers/app/sidebars/topology/machine/UnitListContainer.js b/frontend/src/containers/app/sidebars/topology/machine/UnitListContainer.js index fce657d4..2f11a22f 100644 --- a/frontend/src/containers/app/sidebars/topology/machine/UnitListContainer.js +++ b/frontend/src/containers/app/sidebars/topology/machine/UnitListContainer.js @@ -3,13 +3,13 @@ import UnitListComponent from '../../../../../components/app/sidebars/topology/m const mapStateToProps = (state, ownProps) => { return { + inSimulation: state.currentExperimentId !== -1, unitIds: state.objects.machine[ state.objects.rack[ - state.objects.tile[state.interactionLevel.tileId].objectId + state.objects.tile[state.interactionLevel.tileId].rackId ].machineIds[state.interactionLevel.position - 1] ][ownProps.unitType + 'Ids'], - inSimulation: state.currentExperimentId !== -1, } } diff --git a/frontend/src/containers/app/sidebars/topology/rack/MachineContainer.js b/frontend/src/containers/app/sidebars/topology/rack/MachineContainer.js index f205257e..89818f1d 100644 --- a/frontend/src/containers/app/sidebars/topology/rack/MachineContainer.js +++ b/frontend/src/containers/app/sidebars/topology/rack/MachineContainer.js @@ -11,11 +11,11 @@ const mapStateToProps = (state, ownProps) => { if (inSimulation) { if ( state.states.machine[state.currentTick] && - state.states.machine[state.currentTick][machine.id] + state.states.machine[state.currentTick][machine._id] ) { machineLoad = getStateLoad( state.loadMetric, - state.states.machine[state.currentTick][machine.id], + state.states.machine[state.currentTick][machine._id], ) } } diff --git a/frontend/src/containers/app/sidebars/topology/rack/MachineListContainer.js b/frontend/src/containers/app/sidebars/topology/rack/MachineListContainer.js index 3a797ed5..3898d119 100644 --- a/frontend/src/containers/app/sidebars/topology/rack/MachineListContainer.js +++ b/frontend/src/containers/app/sidebars/topology/rack/MachineListContainer.js @@ -5,7 +5,7 @@ const mapStateToProps = state => { return { machineIds: state.objects.rack[ - state.objects.tile[state.interactionLevel.tileId].objectId + state.objects.tile[state.interactionLevel.tileId].rackId ].machineIds, } } diff --git a/frontend/src/containers/app/sidebars/topology/rack/RackNameContainer.js b/frontend/src/containers/app/sidebars/topology/rack/RackNameContainer.js index 11173b82..1eb885fc 100644 --- a/frontend/src/containers/app/sidebars/topology/rack/RackNameContainer.js +++ b/frontend/src/containers/app/sidebars/topology/rack/RackNameContainer.js @@ -6,7 +6,7 @@ const mapStateToProps = state => { return { rackName: state.objects.rack[ - state.objects.tile[state.interactionLevel.tileId].objectId + state.objects.tile[state.interactionLevel.tileId].rackId ].name, } } diff --git a/frontend/src/containers/app/sidebars/topology/rack/RackSidebarContainer.js b/frontend/src/containers/app/sidebars/topology/rack/RackSidebarContainer.js index 89382ef0..21745b1d 100644 --- a/frontend/src/containers/app/sidebars/topology/rack/RackSidebarContainer.js +++ b/frontend/src/containers/app/sidebars/topology/rack/RackSidebarContainer.js @@ -3,7 +3,7 @@ import RackSidebarComponent from '../../../../../components/app/sidebars/topolog const mapStateToProps = state => { return { - rackId: state.objects.tile[state.interactionLevel.tileId].objectId, + rackId: state.objects.tile[state.interactionLevel.tileId].rackId, inSimulation: state.currentExperimentId !== -1, } } diff --git a/frontend/src/containers/app/sidebars/topology/room/EditRoomContainer.js b/frontend/src/containers/app/sidebars/topology/room/EditRoomContainer.js index 29014022..87470bfe 100644 --- a/frontend/src/containers/app/sidebars/topology/room/EditRoomContainer.js +++ b/frontend/src/containers/app/sidebars/topology/room/EditRoomContainer.js @@ -1,8 +1,5 @@ import { connect } from 'react-redux' -import { - finishRoomEdit, - startRoomEdit, -} from '../../../../../actions/topology/building' +import { finishRoomEdit, startRoomEdit } from '../../../../../actions/topology/building' import EditRoomComponent from '../../../../../components/app/sidebars/topology/room/EditRoomComponent' const mapStateToProps = state => { diff --git a/frontend/src/containers/app/sidebars/topology/room/RackConstructionContainer.js b/frontend/src/containers/app/sidebars/topology/room/RackConstructionContainer.js index fe42647c..30f7a688 100644 --- a/frontend/src/containers/app/sidebars/topology/room/RackConstructionContainer.js +++ b/frontend/src/containers/app/sidebars/topology/room/RackConstructionContainer.js @@ -1,8 +1,5 @@ import { connect } from 'react-redux' -import { - startRackConstruction, - stopRackConstruction, -} from '../../../../../actions/topology/room' +import { startRackConstruction, stopRackConstruction } from '../../../../../actions/topology/room' import RackConstructionComponent from '../../../../../components/app/sidebars/topology/room/RackConstructionComponent' const mapStateToProps = state => { diff --git a/frontend/src/containers/app/sidebars/topology/room/RoomSidebarContainer.js b/frontend/src/containers/app/sidebars/topology/room/RoomSidebarContainer.js index f940b282..443495de 100644 --- a/frontend/src/containers/app/sidebars/topology/room/RoomSidebarContainer.js +++ b/frontend/src/containers/app/sidebars/topology/room/RoomSidebarContainer.js @@ -3,9 +3,8 @@ import RoomSidebarComponent from '../../../../../components/app/sidebars/topolog const mapStateToProps = state => { return { - roomId: state.interactionLevel.roomId, - roomType: state.objects.room[state.interactionLevel.roomId].roomType, inSimulation: state.currentExperimentId !== -1, + roomId: state.interactionLevel.roomId, } } diff --git a/frontend/src/containers/app/sidebars/topology/room/RoomTypeContainer.js b/frontend/src/containers/app/sidebars/topology/room/RoomTypeContainer.js deleted file mode 100644 index de4c8c85..00000000 --- a/frontend/src/containers/app/sidebars/topology/room/RoomTypeContainer.js +++ /dev/null @@ -1,12 +0,0 @@ -import { connect } from 'react-redux' -import RoomTypeComponent from '../../../../../components/app/sidebars/topology/room/RoomTypeComponent' - -const mapStateToProps = state => { - return { - roomType: state.objects.room[state.interactionLevel.roomId].roomType, - } -} - -const RoomNameContainer = connect(mapStateToProps)(RoomTypeComponent) - -export default RoomNameContainer |
