Add server stats to fe
This commit is contained in:
@@ -1,41 +1,41 @@
|
||||
<template>
|
||||
<div class="d-flex flex-row">
|
||||
<div class="d-flex flex-column">
|
||||
<v-select class="date-selector" v-model="dateSelect" variant="underlined" :items="dateItems">
|
||||
</v-select>
|
||||
<v-select class="graph-selector" v-model="graphSelect" variant="underlined" :items="graphItems">
|
||||
</v-select>
|
||||
</div>
|
||||
<div class="d-flex flex-row justify-space-around">
|
||||
<div class="d-flex flex-column">
|
||||
<v-label>Completed Games</v-label>
|
||||
<v-label>0</v-label>
|
||||
<!-- <v-select class="graph-selector" v-model="graphSelect" variant="underlined" :items="graphItems">
|
||||
</v-select> -->
|
||||
<div class="d-flex flex-row justify-space-around">
|
||||
<div class="d-flex flex-column">
|
||||
<v-label>Completed Games</v-label>
|
||||
<v-label>{{ gameStats.Complete }}</v-label>
|
||||
</div>
|
||||
<div class="d-flex flex-column">
|
||||
<v-label>Postponed Games</v-label>
|
||||
<v-label>{{ gameStats.Postponed }}</v-label>
|
||||
</div>
|
||||
<div class="d-flex flex-column">
|
||||
<v-label>Average EB</v-label>
|
||||
<v-label>{{ Math.floor(gameStats.AverageEB) }}</v-label>
|
||||
</div>
|
||||
<div class="d-flex flex-column">
|
||||
<v-label>Average IP</v-label>
|
||||
<v-label>{{ Math.floor(gameStats.AverageIP) }}</v-label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex flex-column">
|
||||
<v-label>Postponed Games</v-label>
|
||||
<v-label>0</v-label>
|
||||
<v-table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Role</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Solo</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</v-table>
|
||||
</div>
|
||||
<div class="d-flex flex-column">
|
||||
<v-label>Average EB</v-label>
|
||||
<v-label>0</v-label>
|
||||
</div>
|
||||
<div class="d-flex flex-column">
|
||||
<v-label>Average IP</v-label>
|
||||
<v-label>0</v-label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex flex-column">
|
||||
<v-table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Role</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Solo</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</v-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -51,7 +51,8 @@
|
||||
</style>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import axios from 'axios'
|
||||
|
||||
const dateSelect = ref('All Time')
|
||||
|
||||
@@ -60,4 +61,24 @@ const dateItems = ['All Time', 'May 2024']
|
||||
const graphSelect = ref('All Time')
|
||||
|
||||
const graphItems = ['All Time', 'May 2024']
|
||||
|
||||
const gameStats = ref({
|
||||
TotalGames: 0,
|
||||
Complete: 0,
|
||||
Postponed: 0,
|
||||
Pending: 0,
|
||||
AverageEB: 0,
|
||||
AverageIP: 0
|
||||
})
|
||||
|
||||
async function loadData() {
|
||||
const response = await axios.post('/api/serverstats/gamestats', {
|
||||
monthId: -1
|
||||
})
|
||||
gameStats.value = response.data
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
loadData()
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user