summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-ui/src/util
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-07-21 15:04:22 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2021-07-22 14:23:09 +0200
commit54f424a18cc21a52ea518d40893218a07ab55989 (patch)
treed754d2705a5daf93178f20ea2a2e39046c6dce8a /opendc-web/opendc-web-ui/src/util
parent28a4259c43e6180723b15a8c36a9b36871420f8a (diff)
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.
Diffstat (limited to 'opendc-web/opendc-web-ui/src/util')
-rw-r--r--opendc-web/opendc-web-ui/src/util/topology-schema.js18
1 files changed, 9 insertions, 9 deletions
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' })