diff --git a/frontend/src/views/statistics/StatisticOverview.vue b/frontend/src/views/statistics/StatisticOverview.vue index 08e17f7..d2e7f09 100644 --- a/frontend/src/views/statistics/StatisticOverview.vue +++ b/frontend/src/views/statistics/StatisticOverview.vue @@ -2,7 +2,7 @@
- + @@ -13,12 +13,12 @@ - + - +
@@ -30,6 +30,8 @@ import MonthSummary from "./charts/MonthSummary.vue"; import WorkPausePie from "./charts/WorkPausePie.vue"; import AccountPie from "./charts/AccountPie.vue"; + import axios from "axios" + import {BASE_URI} from "../../globals" export default { name: "StatisticOverview", @@ -39,8 +41,34 @@ MonthSummary, WorkPausePie, AccountPie + }, + data() { + return { + accounts: [], + records: [] + } + }, + async mounted() { + let recordsResponse + let link = BASE_URI + "/records/search/allForUser?" + + "username=" + sessionStorage.getItem("username") + "&" + + "projection=overview" + do { + recordsResponse = await axios.get(link) + link = recordsResponse.data._links?.next?.href + this.records.push(...recordsResponse.data._embedded.records) + } while (link) + + let accountsResponse + link = BASE_URI + "/accounts/search/findByUsername?" + + "username=" + sessionStorage.getItem("username") + do { + accountsResponse = await axios.get(link) + link = accountsResponse.data._links?.next?.href + this.accounts.push(...accountsResponse.data._embedded.accounts) + } while(link) } - }; + }