-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathPersonalBlog.vue
167 lines (159 loc) · 4.87 KB
/
PersonalBlog.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
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<template>
<d-container fluid class="main-content-container px-4">
<!-- Page Header -->
<d-row no-gutters class="page-header py-4">
<d-col col sm="4" class="text-center text-sm-left mb-4 mb-sm-0">
<span class="text-uppercase page-subtitle">Dashboard</span>
<h3 class="page-title">Personal Blog</h3>
</d-col>
</d-row>
<!-- Small Stats Blocks -->
<d-row>
<d-col lg v-for="(stats, idx) in smallStats" :key="idx" class="mb-4">
<small-stats :id="`small-stats-${idx}`" variation="1" :chart-data="stats.datasets" :label="stats.label" :value="stats.value" :percentage="stats.percentage" :increase="stats.increase" :decrease="stats.decrease" />
</d-col>
</d-row>
<d-row>
<!-- Users Overview -->
<d-col lg="8" md="6" sm="12" class="mb-4">
<bo-users-overview />
</d-col>
<!-- Users by Device (lite) -->
<d-col lg="4" md="6" sm="12" class="mb-4">
<bo-users-by-device />
</d-col>
</d-row>
<d-row>
<!-- New Draft -->
<d-col lg="4" md="6" sm="12" class="mb-4">
<bo-new-draft />
</d-col>
<!-- Discussions -->
<d-col lg="5" md="12" sm="12" class="mb-4">
<bo-discussions @approve="handleApprove" @reject="handleReject" @edit="handleEdit" @view-all-comments="handleViewAllComments" />
</d-col>
<!-- Top Referrals -->
<d-col lg="3" md="12" sm="12" class="mb-4">
<bo-top-referrals />
</d-col>
</d-row>
</d-container>
</template>
<script>
import SmallStats from '@/components/common/SmallStats.vue';
import TopReferrals from '@/components/common/TopReferrals.vue';
import UsersOverview from '@/components/blog/UsersOverview.vue';
import UsersByDevice from '@/components/blog/UsersByDeviceLite.vue';
import NewDraft from '@/components/blog/NewDraft.vue';
import Discussions from '@/components/blog/Discussions.vue';
export default {
components: {
SmallStats,
boUsersOverview: UsersOverview,
boUsersByDevice: UsersByDevice,
boNewDraft: NewDraft,
boDiscussions: Discussions,
boTopReferrals: TopReferrals,
},
data() {
return {
dateRange: {
from: null,
to: null,
},
};
},
methods: {
handleApprove(id) {
alert(`Approving discussion id: ${id}`); // eslint-disable-line no-alert
},
handleReject(id) {
alert(`Rejecting discussion id: ${id}`); // eslint-disable-line no-alert
},
handleEdit(id) {
alert(`Editing discussion id: ${id}`); // eslint-disable-line no-alert
},
handleViewAllComments() {
alert('Viewing all comments!'); // eslint-disable-line no-alert
},
},
computed: {
smallStats() {
return [{
label: 'Posts',
value: '2,390',
percentage: '4.7%',
increase: true,
labels: ['Label', 'Label', 'Label', 'Label', 'Label', 'Label'],
datasets: [{
label: 'Today',
fill: 'start',
borderWidth: 1.5,
backgroundColor: 'rgba(0, 184, 216, 0.1)',
borderColor: 'rgb(0, 184, 216)',
data: [1, 2, 1, 3, 5, 4, 7],
}],
}, {
label: 'Pages',
value: '182',
percentage: '12.4',
increase: true,
labels: ['Label', 'Label', 'Label', 'Label', 'Label', 'Label'],
datasets: [{
label: 'Today',
fill: 'start',
borderWidth: 1.5,
backgroundColor: 'rgba(23,198,113,0.1)',
borderColor: 'rgb(23,198,113)',
data: [1, 2, 3, 3, 3, 4, 4],
}],
}, {
label: 'Comments',
value: '8,147',
percentage: '3.8%',
increase: false,
decrease: true,
labels: ['Label', 'Label', 'Label', 'Label', 'Label', 'Label'],
datasets: [{
label: 'Today',
fill: 'start',
borderWidth: 1.5,
backgroundColor: 'rgba(255,180,0,0.1)',
borderColor: 'rgb(255,180,0)',
data: [2, 3, 3, 3, 4, 3, 3],
}],
}, {
label: 'New Customers',
value: '29',
percentage: '2.71%',
increase: false,
decrease: true,
labels: ['Label', 'Label', 'Label', 'Label', 'Label', 'Label'],
datasets: [{
label: 'Today',
fill: 'start',
borderWidth: 1.5,
backgroundColor: 'rgba(255,65,105,0.1)',
borderColor: 'rgb(255,65,105)',
data: [1, 7, 1, 3, 1, 4, 8],
}],
}, {
label: 'Subscribers',
value: '17,281',
percentage: '2.4%',
increase: false,
decrease: true,
labels: ['Label', 'Label', 'Label', 'Label', 'Label', 'Label'],
datasets: [{
label: 'Today',
fill: 'start',
borderWidth: 1.5,
backgroundColor: 'rgb(0,123,255,0.1)',
borderColor: 'rgb(0,123,255)',
data: [3, 2, 3, 2, 4, 5, 4],
}],
}];
},
},
};
</script>