From 3e317d30053de527ccdb929d3c2dffd42c8a8f3b Mon Sep 17 00:00:00 2001 From: GeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com> Date: Sun, 12 Feb 2023 10:21:14 +0100 Subject: feat: Display Northstar playercount and servercount in frontend (#130) * feat: Initial backend code to get the playercount from the Northstar master server together with servercount * fix: Push correct backend code * feat: Load playercount on application load and show on PlayView * refactor: Store global const in separate file Moved user agent there for now * refactor: User user agent from global const * refactor: Move masterserver URL into global const * refactor: Remove temporary variable * fix: Do proper typing for playercount return value * feat: Change text if unable to load playercount So instead of showing some wrong value, we just say that we were unable to load it. * fix: Remove leftover print statement * refactor: Move struct to library source file * fix: Remove break element * refactor: serverlist endpoint var to global const * fix: Remove unused import * fix: add some space to stats container top * fix: Change text to lowercase --------- Co-authored-by: Alystrasz --- src-vue/src/views/PlayView.vue | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src-vue/src/views/PlayView.vue b/src-vue/src/views/PlayView.vue index 670d8395..beca6724 100644 --- a/src-vue/src/views/PlayView.vue +++ b/src-vue/src/views/PlayView.vue @@ -15,6 +15,12 @@ export default defineComponent({ northstarVersion(): string { return this.$store.state.installed_northstar_version; }, + playerCount(): number { + return this.$store.state.player_count; + }, + serverCount(): number { + return this.$store.state.server_count; + }, }, methods: { showChangelogPage() { @@ -32,6 +38,13 @@ export default defineComponent({ +
+ {{ playerCount }} players, + {{ serverCount }} servers +
+
+ Unable to load playercount +
@@ -69,6 +82,10 @@ export default defineComponent({ color: rgb(168, 168, 168); } +.fc-stats__container { + margin-top: 3px; +} + .fc_northstar__version, .fc_changelog__link { display: inline-block; } -- cgit v1.2.3