|
|
|
@ -12,6 +12,7 @@
|
|
|
|
const statusRef = ref(null)
|
|
|
|
const statusRef = ref(null)
|
|
|
|
const showCategoryRef = ref(null)
|
|
|
|
const showCategoryRef = ref(null)
|
|
|
|
const instruments = ref([])
|
|
|
|
const instruments = ref([])
|
|
|
|
|
|
|
|
const categories = ref([])
|
|
|
|
|
|
|
|
|
|
|
|
const updateCurrentWorkingCategoryID = (id) =>{
|
|
|
|
const updateCurrentWorkingCategoryID = (id) =>{
|
|
|
|
currentWorkingCategoryID.value = id
|
|
|
|
currentWorkingCategoryID.value = id
|
|
|
|
@ -24,8 +25,10 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const loadData = async () => {
|
|
|
|
const loadData = async () => {
|
|
|
|
const response = await fetch(import.meta.env.VITE_PRACTICE_TRACKER_API_URL+'instruments')
|
|
|
|
let response = await fetch(import.meta.env.VITE_PRACTICE_TRACKER_API_URL+'instruments')
|
|
|
|
instruments.value = await response.json()
|
|
|
|
instruments.value = await response.json()
|
|
|
|
|
|
|
|
response = await fetch(import.meta.env.VITE_PRACTICE_TRACKER_API_URL+'categories')
|
|
|
|
|
|
|
|
categories.value = await response.json()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
onMounted(loadData)
|
|
|
|
onMounted(loadData)
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
@ -34,13 +37,21 @@
|
|
|
|
<main>
|
|
|
|
<main>
|
|
|
|
<section id="timer">
|
|
|
|
<section id="timer">
|
|
|
|
<Status ref="statusRef"/>
|
|
|
|
<Status ref="statusRef"/>
|
|
|
|
<Timer @loggedTime="refreshPage" :instruments="instruments" :currentWorkingCategoryID="currentWorkingCategoryID"/>
|
|
|
|
<Timer
|
|
|
|
|
|
|
|
@loggedTime="refreshPage"
|
|
|
|
|
|
|
|
:categories="categories"
|
|
|
|
|
|
|
|
:instruments="instruments"
|
|
|
|
|
|
|
|
:currentWorkingCategoryID="currentWorkingCategoryID"/>
|
|
|
|
</section>
|
|
|
|
</section>
|
|
|
|
<section id="summary">
|
|
|
|
<section id="summary">
|
|
|
|
<Summary ref="summaryRef" @update="updateCurrentWorkingCategoryID"/>
|
|
|
|
<Summary ref="summaryRef" @update="updateCurrentWorkingCategoryID"/>
|
|
|
|
</section>
|
|
|
|
</section>
|
|
|
|
<section id="category">
|
|
|
|
<section id="category">
|
|
|
|
<ShowCategory :instruments="instruments" ref="showCategoryRef" :currentWorkingCategoryID="currentWorkingCategoryID"/>
|
|
|
|
<ShowCategory
|
|
|
|
|
|
|
|
:instruments="instruments"
|
|
|
|
|
|
|
|
:categories="categories"
|
|
|
|
|
|
|
|
ref="showCategoryRef"
|
|
|
|
|
|
|
|
:currentWorkingCategoryID="currentWorkingCategoryID"/>
|
|
|
|
</section>
|
|
|
|
</section>
|
|
|
|
<section id="songs">
|
|
|
|
<section id="songs">
|
|
|
|
<Songs/>
|
|
|
|
<Songs/>
|
|
|
|
|