diff options
| author | vincent van beek <vincent@vlogic.nl> | 2026-03-27 16:49:40 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-27 15:49:40 +0000 |
| commit | 048bf777997bdbf599240645fc66612c98abf3c2 (patch) | |
| tree | c04e999cb981c98ae9dc0fd83ea70aec9eaa419c /opendc-web/opendc-web-server/src/main/webui/redux/reducers/construction-mode.js | |
| parent | 235057cd170f1583db14bf93ea7d2de39e492356 (diff) | |
Add import topology (#393)
* add a the posibility to import and export topogies in JSON format
* fix web-runner integration, there were several bugs and mismatches between new implementations in OpenDC and the UI
Diffstat (limited to 'opendc-web/opendc-web-server/src/main/webui/redux/reducers/construction-mode.js')
| -rw-r--r-- | opendc-web/opendc-web-server/src/main/webui/redux/reducers/construction-mode.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/opendc-web/opendc-web-server/src/main/webui/redux/reducers/construction-mode.js b/opendc-web/opendc-web-server/src/main/webui/redux/reducers/construction-mode.js index 8520e794..61265b1e 100644 --- a/opendc-web/opendc-web-server/src/main/webui/redux/reducers/construction-mode.js +++ b/opendc-web/opendc-web-server/src/main/webui/redux/reducers/construction-mode.js @@ -1,5 +1,6 @@ import { combineReducers } from 'redux' import { GO_DOWN_ONE_INTERACTION_LEVEL } from '../actions/interaction-level' +import { OPEN_TOPOLOGY } from '../actions/topology' import { CANCEL_NEW_ROOM_CONSTRUCTION_SUCCEEDED, FINISH_NEW_ROOM_CONSTRUCTION, @@ -11,6 +12,8 @@ import { DELETE_ROOM, START_RACK_CONSTRUCTION, STOP_RACK_CONSTRUCTION } from '.. export function currentRoomInConstruction(state = '-1', action) { switch (action.type) { + case OPEN_TOPOLOGY: + return '-1' case START_NEW_ROOM_CONSTRUCTION_SUCCEEDED: return action.roomId case START_ROOM_EDIT: @@ -27,6 +30,8 @@ export function currentRoomInConstruction(state = '-1', action) { export function inRackConstructionMode(state = false, action) { switch (action.type) { + case OPEN_TOPOLOGY: + return false case START_RACK_CONSTRUCTION: return true case STOP_RACK_CONSTRUCTION: @@ -39,6 +44,8 @@ export function inRackConstructionMode(state = false, action) { export function currentRackPrefab(state = null, action) { switch (action.type) { + case OPEN_TOPOLOGY: + return null case START_RACK_CONSTRUCTION: return action.rackPrefab || null case STOP_RACK_CONSTRUCTION: |
