debian-mirror-gitlab/app/assets/javascripts/admin/statistics_panel/components/app.vue

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

41 lines
912 B
Vue
Raw Normal View History

2019-12-04 20:38:33 +05:30
<script>
2022-08-13 15:12:31 +05:30
import { GlCard, GlLoadingIcon } from '@gitlab/ui';
2021-03-11 19:13:27 +05:30
import { mapState, mapGetters, mapActions } from 'vuex';
2019-12-04 20:38:33 +05:30
import statisticsLabels from '../constants';
export default {
components: {
2022-08-13 15:12:31 +05:30
GlCard,
2019-12-04 20:38:33 +05:30
GlLoadingIcon,
},
data() {
return {
statisticsLabels,
};
},
computed: {
...mapState(['isLoading', 'statistics']),
...mapGetters(['getStatistics']),
},
mounted() {
this.fetchStatistics();
},
methods: {
...mapActions(['fetchStatistics']),
},
};
</script>
<template>
2022-08-13 15:12:31 +05:30
<gl-card>
<h4>{{ __('Statistics') }}</h4>
<gl-loading-icon v-if="isLoading" size="lg" class="my-3" />
<template v-else>
<p v-for="statistic in getStatistics(statisticsLabels)" :key="statistic.key" class="js-stats">
{{ statistic.label }}
<span class="light float-right">{{ statistic.value }}</span>
</p>
</template>
</gl-card>
2019-12-04 20:38:33 +05:30
</template>