From a08deff7909b68a89662f8b93845918bdc613732 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Thu, 7 Sep 2017 17:22:24 +0200 Subject: Finish rack mode machine list rendering --- src/sagas/topology.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/sagas/topology.js') 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) { -- cgit v1.2.3