|
|
|
@ -4,7 +4,6 @@
|
|
|
|
import { onMounted, ref, watch, defineProps } from 'vue'
|
|
|
|
import { onMounted, ref, watch, defineProps } from 'vue'
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
description,
|
|
|
|
description,
|
|
|
|
comments,
|
|
|
|
|
|
|
|
currentWorkingCategory,
|
|
|
|
currentWorkingCategory,
|
|
|
|
currentWorkingInstrument
|
|
|
|
currentWorkingInstrument
|
|
|
|
} from '../libs/state.js'
|
|
|
|
} from '../libs/state.js'
|
|
|
|
@ -15,29 +14,13 @@
|
|
|
|
description.value = event.target.innerText
|
|
|
|
description.value = event.target.innerText
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const copyComments = (event) => {
|
|
|
|
|
|
|
|
comments.value = event.target.innerText
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(()=>{
|
|
|
|
|
|
|
|
loadCategory()
|
|
|
|
|
|
|
|
window.addEventListener('keydown', (event)=>{
|
|
|
|
|
|
|
|
if(event.ctrlKey === true){
|
|
|
|
|
|
|
|
if(event.key === 'l') {
|
|
|
|
|
|
|
|
description.value = categorySessions.value[0].description
|
|
|
|
|
|
|
|
} else if (event.key === 'm') {
|
|
|
|
|
|
|
|
comments.value = categorySessions.value[0].comments
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const loadCategory = async () => {
|
|
|
|
const loadCategory = async () => {
|
|
|
|
const response = await fetch(import.meta.env.VITE_PRACTICE_TRACKER_API_URL+'show-category/'+currentWorkingCategory.value.id)
|
|
|
|
const response = await fetch(import.meta.env.VITE_PRACTICE_TRACKER_API_URL+'show-category/'+currentWorkingCategory.value.id)
|
|
|
|
categorySessions.value = await response.json()
|
|
|
|
categorySessions.value = await response.json()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(loadCategory)
|
|
|
|
|
|
|
|
|
|
|
|
watch(currentWorkingCategory, loadCategory)
|
|
|
|
watch(currentWorkingCategory, loadCategory)
|
|
|
|
defineExpose({loadCategory})
|
|
|
|
defineExpose({loadCategory})
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
@ -49,16 +32,16 @@
|
|
|
|
<thead>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<th>description</th>
|
|
|
|
<th>description</th>
|
|
|
|
<th>comments</th>
|
|
|
|
|
|
|
|
<th>songs</th>
|
|
|
|
|
|
|
|
<th>duration</th>
|
|
|
|
<th>duration</th>
|
|
|
|
|
|
|
|
<th>songs</th>
|
|
|
|
|
|
|
|
<th>comments</th>
|
|
|
|
<th>created at</th>
|
|
|
|
<th>created at</th>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tbody>
|
|
|
|
<tr v-for="session in categorySessions">
|
|
|
|
<tr v-for="session in categorySessions">
|
|
|
|
<td @click="copy">{{session.description}}</td>
|
|
|
|
<td @click="copy">{{session.description}}</td>
|
|
|
|
<td @click="copyComments">{{session.comments}}</td>
|
|
|
|
<td @click="copy">{{formatSeconds(session.seconds)}}</td>
|
|
|
|
<td>
|
|
|
|
<td>
|
|
|
|
<ul>
|
|
|
|
<ul>
|
|
|
|
<li v-for="song in session.songs">
|
|
|
|
<li v-for="song in session.songs">
|
|
|
|
@ -68,7 +51,7 @@
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
|
|
</td>
|
|
|
|
</td>
|
|
|
|
<td>{{formatSeconds(session.seconds)}}</td>
|
|
|
|
<td @click="copy">{{session.comments}}</td>
|
|
|
|
<td>{{new Date(session.created_at).toLocaleString("en-US")}}</td>
|
|
|
|
<td>{{new Date(session.created_at).toLocaleString("en-US")}}</td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</tbody>
|
|
|
|
|