[task overview] nacitanie dat z json

This commit is contained in:
Filip Kaluža committed 2022-12-02 13:24:41 +01:00
1 parent 7d36723711
commit 48eae476f0
9 files changed
+392 -13976

No files matched your search

+42 -3
View File
@@ -1,7 +1,18 @@
<template>
<div>
<A-task-filter />
<Z-timeline />
<A-task-filter @weekChange="getWeekData" />
<W-loadable :content="timelineData" class="w-loadable" empty-message="Nepodarilo sa nacitat data!">
<Z-timeline :events="timelineData" />
</W-loadable>
<v-snackbar
v-model="errorToast"
:timeout="2000"
color="white"
:rounded="true"
>
Nepodarilo sa nacitat data!
</v-snackbar>
</div>
</template>
@@ -14,5 +25,33 @@ export default {
ATaskFilter,
ZTimeline,
},
data() {
return {
timelineData: null,
errorToast: false,
dataLoaded: false,
}
},
methods: {
async getWeekData(week) {
try {
this.timelineData = await this.$axios.get_auth_data('v1/overview/tasks')
console.log(this.timelineData)
} catch(error) {
this.timelineData = {}
console.error(error)
this.errorToast = true
}
}
}
}
</script>
</script>
<style lang="sass" scoped>
.w-loadable
text-align: center
padding-top: 20px
height: 100%
</style>