diff options
author | Anton Tananaev <anton@traccar.org> | 2023-12-28 08:42:13 -0800 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2023-12-28 08:42:13 -0800 |
commit | 0591f6a62eb9b50704038de87b24cf806f417d4b (patch) | |
tree | b041a770edc8088f10c53441ae0b788fa7a4402e /modern/src/store | |
parent | 7d607dbc8f2f5636dd1319ff018add3265c923aa (diff) | |
download | trackermap-web-0591f6a62eb9b50704038de87b24cf806f417d4b.tar.gz trackermap-web-0591f6a62eb9b50704038de87b24cf806f417d4b.tar.bz2 trackermap-web-0591f6a62eb9b50704038de87b24cf806f417d4b.zip |
Add logs report page
Diffstat (limited to 'modern/src/store')
-rw-r--r-- | modern/src/store/session.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/modern/src/store/session.js b/modern/src/store/session.js index a95cfec8..bfe94a41 100644 --- a/modern/src/store/session.js +++ b/modern/src/store/session.js @@ -6,6 +6,8 @@ const { reducer, actions } = createSlice({ server: null, user: null, socket: null, + includeLogs: false, + logs: [], positions: {}, history: {}, }, @@ -19,6 +21,15 @@ const { reducer, actions } = createSlice({ updateSocket(state, action) { state.socket = action.payload; }, + enableLogs(state, action) { + state.includeLogs = action.payload; + if (!action.payload) { + state.logs = []; + } + }, + updateLogs(state, action) { + state.logs.push(...action.payload); + }, updatePositions(state, action) { const liveRoutes = state.user.attributes.mapLiveRoutes || state.server.attributes.mapLiveRoutes || 'none'; const liveRoutesLimit = state.user.attributes['web.liveRouteLength'] || state.server.attributes['web.liveRouteLength'] || 10; |