summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-ui/src/util/topology-schema.js
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2022-03-07 18:19:21 +0100
committerFabian Mastenbroek <mail.fabianm@gmail.com>2022-04-04 12:48:05 +0200
commit3d1c02e50ee619598bcd7fad4368be8b4a039e84 (patch)
tree89baaf3250eb0495295616a9945c681f5e1ccdb8 /opendc-web/opendc-web-ui/src/util/topology-schema.js
parentd12efc754a1611a624d170b4d1fa6085e6bb177b (diff)
refactor(web/ui): Fix compatibility with new API
This change updates the web interface in React to be compatible with the new API written in Kotlin. Several changes have been made in the new API to ensure consistency.
Diffstat (limited to 'opendc-web/opendc-web-ui/src/util/topology-schema.js')
-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 7779ccfe..ff672dd6 100644
--- a/opendc-web/opendc-web-ui/src/util/topology-schema.js
+++ b/opendc-web/opendc-web-ui/src/util/topology-schema.js
@@ -22,10 +22,10 @@
import { schema } from 'normalizr'
-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' })
+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(
'machines',
@@ -35,13 +35,13 @@ export const Machine = new schema.Entity(
memories: [Memory],
storages: [Storage],
},
- { idAttribute: '_id' }
+ { idAttribute: 'id' }
)
-export const Rack = new schema.Entity('racks', { machines: [Machine] }, { idAttribute: '_id' })
+export const Rack = new schema.Entity('racks', { machines: [Machine] }, { idAttribute: 'id' })
-export const Tile = new schema.Entity('tiles', { rack: Rack }, { idAttribute: '_id' })
+export const Tile = new schema.Entity('tiles', { rack: Rack }, { idAttribute: 'id' })
-export const Room = new schema.Entity('rooms', { tiles: [Tile] }, { idAttribute: '_id' })
+export const Room = new schema.Entity('rooms', { tiles: [Tile] }, { idAttribute: 'id' })
-export const Topology = new schema.Entity('topologies', { rooms: [Room] }, { idAttribute: '_id' })
+export const Topology = new schema.Entity('topologies', { rooms: [Room] }, { idAttribute: 'id' })