summaryrefslogtreecommitdiff
path: root/src/sagas/topology.js
diff options
context:
space:
mode:
authorGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-09-07 17:22:24 +0200
committerGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-09-23 10:05:58 +0200
commita08deff7909b68a89662f8b93845918bdc613732 (patch)
tree4b995d9826891c6e84987b29bf071117f4307706 /src/sagas/topology.js
parente9909159dc5db91eda12437e18c1474cae848af7 (diff)
Finish rack mode machine list rendering
Diffstat (limited to 'src/sagas/topology.js')
-rw-r--r--src/sagas/topology.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/sagas/topology.js b/src/sagas/topology.js
index 2ae31074..87d20e8f 100644
--- a/src/sagas/topology.js
+++ b/src/sagas/topology.js
@@ -101,7 +101,7 @@ function* fetchTile(tile) {
function* fetchMachinesOfRack(tileId, rack) {
const machines = yield fetchAndStoreMachinesOfTile(tileId);
const machineIds = new Array(rack.capacity).fill(null);
- machines.forEach(machine => machineIds[machine.position] = machine.id);
+ machines.forEach(machine => machineIds[machine.position - 1] = machine.id);
yield put(addPropToStoreObject("rack", rack.id, {machineIds}));
@@ -221,10 +221,11 @@ export function* onAddRackToTile(action) {
const rack = yield call(addRackToTile, action.tileId, {
id: -1,
name: "Rack",
- capacity: 5,
+ capacity: 42,
powerCapacityW: 100,
machines: 20
});
+ rack.machineIds = new Array(rack.capacity).fill(null);
yield put(addToStore("rack", rack));
yield put(addRackToTileSucceeded(action.tileId, rack.id));
} catch (error) {