From fd92f333f94e947a4bd8697dfba824b24ce96b7b Mon Sep 17 00:00:00 2001 From: Ayush Mukherjee Date: Fri, 24 Nov 2023 16:19:10 +0530 Subject: [PATCH] feat: add stats from nuke --- src/components/Stats.vue | 231 +++++++++++++++++++++++++++++++++++++ src/components/Streams.vue | 22 ++-- src/store.js | 1 + src/utils/websocket.js | 1 + src/views/Home.vue | 5 +- 5 files changed, 248 insertions(+), 12 deletions(-) create mode 100644 src/components/Stats.vue diff --git a/src/components/Stats.vue b/src/components/Stats.vue new file mode 100644 index 0000000..40c06bf --- /dev/null +++ b/src/components/Stats.vue @@ -0,0 +1,231 @@ + + + + + diff --git a/src/components/Streams.vue b/src/components/Streams.vue index 7960c69..2c652f1 100644 --- a/src/components/Streams.vue +++ b/src/components/Streams.vue @@ -12,7 +12,7 @@ Event Matches Casters - Hosts + Stats @@ -41,10 +41,10 @@ - +
- - + +
{{ store.state.casters.filter(x => x._id === p)[0]?.name }}
{{ store.state.stats.filter(x => x._id === p)[0]?.name }}
@@ -76,11 +76,11 @@ -

Hosts

+

Stats

- + @@ -134,8 +134,8 @@ export default { casters.value.push(m) } }) - e.hosts.forEach(m => { - if (hosts.value.length !== e.hosts.length) { + e.stats.forEach(m => { + if (hosts.value.length !== e.stats.length) { hosts.value.push(m) } }) @@ -161,7 +161,7 @@ export default { event: event.value, matches: matches.value, casters: casters.value, - hosts: hosts.value, + stats: hosts.value, }) } else if (name.value !== '') { create('streams', { @@ -171,7 +171,7 @@ export default { event: event.value, matches: matches.value, casters: casters.value, - hosts: hosts.value, + stats: hosts.value, }) } reset() diff --git a/src/store.js b/src/store.js index d63cfdf..c72bba3 100644 --- a/src/store.js +++ b/src/store.js @@ -19,6 +19,7 @@ const state = reactive({ matches: [], casters: [], hosts: [], + stats: [], streams: [], streamsFull: [], brackets: [], diff --git a/src/utils/websocket.js b/src/utils/websocket.js index 05a294b..6a7dbf2 100644 --- a/src/utils/websocket.js +++ b/src/utils/websocket.js @@ -13,6 +13,7 @@ const channels = [ 'matches', 'casters', 'hosts', + 'stats', 'streams', 'brackets', ] diff --git a/src/views/Home.vue b/src/views/Home.vue index 6091042..87624b5 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -7,7 +7,7 @@ - + APL Logo @@ -36,6 +36,7 @@ + @@ -50,6 +51,7 @@ import Rosters from '@/components/Rosters.vue' import Matches from '@/components/Matches.vue' import Casters from '@/components/Casters.vue' import Hosts from '@/components/Hosts.vue' +import Stats from '@/components/Stats.vue' import Streams from '@/components/Streams.vue' import Brackets from '@/components/Brackets.vue' @@ -60,6 +62,7 @@ export default { Matches, Casters, Hosts, + Stats, Streams, Brackets, },