Added statistics page + navigation

This commit is contained in:
Maximilian Giller 2021-07-28 00:00:46 +02:00
parent cee0139e06
commit 0433ef1c28
3 changed files with 52 additions and 0 deletions

View file

@ -5,6 +5,7 @@
variant="outline-primary"
right
>
<b-dropdown-item to="/statistics">Statistics</b-dropdown-item>
<b-dropdown-item to="/logout">Log out</b-dropdown-item>
</b-dropdown>
</template>

View file

@ -6,6 +6,7 @@ import NotFound from "../views/NotFound.vue";
import Home from "../views/Home.vue";
import History from "../views/History.vue";
import Manage from "../views/Manage.vue";
import Statistics from "../views/Statistics.vue";
import Changelog from "../views/Changelog.vue";
Vue.use(VueRouter);
@ -38,6 +39,12 @@ const routes = [
component: Home,
beforeEnter: requireAuth
},
{
path: "/statistics",
name: "Statistics",
component: Statistics,
beforeEnter: requireAuth
},
{
path: "/changelog",
name: "Changelog",

44
src/views/Statistics.vue Normal file
View file

@ -0,0 +1,44 @@
<template>
<LayoutNavbarPrivate title="Statistics">
<BaseSection id="projects" title="Today">
<JugglProjectStatisticsList :statistics="visibleStatistics" />
</BaseSection>
</LayoutNavbarPrivate>
</template>
<script>
import LayoutNavbarPrivate from "@/components/layout/LayoutNavbarPrivate";
import JugglProjectStatisticsList from "@/components/juggl/JugglProjectStatisticsList";
import { helperService } from "@/services/helper.service.js";
import BaseSection from "@/components/base/BaseSection";
import store from "@/store";
export default {
name: "Statistics",
components: {
LayoutNavbarPrivate,
JugglProjectStatisticsList,
BaseSection
},
data: () => {
return {
working: true
};
},
created: function() {
store.dispatch("loadTodaysStatistics");
},
computed: {
visibleStatistics: () => {
return store.getters.getFilteredStatistics({
projectVisible: true
});
}
},
methods: {
getDurationTimestamp: helperService.getDurationTimestamp
}
};
</script>
<style lang="sass"></style>