aboutsummaryrefslogtreecommitdiff
path: root/src-vue/src/plugins
diff options
context:
space:
mode:
authorRémy Raes <contact@remyraes.com>2023-03-22 21:46:12 +0100
committerGitHub <noreply@github.com>2023-03-22 20:46:12 +0000
commit5e096f84e59eae0ed6b7bb758149c491c87538a6 (patch)
tree521db07bc7f1cd1420e6a9687b3bc9ee21ce328b /src-vue/src/plugins
parent423775e903dfe630ad9af2f1dacdd1a1729023ae (diff)
downloadFlightCore-5e096f84e59eae0ed6b7bb758149c491c87538a6.tar.gz
FlightCore-5e096f84e59eae0ed6b7bb758149c491c87538a6.zip
feat: Refresh statistics (#228)
* feat: fetch stats every 5 minutes and ping front with received information * feat: update front on stats reception * style: format code * fix: Add comment --------- Co-authored-by: GeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>
Diffstat (limited to 'src-vue/src/plugins')
-rw-r--r--src-vue/src/plugins/store.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/src-vue/src/plugins/store.ts b/src-vue/src/plugins/store.ts
index 8671d12b..d5b7c5d8 100644
--- a/src-vue/src/plugins/store.ts
+++ b/src-vue/src/plugins/store.ts
@@ -455,6 +455,11 @@ function _initializeListeners(state: any) {
listen("northstar-running-ping", function (evt: TauriEvent<any>) {
state.northstar_is_running = evt.payload as boolean;
});
+
+ listen("northstar-statistics", function (evt: TauriEvent<{Ok: [number, number]}>) {
+ state.player_count = evt.payload.Ok[0];
+ state.server_count = evt.payload.Ok[1];
+ });
}
/**