mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-22 06:28:41 +02:00
Added widget to display global stats about the instance
This commit is contained in:
@@ -10,4 +10,7 @@ export default {
|
||||
getNewsFeed() {
|
||||
return repository.get('/admin/news_feed/')
|
||||
},
|
||||
getStatistics() {
|
||||
return repository.get('/admin/statistics/')
|
||||
},
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
<template>
|
||||
<v-card :title="$gettext('Statistics')">
|
||||
<v-card-text>
|
||||
<v-table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{ $gettext('Domain count') }}</td>
|
||||
<td>{{ statistics.domain_count }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ $gettext('Domain alias count') }}</td>
|
||||
<td>{{ statistics.domain_alias_count }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ $gettext('Account count') }}</td>
|
||||
<td>{{ statistics.account_count }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ $gettext('Alias count') }}</td>
|
||||
<td>{{ statistics.alias_count }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</v-table>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import adminApi from '@/api/admin'
|
||||
|
||||
const statistics = ref({})
|
||||
|
||||
const response = await adminApi.getStatistics()
|
||||
statistics.value = response.data
|
||||
</script>
|
||||
@@ -7,7 +7,12 @@
|
||||
<v-row>
|
||||
<v-col sm="12" md="6">
|
||||
<NewsFeedWidget />
|
||||
<GlobalStatisticsWidget
|
||||
v-if="authStore.authUser.role === constants.SUPER_ADMIN"
|
||||
class="mt-4"
|
||||
/>
|
||||
</v-col>
|
||||
<v-col sm="12" md="6"> </v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
</template>
|
||||
@@ -15,10 +20,15 @@
|
||||
<script setup>
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { useGettext } from 'vue3-gettext'
|
||||
import { useAuthStore } from '@/stores'
|
||||
|
||||
import GlobalStatisticsWidget from '@/components/admin/dashboard/GlobalStatisticsWidget'
|
||||
import NewsFeedWidget from '@/components/admin/dashboard/NewsFeedWidget'
|
||||
import parametersApi from '@/api/parameters'
|
||||
import constants from '@/constants.json'
|
||||
|
||||
const { $gettext } = useGettext()
|
||||
const authStore = useAuthStore()
|
||||
|
||||
const welcomeMsg = ref('')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user