diff --git a/src/locales/en.json b/src/locales/en.json index 15167767..7508599f 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -15,6 +15,7 @@ "landing-commentsCountLabel": "Comments", "landing-activeUsersCountLabel": "Active Users", "landing-activeUsersCountRangeLabel": "(in the last year)", + "landing-lastMonthLabel": "last month", "landing-features": "Features", "landing-featureDiscussTitle": "Discuss with Users", "landing-featureDiscussText": "Discuss new ideas, and innovate together with your end-users.", diff --git a/src/views/Landing.vue b/src/views/Landing.vue index 18b4823b..341d9309 100644 --- a/src/views/Landing.vue +++ b/src/views/Landing.vue @@ -35,6 +35,9 @@ :autoinit='true' /> ...

{{ t('landing-projectsCountLabel') }}

+
+ + {{ lastMonthStatistics?.numberOfProjects }} {{ t('landing-lastMonthLabel') }} +
...

{{ t('landing-requirementsCountLabel') }}

+
+ + {{ lastMonthStatistics?.numberOfRequirements }} {{ t('landing-lastMonthLabel') }} +
...

{{ t('landing-commentsCountLabel') }}

+
+ + {{ lastMonthStatistics?.numberOfComments }} {{ t('landing-lastMonthLabel') }} +
... -

{{ t('landing-activeUsersCountLabel') }}

-

{{ t('landing-activeUsersCountRangeLabel') }}

+

{{ t('landing-activeUsersCountLabel') }}

+
+ + {{ lastMonthUserStatistics?.numberOfNewUsers }} {{ t('landing-lastMonthLabel') }} +
@@ -209,6 +220,19 @@ export default defineComponent({ start: oneYearAgo.toISOString(), }).then(response => userStatistics.value = response.data); + const lastMonthStatistics = ref(); + const lastMonthUserStatistics = ref(); + + const oneMonthAgo = new Date(); + oneMonthAgo.setMonth(oneMonthAgo.getMonth() - 1); + bazaarApi.statistics.getStatistics({ + since: oneMonthAgo.toISOString() + }).then(response => lastMonthStatistics.value = response.data); + + bazaarApi.userStatistics.getUserStatistics({ + start: oneMonthAgo.toISOString(), + }).then(response => lastMonthUserStatistics.value = response.data); + const featuredProjects = computed(() => store.getters.getFeaturedProjects()); store.dispatch(ActionTypes.FetchFeaturedProjects); @@ -223,6 +247,8 @@ export default defineComponent({ t, statistics, userStatistics, + lastMonthStatistics, + lastMonthUserStatistics, featuredProjects, reqBazProject, }; @@ -250,6 +276,20 @@ export default defineComponent({ color: #4CAF50; } + .statistics-item .monthly-change { + padding-top: 5px; + font-weight: bold; + color: #ff9800; + } + + .statistics-item .monthly-change .change-value { + font-size: 1.5em; + } + + .statistics-item .monthly-change .suffix { + font-size: 0.85em; + } + .feature { text-align: center; }