-
Notifications
You must be signed in to change notification settings - Fork 91
Expand file tree
/
Copy pathdashboard.js
More file actions
133 lines (130 loc) · 2.76 KB
/
Copy pathdashboard.js
File metadata and controls
133 lines (130 loc) · 2.76 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
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
import { color } from '../src/utils/theme'
const Mock = require('mockjs')
const dashboard = Mock.mock({
'sales|8': [
{
'name|+1': 2008,
'Clothes|200-500': 1,
'Food|180-400': 1,
'Electronics|300-550': 1,
},
],
cpu: {
'usage|50-600': 1,
space: 825,
'cpu|40-90': 1,
'data|20': [
{
'cpu|20-80': 1,
},
],
},
browser: [
{
name: 'Google Chrome',
percent: 43.3,
status: 1,
},
{
name: 'Mozilla Firefox',
percent: 33.4,
status: 2,
},
{
name: 'Apple Safari',
percent: 34.6,
status: 3,
},
{
name: 'Internet Explorer',
percent: 12.3,
status: 4,
},
{
name: 'Opera Mini',
percent: 3.3,
status: 1,
},
{
name: 'Chromium',
percent: 2.53,
status: 1,
},
],
user: {
name: 'pmg1989',
email: '972401854@qq.com',
sales: 3241,
sold: 3556,
avatar: 'https://avatars0.githubusercontent.com/u/13361827?v=3&s=460',
},
'completed|12': [
{
'name|+1': 2008,
'Task complete|200-1000': 1,
'Cards Complete|200-1000': 1,
},
],
'comments|5': [
{
name: '@last',
'status|1-3': 1,
content: '@sentence',
avatar () {
return Mock.Random.image('48x48', Mock.Random.color(), '#757575', 'png', this.name.substr(0, 1))
},
date () {
return `2016-${Mock.Random.date('MM-dd')} ${Mock.Random.time('HH:mm:ss')}`
},
},
],
'recentSales|36': [
{
'id|+1': 1,
name: '@last',
'status|1-4': 1,
date () {
return `${Mock.Random.integer(2015, 2016)}-${Mock.Random.date('MM-dd')} ${Mock.Random.time('HH:mm:ss')}`
},
'price|10-200.1-2': 1,
},
],
quote: {
name: 'Joho Doe',
title: 'Graphic Designer',
content: 'I\'m selfish, impatient and a little insecure. I make mistakes, I am out of control and at times hard to handle. But if you can\'t handle me at my worst, then you sure as hell don\'t deserve me at my best.',
avatar: 'http://img.hb.aicdn.com/bc442cf0cc6f7940dcc567e465048d1a8d634493198c4-sPx5BR_fw236',
},
numbers: [
{
icon: 'pay-circle-o',
color: color.green,
title: 'Online Review',
number: 2500,
percent: 25,
}, {
icon: 'team',
color: color.blue,
title: 'New Customers',
number: 5000,
percent: 50,
}, {
icon: 'message',
color: color.purple,
title: 'Active Projects',
number: 7500,
percent: 75,
}, {
icon: 'shopping-cart',
color: color.red,
title: 'Referrals',
number: 10000,
percent: 100,
},
],
})
module.exports = {
'GET /api/dashboard': function (req, res) {
res.json(dashboard)
},
}