You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.2 KiB

  1. <template>
  2. <v-card>
  3. <v-card-title>Progress</v-card-title>
  4. <v-card-text>
  5. <v-list class="pt-0" dense>
  6. <v-list-item class="pa-0">
  7. <v-list-item-title>Total</v-list-item-title>
  8. <v-list-item-subtitle class="text-right" v-text="progress.total" />
  9. </v-list-item>
  10. <v-list-item class="pa-0">
  11. <v-list-item-title>Complete</v-list-item-title>
  12. <v-list-item-subtitle class="text-right" v-text="progress.complete" />
  13. </v-list-item>
  14. </v-list>
  15. <v-progress-linear
  16. :value="percentage"
  17. color="success"
  18. height="25"
  19. >
  20. <template #default="{ value }">
  21. <strong>{{ value }}%</strong>
  22. </template>
  23. </v-progress-linear>
  24. </v-card-text>
  25. </v-card>
  26. </template>
  27. <script lang="ts">
  28. import Vue, { PropType } from 'vue'
  29. import { MyProgress } from '@/domain/models/metrics/metrics'
  30. export default Vue.extend({
  31. props: {
  32. progress: {
  33. type: Object as PropType<MyProgress>,
  34. required: true
  35. },
  36. },
  37. computed: {
  38. percentage(): number {
  39. return Math.ceil(this.progress.complete / this.progress.total * 100)
  40. }
  41. }
  42. })
  43. </script>