Skip to content

Commit 5f0eb4c

Browse files
authored
Merge pull request #3 from CovenantSQL/dev
Dev
2 parents 6ab5e7f + 0d16e21 commit 5f0eb4c

4 files changed

Lines changed: 23 additions & 22 deletions

File tree

src/components/Layout/Menu.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class SiderMenu extends PureComponent {
112112
mode="inline"
113113
theme={theme}
114114
onOpenChange={this.onOpenChange}
115-
inlineCollapsed={collapsed}
115+
collapsed={String(collapsed)}
116116
selectedKeys={selectedKeys}
117117
onClick={
118118
isMobile

src/components/Layout/Sider.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class Sider extends PureComponent {
4040

4141
<div className={styles.menuContainer}>
4242
<ScrollBar
43-
option={{
43+
options={{
4444
// Disabled horizontal scrolling, https://github.com/utatti/perfect-scrollbar#options
4545
suppressScrollX: true,
4646
}}

src/models/app.js

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { message } from 'antd'
77
import { ROLE_TYPE } from 'utils/constant'
88
import { queryLayout, pathMatchRegexp } from 'utils'
99
import { CANCEL_REQUEST_MESSAGE, USER_PERMISSION } from 'utils/constant'
10-
import { find } from 'lodash'
10+
import { find, unionBy } from 'lodash'
1111
import routes from 'utils/routes'
1212
import api from 'api'
1313
import config from 'config'
@@ -36,15 +36,7 @@ export default {
3636
permissions: {
3737
visit: [],
3838
},
39-
routeList: [
40-
{
41-
id: '1',
42-
icon: 'laptop',
43-
name: 'Dashboard',
44-
zhName: '仪表盘',
45-
router: '/dashboard',
46-
},
47-
],
39+
routeList: routes,
4840
locationPathname: '',
4941
locationQuery: {},
5042
notifications: [
@@ -255,10 +247,12 @@ export default {
255247

256248
yield put({ type: 'updateRoutes', payload: { append: routesToAppend } })
257249
},
258-
*updateRoutes({ payload }, { put }) {
259-
let routeList = routes
250+
*updateRoutes({ payload }, { put, select }) {
251+
const _app = yield select(_ => _.app)
252+
let routeList = _app.routeList
253+
260254
if (payload && payload.append) {
261-
routeList = routeList.concat(payload.append)
255+
routeList = unionBy(routeList, payload.append, 'id')
262256
}
263257

264258
let permissions = USER_PERMISSION.DEVELOPER

src/pages/dashboard/components/taskList.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,24 @@ class TaskList extends PureComponent {
7171
{
7272
title: 'Created',
7373
dataIndex: 'created',
74-
render: text => moment(text).format('MM-DD HH:mm:ss'),
74+
render: text => {
75+
let d = new Date(text)
76+
return moment(d).format('MM-DD HH:mm:ss')
77+
},
7578
},
7679
{
7780
title: 'Finished',
7881
dataIndex: 'finished',
79-
render: text =>
80-
text
81-
? moment(text)
82-
.startOf('second')
83-
.fromNow()
84-
: '-',
82+
render: text => {
83+
if (text) {
84+
let d = new Date(text)
85+
return moment(d)
86+
.startOf('second')
87+
.fromNow()
88+
} else {
89+
return '-'
90+
}
91+
},
8592
},
8693
{
8794
title: 'Details',

0 commit comments

Comments
 (0)