Add Uptime to Activity Panel

This commit is contained in:
Deluan
2020-11-13 18:40:33 -05:00
parent b64bb706f7
commit 08f96639f4
9 changed files with 118 additions and 35 deletions
+11 -2
View File
@@ -1,8 +1,10 @@
import { EVENT_SCAN_STATUS } from '../actions'
import { EVENT_SCAN_STATUS, EVENT_SERVER_START } from '../actions'
const defaultState = { scanStatus: { scanning: false, count: 0 } }
export const activityReducer = (
previousState = {
scanStatus: { scanning: false, count: 0 },
scanStatus: defaultState,
},
payload
) => {
@@ -10,6 +12,13 @@ export const activityReducer = (
switch (type) {
case EVENT_SCAN_STATUS:
return { ...previousState, scanStatus: data }
case EVENT_SERVER_START:
return {
...previousState,
serverStart: {
startTime: data.startTime && Date.parse(data.startTime),
},
}
default:
return previousState
}