forked from Stigmatoz/web-activity-time-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOverallStatistics.vue
More file actions
92 lines (84 loc) · 2.3 KB
/
OverallStatistics.vue
File metadata and controls
92 lines (84 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<template>
<div class="stats-block">
<div class="row">
<div class="block">
<div class="header">The first active day</div>
<p>{{ data.firstDay.toLocaleDateString() }}</p>
</div>
<div class="block">
<div class="header">Number of active days</div>
<p>{{ data.activeDaysTotal }}</p>
</div>
<div class="block">
<div class="header">Total number of days</div>
<p>{{ data.daysTotal }}</p>
</div>
</div>
<div class="row">
<div class="block">
<div class="header">Time for today</div>
<p>{{ convertSummaryTimeToString(data.todaySummaryTime) }}</p>
</div>
<div class="block">
<div class="header">All the time</div>
<p>{{ convertSummaryTimeToString(data.summaryTime) }}</p>
</div>
<div class="block">
<div class="header">Average time on active days</div>
<p>{{ convertSummaryTimeToString(data.averageTimeByActiveDays) }}</p>
</div>
</div>
<div class="row">
<div class="block">
<div class="header">The most active day</div>
<p>{{ data.mostActiveDay.date.toLocaleDateString() }}</p>
<p>{{ convertSummaryTimeToString(data.mostActiveDay.summaryTime) }}</p>
</div>
<div class="block">
<div class="header">The most inactive day</div>
<p>{{ data.mostInactiveDay.date.toLocaleDateString() }}</p>
<p>{{ convertSummaryTimeToString(data.mostInactiveDay.summaryTime) }}</p>
</div>
</div>
</div>
</template>
<script lang="ts">
export default {
name: 'OverallStatistics',
};
</script>
<script lang="ts" setup>
import { OverallStats } from '../dto/tabListSummary';
import { convertSummaryTimeToString } from '../utils/converter';
const props = defineProps<{
data: OverallStats;
}>();
</script>
<style scoped>
.stats-block {
margin: 5px 35px;
}
.stats-block .row {
display: flex;
flex-direction: row;
justify-content: space-around;
margin: 10px 0;
}
.stats-block .block {
width: 165px;
text-align: center;
}
.stats-block .block .header {
background-color: var(--popup-header);
color: rgb(66, 66, 66);
padding: 5px 5px;
border-radius: 5px;
}
.stats-block .block p {
margin: 2px;
text-align: center;
font-weight: 700;
font-size: 13px;
color: rgb(59, 59, 59);
}
</style>