diff options
-rw-r--r-- | web/src/js/ducks/eventLog.js | 8 | ||||
-rw-r--r-- | web/src/js/ducks/flows.js | 19 |
2 files changed, 18 insertions, 9 deletions
diff --git a/web/src/js/ducks/eventLog.js b/web/src/js/ducks/eventLog.js index 70e4b712..e5132320 100644 --- a/web/src/js/ducks/eventLog.js +++ b/web/src/js/ducks/eventLog.js @@ -8,7 +8,7 @@ export const ADD = 'EVENTLOG_ADD' export const WS_MSG = 'EVENTLOG_WS_MSG' export const REQUEST = 'EVENTLOG_REQUEST' export const RECEIVE = 'EVENTLOG_RECEIVE' -export const ERROR = 'EVENTLOG_ERROR' +export const FETCH_ERROR = 'EVENTLOG_FETCH_ERROR' const defaultState = { logId: 0, @@ -60,12 +60,6 @@ export default function reduce(state = defaultState, action) { list: reduceList(state.list, listActions.receive(action.list)) } - case FETCH_ERROR: - return { - ...state, - list: reduceList(state.list, listActions.fetchError(action.error)) - } - default: return state } diff --git a/web/src/js/ducks/flows.js b/web/src/js/ducks/flows.js index 53d12248..93ba894c 100644 --- a/web/src/js/ducks/flows.js +++ b/web/src/js/ducks/flows.js @@ -2,12 +2,15 @@ import { fetchApi as fetch } from '../utils' import { CMD_RESET as WS_CMD_RESET } from './websocket' import reduceList, * as listActions from './utils/list' -export const WS_MSG = 'FLOWS_WS_MSG' export const UPDATE_FILTER = 'FLOWS_UPDATE_FLOW_FILTER' export const UPDATE_HIGHLIGHT = 'FLOWS_UPDATE_FLOW_HIGHLIGHT' export const UPDATE_SORT = 'FLOWS_UPDATE_FLOW_SORT' +export const WS_MSG = 'FLOWS_WS_MSG' export const SELECT = 'FLOWS_SELECT' export const REQUEST_ACTION = 'FLOWS_REQUEST_ACTION' +export const REQUEST = 'FLOWS_REQUEST' +export const RECEIVE = 'FLOWS_RECEIVE' +export const FETCH_ERROR = 'FLOWS_FETCH_ERROR' const defaultState = { selected: [], @@ -52,6 +55,18 @@ export default function reduce(state = defaultState, action) { list: reduceList(state.list, listActions.handleWsMsg(action.msg)), } + case REQUEST: + return { + ...state, + list: reduceList(state.list, listActions.request()) + } + + case RECEIVE: + return { + ...state, + list: reduceList(state.list, listActions.receive(action.list)) + } + default: return state } @@ -93,7 +108,7 @@ export function updateHighlight(highlight) { * @public */ export function updateSorter(column, desc, sortKeyFun) { - return { type: SET_SORTER, column, desc, sortKeyFun } + return { type: UPDATE_SORTER, column, desc, sortKeyFun } } /** |