mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
add statistics overview for admin area
This commit is contained in:
parent
683f3b001e
commit
f15d085450
63
admin/src/components/CommunityStatistic.vue
Normal file
63
admin/src/components/CommunityStatistic.vue
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
<template>
|
||||||
|
<div class="community-statistic">
|
||||||
|
<div>
|
||||||
|
<b-jumbotron bg-variant="info" text-variant="white" border-variant="dark">
|
||||||
|
<template #header>{{ $t('statistic.name') }}</template>
|
||||||
|
|
||||||
|
<template #lead>
|
||||||
|
{{ CONFIG.COMMUNITY_NAME }}
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<hr class="my-4" />
|
||||||
|
|
||||||
|
<div>
|
||||||
|
{{ $t('statistic.totalUsers') }}{{ $t('math.colon') }}
|
||||||
|
<b>{{ value.totalUsers }}</b>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{{ $t('statistic.activeUsers') }}{{ $t('math.colon') }}
|
||||||
|
<b>{{ value.activeUsers }}</b>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{{ $t('statistic.deletedUsers') }}{{ $t('math.colon') }}
|
||||||
|
<b>{{ value.deletedUsers }}</b>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{{ $t('statistic.totalGradidoCreated') }}{{ $t('math.colon') }}
|
||||||
|
<b>{{ Math.round(value.totalGradidoCreated) }} {{ $t('GDD') }}</b>
|
||||||
|
<small class="ml-5">{{ value.totalGradidoCreated }}</small>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{{ $t('statistic.totalGradidoDecayed') }}{{ $t('math.colon') }}
|
||||||
|
<b>{{ Math.round(value.totalGradidoDecayed) }} {{ $t('GDD') }}</b>
|
||||||
|
<small class="ml-5">{{ value.totalGradidoDecayed }}</small>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{{ $t('statistic.totalGradidoAvailable') }}{{ $t('math.colon') }}
|
||||||
|
<b>{{ Math.round(value.totalGradidoAvailable) }} {{ $t('GDD') }}</b>
|
||||||
|
<small class="ml-5">{{ value.totalGradidoAvailable }}</small>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{{ $t('statistic.totalGradidoUnbookedDecayed') }}{{ $t('math.colon') }}
|
||||||
|
<b>{{ Math.round(value.totalGradidoUnbookedDecayed) }} {{ $t('GDD') }}</b>
|
||||||
|
<small class="ml-5">{{ value.totalGradidoUnbookedDecayed }}</small>
|
||||||
|
</div>
|
||||||
|
</b-jumbotron>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import CONFIG from '@/config'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'CommunityStatistic',
|
||||||
|
props: {
|
||||||
|
value: { type: Object },
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
CONFIG,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@ -32,6 +32,10 @@ const endpoints = {
|
|||||||
WALLET_URL: process.env.WALLET_URL || 'http://localhost/login',
|
WALLET_URL: process.env.WALLET_URL || 'http://localhost/login',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const community = {
|
||||||
|
COMMUNITY_NAME: process.env.COMMUNITY_NAME || 'Gradido Entwicklung',
|
||||||
|
}
|
||||||
|
|
||||||
const debug = {
|
const debug = {
|
||||||
DEBUG_DISABLE_AUTH: process.env.DEBUG_DISABLE_AUTH === 'true' || false,
|
DEBUG_DISABLE_AUTH: process.env.DEBUG_DISABLE_AUTH === 'true' || false,
|
||||||
}
|
}
|
||||||
@ -53,6 +57,7 @@ const CONFIG = {
|
|||||||
...version,
|
...version,
|
||||||
...environment,
|
...environment,
|
||||||
...endpoints,
|
...endpoints,
|
||||||
|
...community,
|
||||||
...debug,
|
...debug,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -73,6 +73,7 @@
|
|||||||
"hide_details": "Details verbergen",
|
"hide_details": "Details verbergen",
|
||||||
"lastname": "Nachname",
|
"lastname": "Nachname",
|
||||||
"math": {
|
"math": {
|
||||||
|
"colon": ":",
|
||||||
"exclaim": "!",
|
"exclaim": "!",
|
||||||
"pipe": "|",
|
"pipe": "|",
|
||||||
"plus": "+"
|
"plus": "+"
|
||||||
@ -105,6 +106,16 @@
|
|||||||
"removeNotSelf": "Als Admin/Moderator kannst du dich nicht selber löschen.",
|
"removeNotSelf": "Als Admin/Moderator kannst du dich nicht selber löschen.",
|
||||||
"remove_all": "alle Nutzer entfernen",
|
"remove_all": "alle Nutzer entfernen",
|
||||||
"save": "Speichern",
|
"save": "Speichern",
|
||||||
|
"statistic": {
|
||||||
|
"activeUsers": "aktive Mitglieder",
|
||||||
|
"deletedUsers": "gelöschte Mitglieder",
|
||||||
|
"name": "Statistik",
|
||||||
|
"totalGradidoAvailable": "GDD insgesamt im Umflauf",
|
||||||
|
"totalGradidoCreated": "GDD insgesamt geschöpft",
|
||||||
|
"totalGradidoDecayed": "GDD insgesamt verfallen",
|
||||||
|
"totalGradidoUnbookedDecayed": "GDD nicht gebuchter verfall",
|
||||||
|
"totalUsers": "Mitglieder"
|
||||||
|
},
|
||||||
"status": "Status",
|
"status": "Status",
|
||||||
"success": "Erfolg",
|
"success": "Erfolg",
|
||||||
"text": "Text",
|
"text": "Text",
|
||||||
|
|||||||
@ -73,6 +73,7 @@
|
|||||||
"hide_details": "Hide details",
|
"hide_details": "Hide details",
|
||||||
"lastname": "Lastname",
|
"lastname": "Lastname",
|
||||||
"math": {
|
"math": {
|
||||||
|
"colon": ":",
|
||||||
"exclaim": "!",
|
"exclaim": "!",
|
||||||
"pipe": "|",
|
"pipe": "|",
|
||||||
"plus": "+"
|
"plus": "+"
|
||||||
@ -105,6 +106,16 @@
|
|||||||
"removeNotSelf": "As an admin/moderator, you cannot delete yourself.",
|
"removeNotSelf": "As an admin/moderator, you cannot delete yourself.",
|
||||||
"remove_all": "Remove all users",
|
"remove_all": "Remove all users",
|
||||||
"save": "Speichern",
|
"save": "Speichern",
|
||||||
|
"statistic": {
|
||||||
|
"activeUsers": "active members",
|
||||||
|
"deletedUsers": "deleted members",
|
||||||
|
"name": "Statistic",
|
||||||
|
"totalGradidoAvailable": "Total GDD in circulation",
|
||||||
|
"totalGradidoCreated": "GDD total created",
|
||||||
|
"totalGradidoDecayed": "Total GDD decayed",
|
||||||
|
"totalGradidoUnbookedDecayed": "GDD not booked decayed",
|
||||||
|
"totalUsers": "Members"
|
||||||
|
},
|
||||||
"status": "Status",
|
"status": "Status",
|
||||||
"success": "Success",
|
"success": "Success",
|
||||||
"text": "Text",
|
"text": "Text",
|
||||||
|
|||||||
@ -29,22 +29,36 @@
|
|||||||
</b-card-text>
|
</b-card-text>
|
||||||
</b-card>
|
</b-card>
|
||||||
<contribution-link :items="items" :count="count" />
|
<contribution-link :items="items" :count="count" />
|
||||||
|
<community-statistic class="mt-5" v-model="statistics" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { listContributionLinks } from '@/graphql/listContributionLinks.js'
|
import { listContributionLinks } from '@/graphql/listContributionLinks.js'
|
||||||
|
import { communityStatistics } from '@/graphql/communityStatistics.js'
|
||||||
import ContributionLink from '../components/ContributionLink.vue'
|
import ContributionLink from '../components/ContributionLink.vue'
|
||||||
|
import CommunityStatistic from '../components/CommunityStatistic.vue'
|
||||||
import { listUnconfirmedContributions } from '../graphql/listUnconfirmedContributions'
|
import { listUnconfirmedContributions } from '../graphql/listUnconfirmedContributions'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'overview',
|
name: 'overview',
|
||||||
components: {
|
components: {
|
||||||
ContributionLink,
|
ContributionLink,
|
||||||
|
CommunityStatistic,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
items: [],
|
items: [],
|
||||||
count: 0,
|
count: 0,
|
||||||
|
statistics: {
|
||||||
|
membersCount: null,
|
||||||
|
totalUsers: null,
|
||||||
|
activeUsers: null,
|
||||||
|
deletedUsers: null,
|
||||||
|
totalGradidoCreated: null,
|
||||||
|
totalGradidoDecayed: null,
|
||||||
|
totalGradidoAvailable: null,
|
||||||
|
totalGradidoUnbookedDecayed: null,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -72,9 +86,31 @@ export default {
|
|||||||
this.toastError('listContributionLinks has no result, use default data')
|
this.toastError('listContributionLinks has no result, use default data')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
async getCommunityStatistics() {
|
||||||
|
this.$apollo
|
||||||
|
.query({
|
||||||
|
query: communityStatistics,
|
||||||
|
fetchPolicy: 'network-only',
|
||||||
|
})
|
||||||
|
.then((result) => {
|
||||||
|
this.statistics.totalUsers = result.data.communityStatistics.totalUsers
|
||||||
|
this.statistics.activeUsers = result.data.communityStatistics.activeUsers
|
||||||
|
this.statistics.deletedUsers = result.data.communityStatistics.deletedUsers
|
||||||
|
this.statistics.totalGradidoCreated = result.data.communityStatistics.totalGradidoCreated
|
||||||
|
this.statistics.totalGradidoDecayed = result.data.communityStatistics.totalGradidoDecayed
|
||||||
|
this.statistics.totalGradidoAvailable =
|
||||||
|
result.data.communityStatistics.totalGradidoAvailable
|
||||||
|
this.statistics.totalGradidoUnbookedDecayed =
|
||||||
|
result.data.communityStatistics.totalGradidoUnbookedDecayed
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.toastError('listContributionLinks has no result, use default data')
|
||||||
|
})
|
||||||
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getPendingCreations()
|
this.getPendingCreations()
|
||||||
|
this.getCommunityStatistics()
|
||||||
this.getContributionLinks()
|
this.getContributionLinks()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user