-
-
Notifications
You must be signed in to change notification settings - Fork 226
/
TransferStats.vue
57 lines (55 loc) · 1.43 KB
/
TransferStats.vue
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
<template>
<div v-if="status" class="mt-3 mb-3">
<label class="text-uppercase white--text caption font-weight-medium ml-4">
{{ getTitle }}
</label>
<v-tooltip v-if="isSession" bottom>
<template #activator="{ on }">
<v-icon
color="white"
style="opacity: 0.3;"
small
v-on="on"
>
{{ mdiInformationOutline }}
</v-icon>
</template>
<span>{{ $t('navbar.sessionStats.tooltip') }}</span>
</v-tooltip>
<StorageCard
class="mb-4 mt-4"
label="Downloaded"
color="download"
:value="getDownload"
/>
<StorageCard label="Uploaded" color="upload" :value="getUpload" />
</div>
</template>
<script>
import { mdiInformationOutline } from '@mdi/js'
import StorageCard from '@/components/Core/StorageCard'
export default {
name: 'TransferStats',
components: { StorageCard },
props: ['status', 'session'],
data: () => ({
mdiInformationOutline,
sessionTitle: 'session stats',
alltimeTitle: 'all-time stats'
}),
computed: {
isSession() {
return this.session
},
getTitle() {
return this.isSession ? this.sessionTitle : this.alltimeTitle
},
getDownload() {
return this.isSession ? this.status.sessionDownloaded : this.status.alltimeDownloaded
},
getUpload() {
return this.isSession ? this.status.sessionUploaded : this.status.alltimeUploaded
}
}
}
</script>