You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
143 lines
2.7 KiB
143 lines
2.7 KiB
import { Mock, Constant } from './_utils'
|
|
|
|
const { ApiPrefix, Color } = Constant
|
|
|
|
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: 'github',
|
|
sales: 3241,
|
|
sold: 3556,
|
|
},
|
|
'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:
|
|
'//cdn.antd-admin.zuiidea.com/bc442cf0cc6f7940dcc567e465048d1a8d634493198c4-sPx5BR_fw236',
|
|
},
|
|
numbers: [
|
|
{
|
|
icon: 'pay-circle-o',
|
|
color: Color.green,
|
|
title: 'Online Review',
|
|
number: 2781,
|
|
},
|
|
{
|
|
icon: 'team',
|
|
color: Color.blue,
|
|
title: 'New Customers',
|
|
number: 3241,
|
|
},
|
|
{
|
|
icon: 'message',
|
|
color: Color.purple,
|
|
title: 'Active Projects',
|
|
number: 253,
|
|
},
|
|
{
|
|
icon: 'shopping-cart',
|
|
color: Color.red,
|
|
title: 'Referrals',
|
|
number: 4324,
|
|
},
|
|
],
|
|
})
|
|
|
|
module.exports = {
|
|
[`GET ${ApiPrefix}/dashboard`](req, res) {
|
|
res.json(Dashboard)
|
|
},
|
|
}
|