quintodrome/ui/src/actions/serverEvents.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
523 B
JavaScript
Raw Normal View History

2020-11-12 12:12:31 -09:00
export const EVENT_SCAN_STATUS = 'EVENT_SCAN_STATUS'
2020-11-13 14:40:33 -09:00
export const EVENT_SERVER_START = 'EVENT_SERVER_START'
2020-11-13 14:40:33 -09:00
const actionsMap = {
scanStatus: EVENT_SCAN_STATUS,
serverStart: EVENT_SERVER_START,
}
export const processEvent = (data) => {
let type = actionsMap[data.name]
2020-11-12 12:12:31 -09:00
if (!type) type = data.name
return {
type,
data: data.data,
}
}
2020-11-12 12:12:31 -09:00
2020-11-13 14:40:33 -09:00
export const scanStatusUpdate = (data) => ({
type: EVENT_SCAN_STATUS,
data: data,
})
export const serverDown = () => ({
type: EVENT_SERVER_START,
data: {},
})