-
Notifications
You must be signed in to change notification settings - Fork 8
/
sidebar.vue
51 lines (46 loc) · 1.06 KB
/
sidebar.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
<template>
<div class="matomo-sidebar">
<a v-if="showLink" :href="url" class="matomo-dashboard-link" target="_blank" rel="noopener">
<span class="icon"><svg><use href="#icon-matomo-external-link" /></svg></span>
<span class="text"><em>{{ $t('matomo.title.external_link') }}</em></span>
</a>
<realtime-widget v-if="realtime" />
<summary-widget v-if="summary" />
</div>
</template>
<script>
import RealtimeWidget from './widgets/realtime.vue'
import SummaryWidget from './widgets/summary.vue'
export default {
components: {RealtimeWidget, SummaryWidget},
data() {
return {
url: String,
link: false,
realtime: false,
summary: false,
}
},
computed: {
showLink() {
return this.link && this.url
}
},
created() {
this.load()
.then(response => {
this.url = response.url
this.link = response.link
this.realtime = response.realtime
this.summary = response.summary
})
},
destroyed() {
},
methods: {
},
}
</script>
<style lang="scss">
@import '../assets/css/styles.scss'
</style>