diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/store/plugins/WebSocketPlugin.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/store/plugins/WebSocketPlugin.js b/src/store/plugins/WebSocketPlugin.js index cbdc9329..1988a241 100644 --- a/src/store/plugins/WebSocketPlugin.js +++ b/src/store/plugins/WebSocketPlugin.js @@ -10,7 +10,11 @@ const WebSocketPlugin = (store) => { let ws; const data = { - paths: ['/xyz/openbmc_project/state/host0', '/xyz/openbmc_project/logging'], + paths: [ + '/xyz/openbmc_project/state/host0', + '/xyz/openbmc_project/logging', + '/xyz/openbmc_project/time/bmc', + ], interfaces: [ 'xyz.openbmc_project.State.Host', 'xyz.openbmc_project.Logging.Entry', @@ -39,6 +43,13 @@ const WebSocketPlugin = (store) => { if (CurrentHostState) { store.commit('global/setServerStatus', CurrentHostState); } + } else if (path === '/xyz/openbmc_project/time/bmc') { + const { properties: { Elapsed } = {} } = data; + if (Elapsed) { + let millis = (+Elapsed - (+Elapsed % 1000)) / 1000; + let date = new Date(millis); + store.commit('global/setBmcTime', date); + } } else if (path === '/xyz/openbmc_project/logging') { store.dispatch('eventLog/getEventLogData'); } |