Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logs & minor fixes #8

Merged
merged 1 commit into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@
"format": "prettier --write src/"
},
"dependencies": {
"@datadog/browser-logs": "^5.8.0",
"@types/uuid": "^9.0.7",
"@vueuse/core": "^10.7.1",
"echarts": "^5.4.3",
"pinia": "^2.1.7",
"uuid": "^9.0.1",
"vue": "^3.4.3",
"vue-echarts": "^6.6.8",
"vue-router": "^4.2.5",
Expand Down
33 changes: 33 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 25 additions & 3 deletions src/components/TrainingSession.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@

import ChessPuzzle from './ChessPuzzle.vue'
import { defineProps, ref } from 'vue'
import { v4 as uuidv4 } from 'uuid';
import '@datadog/browser-logs/bundle/datadog-logs'

const sessionToken = localStorage.getItem('sessionToken') || uuidv4()
localStorage.setItem('sessionToken', sessionToken)

declare global {
interface Window {
DD_LOGS: any;
}
}

window.DD_LOGS.init({
clientToken: 'pubc17749f9323600ef9e82cfd995039870',
site: 'us5.datadoghq.com',
forwardErrorsToLogs: true,
sessionSampleRate: 100,
})

window.DD_LOGS.logger.info('User connected', { sessionToken: sessionToken})
console.log('User connected', { sessionToken: sessionToken})

const props = defineProps({
level: {
Expand Down Expand Up @@ -108,7 +129,7 @@ function sendClue(){
<v-col sm="3" cols="12" class="text-center">
<v-row>
<v-col cols="12">
Session Time: <br/>
Session Time:
<StopWatch ref="sessionClockRef"/>
<br/>
<v-btn variant="outlined" @click="restartSession()">Restart Session</v-btn>
Expand All @@ -125,13 +146,14 @@ function sendClue(){
<v-col sm="3" cols="12" class="text-center">
<v-row no-gutters class="training" justify="center">
<v-col cols="12">
Puzzle Time: <br/>
<v-switch inset class=switch v-model="auto" label="auto"></v-switch>
Puzzle Time:
<StopWatch ref="puzzleClockRef"/>
</v-col>
<v-col cols="12" >
<v-btn :disabled="!solved" variant="outlined" @click="nextPuzzle()">NEXT</v-btn>
<v-switch inset class=switch v-model="auto" label="auto"></v-switch>
<v-btn :disabled="!allowClue" variant="outlined" @click="sendClue()">clue</v-btn>

</v-col>
</v-row>
</v-col>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/homepage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ definePage({
function setEloRange(min: number, max: number) {
localStorage.setItem('eloRange', JSON.stringify(`${min}_${max}`))
}
const levels = ['500_1000', '1000_1500', '1500_2000', '2000_2500', '2500_3000', '3000_3500']
const levels = ['0_500', '500_1000', '1000_1500', '1500_2000', '2000_2500', '2500_3000', '3000_3500']
</script>

<template>
Expand Down
Loading