From 54f424a18cc21a52ea518d40893218a07ab55989 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Wed, 21 Jul 2021 15:04:22 +0200 Subject: feat(ui): Extract topology construction out of Sagas This change updates the OpenDC frontend to perform the construction of the topology directly in the reducers instead of performing the mutations in Redux Sagas as side effects. This allows us to nicely map actions to mutations in the reducers. --- opendc-web/opendc-web-ui/src/util/topology-schema.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'opendc-web/opendc-web-ui/src/util') diff --git a/opendc-web/opendc-web-ui/src/util/topology-schema.js b/opendc-web/opendc-web-ui/src/util/topology-schema.js index 9acd688b..7779ccfe 100644 --- a/opendc-web/opendc-web-ui/src/util/topology-schema.js +++ b/opendc-web/opendc-web-ui/src/util/topology-schema.js @@ -22,13 +22,13 @@ import { schema } from 'normalizr' -const Cpu = new schema.Entity('cpu', {}, { idAttribute: '_id' }) -const Gpu = new schema.Entity('gpu', {}, { idAttribute: '_id' }) -const Memory = new schema.Entity('memory', {}, { idAttribute: '_id' }) -const Storage = new schema.Entity('storage', {}, { idAttribute: '_id' }) +const Cpu = new schema.Entity('cpus', {}, { idAttribute: '_id' }) +const Gpu = new schema.Entity('gpus', {}, { idAttribute: '_id' }) +const Memory = new schema.Entity('memories', {}, { idAttribute: '_id' }) +const Storage = new schema.Entity('storages', {}, { idAttribute: '_id' }) export const Machine = new schema.Entity( - 'machine', + 'machines', { cpus: [Cpu], gpus: [Gpu], @@ -38,10 +38,10 @@ export const Machine = new schema.Entity( { idAttribute: '_id' } ) -export const Rack = new schema.Entity('rack', { machines: [Machine] }, { idAttribute: '_id' }) +export const Rack = new schema.Entity('racks', { machines: [Machine] }, { idAttribute: '_id' }) -export const Tile = new schema.Entity('tile', { rack: Rack }, { idAttribute: '_id' }) +export const Tile = new schema.Entity('tiles', { rack: Rack }, { idAttribute: '_id' }) -export const Room = new schema.Entity('room', { tiles: [Tile] }, { idAttribute: '_id' }) +export const Room = new schema.Entity('rooms', { tiles: [Tile] }, { idAttribute: '_id' }) -export const Topology = new schema.Entity('topology', { rooms: [Room] }, { idAttribute: '_id' }) +export const Topology = new schema.Entity('topologies', { rooms: [Room] }, { idAttribute: '_id' }) -- cgit v1.2.3