-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<template> | ||
<div class="flex-container statistics"> | ||
<b-container> | ||
<p> | ||
In this page you can see a bunch of statistics <br />like the total | ||
number number of successful attempts: | ||
<strong>{{ totalAttempts }}</strong> | ||
</p> | ||
<h5>Number of usages per rope</h5> | ||
<b-table striped hover :items="ropesUsage" :fields="fieldsRopes"> | ||
<template #cell(rope)="data"> | ||
{{ | ||
`${data.value.brand} ${data.value.length} m | ||
${data.value.thickness} mm` | ||
}} | ||
</template> | ||
</b-table> | ||
<h5>Number of times we climbed a certain grade</h5> | ||
<b-table striped hover :items="counterGrades" :fields="fieldsGrades" /> | ||
</b-container> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: "Statistics", | ||
components: {}, | ||
data() { | ||
return { | ||
width: window.innerWidth, | ||
fieldsRopes: ["rope", "value"], | ||
fieldsGrades: ["grade", "value"], | ||
}; | ||
}, | ||
computed: { | ||
attempts() { | ||
return this.$store.getters.getResourcesAttempts; | ||
}, | ||
ropesUsage() { | ||
return this.$store.getters.getRopesUsage; | ||
}, | ||
counterGrades() { | ||
return this.$store.getters.counterGrades; | ||
}, | ||
totalAttempts() { | ||
return this.$store.getters.totalAttempts; | ||
}, | ||
}, | ||
mounted() { | ||
this.getData(); | ||
}, | ||
methods: { | ||
async getData() { | ||
const attempts = await this.$axios.$get("api/v1/attempts"); | ||
this.$store.commit("setResources", { | ||
name: "attempts", | ||
resources: attempts.result, | ||
}); | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style> | ||
.statistics { | ||
padding-top: 16px; | ||
} | ||
.statistics table { | ||
width: unset; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters