summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-ui/src/components/topologies/sidebar/machine/MachineSidebar.js
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/components/topologies/sidebar/machine/MachineSidebar.js
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/components/topologies/sidebar/machine/MachineSidebar.js')
-rw-r--r--opendc-web/opendc-web-ui/src/components/topologies/sidebar/machine/MachineSidebar.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/opendc-web/opendc-web-ui/src/components/topologies/sidebar/machine/MachineSidebar.js b/opendc-web/opendc-web-ui/src/components/topologies/sidebar/machine/MachineSidebar.js
index 0c3dea98..9268f615 100644
--- a/opendc-web/opendc-web-ui/src/components/topologies/sidebar/machine/MachineSidebar.js
+++ b/opendc-web/opendc-web-ui/src/components/topologies/sidebar/machine/MachineSidebar.js
@@ -13,9 +13,9 @@ import {
import { useSelector } from 'react-redux'
function MachineSidebar({ tileId, position }) {
- const machine = useSelector(({ objects }) => {
- const rack = objects.rack[objects.tile[tileId].rack]
- return objects.machine[rack.machines[position - 1]]
+ const machine = useSelector(({ topology }) => {
+ const rack = topology.racks[topology.tiles[tileId].rack]
+ return topology.machines[rack.machines[position - 1]]
})
const machineId = machine._id
return (
@@ -30,7 +30,7 @@ function MachineSidebar({ tileId, position }) {
</TextList>
<Title headingLevel="h2">Actions</Title>
- <DeleteMachine />
+ <DeleteMachine machineId={machineId} />
<Title headingLevel="h2">Units</Title>
</TextContent>