From 36f5d6b39627c105d0d34473df53a956e885fea9 Mon Sep 17 00:00:00 2001 From: iamBadgers Date: Mon, 2 Sep 2024 22:17:46 -0700 Subject: [PATCH] build's a bitch --- frontend/.prettierrc.json | 2 +- frontend/src/router/index.ts | 2 + frontend/src/vues/CharacterDetails.vue | 29 +++++++++---- frontend/src/vues/CharacterList.vue | 59 ++++++++++++++++---------- frontend/src/vues/GameDetails.vue | 30 ++++++++++--- frontend/src/vues/GameList.vue | 48 ++++++++++++--------- frontend/src/vues/GameTable.vue | 7 ++- frontend/src/vues/ServerStats.vue | 21 ++++++--- 8 files changed, 134 insertions(+), 64 deletions(-) diff --git a/frontend/.prettierrc.json b/frontend/.prettierrc.json index 66e2335..dde9147 100644 --- a/frontend/.prettierrc.json +++ b/frontend/.prettierrc.json @@ -3,6 +3,6 @@ "semi": false, "tabWidth": 2, "singleQuote": true, - "printWidth": 100, + "printWidth": 80, "trailingComma": "none" } \ No newline at end of file diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index a41d190..cd74526 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -18,6 +18,7 @@ const gameListRoute = { } const gameDetailsRoute = { + name: 'game', path: '/games/:gameId', component: GameDetails } @@ -28,6 +29,7 @@ const characterListRoute = { } const characterDetailsRoute = { + name: 'character', path: '/characters/:characterId', component: CharacterDetails } diff --git a/frontend/src/vues/CharacterDetails.vue b/frontend/src/vues/CharacterDetails.vue index a059f81..bb2adb1 100644 --- a/frontend/src/vues/CharacterDetails.vue +++ b/frontend/src/vues/CharacterDetails.vue @@ -5,17 +5,21 @@

Player: {{ character.playerName }}

Total Game EB: {{ earnedEB }} --- Total Game IP: {{ earnedIP }}
- Games Played: {{ gamesPlayedCount }} --- Games Applied: {{ gamesAppliedCount }} -- Pick Rate: - {{ pickRate.toFixed(2) }}% + Games Played: {{ gamesPlayedCount }} --- Games Applied: + {{ gamesAppliedCount }} -- Pick Rate: {{ pickRate.toFixed(2) }}%
Last Game: {{ lastPlayedPostDate }}
-

{{ (games.played || []).length }} Games Played

+

+ {{ (games.played || []).length }} Games Played +

-

{{ (games.applied || []).length }} Games Applied

+

+ {{ (games.applied || []).length }} Games Applied +

@@ -65,8 +69,12 @@ const pickRate = ref(0) const lastPlayedPostDate = ref() async function loadCharacterDetails() { - const characterResponse = await axios.get(`/api/character/${characterId.value}`) - const gameDetails = await axios.post(`/api/character/${characterId.value}/gameHistory`) + const characterResponse = await axios.get( + `/api/character/${characterId.value}` + ) + const gameDetails = await axios.post( + `/api/character/${characterId.value}/gameHistory` + ) character.value = characterResponse.data games.value = { @@ -86,7 +94,10 @@ function calculateDerivedEarnings(gamesPlayedList: Game[]) { earnedIP.value = runningEarnedIp } -function calculateDerivedGameStats(gamesPlayedList: Game[], gamesAppliedList: Game[]) { +function calculateDerivedGameStats( + gamesPlayedList: Game[], + gamesAppliedList: Game[] +) { gamesPlayedCount.value = gamesPlayedList.length gamesAppliedCount.value = gamesAppliedList.length pickRate.value = (gamesPlayedList.length / gamesAppliedList.length) * 100 @@ -96,7 +107,9 @@ function calculateDerivedLastPlayedPostDate(gamesPlayedList: Game[]) { if (gamesPlayedList.length === 0) { lastPlayedPostDate.value = 'N/A' } else { - lastPlayedPostDate.value = new Date(gamesPlayedList[gamesPlayedList.length - 1].postdate * 1000) + lastPlayedPostDate.value = new Date( + gamesPlayedList[gamesPlayedList.length - 1].postdate * 1000 + ) .toISOString() .split('T')[0] } diff --git a/frontend/src/vues/CharacterList.vue b/frontend/src/vues/CharacterList.vue index 9d7d857..2213413 100644 --- a/frontend/src/vues/CharacterList.vue +++ b/frontend/src/vues/CharacterList.vue @@ -16,10 +16,16 @@ @update:options="loadData" >