diff --git a/spug_web/src/pages/deploy/request/Table.js b/spug_web/src/pages/deploy/request/Table.js index c029829..0f7dbcd 100644 --- a/spug_web/src/pages/deploy/request/Table.js +++ b/spug_web/src/pages/deploy/request/Table.js @@ -78,7 +78,8 @@ class ComTable extends React.Component { dataIndex: 'created_by_user', }, { title: '申请时间', - dataIndex: 'created_at' + dataIndex: 'created_at', + sorter: (a, b) => a['created_at'].localeCompare(b['created_at']) }, { title: '操作', render: info => { diff --git a/spug_web/src/pages/host/Table.js b/spug_web/src/pages/host/Table.js index 71a8133..db6022b 100644 --- a/spug_web/src/pages/host/Table.js +++ b/spug_web/src/pages/host/Table.js @@ -29,9 +29,11 @@ class ComTable extends React.Component { }, { title: '主机名称', dataIndex: 'name', + sorter: (a, b) => a.name.localeCompare(b.name) }, { title: '连接地址', dataIndex: 'hostname', + sorter: (a, b) => a.name.localeCompare(b.name) }, { title: '端口', dataIndex: 'port' diff --git a/spug_web/src/pages/monitor/Table.js b/spug_web/src/pages/monitor/Table.js index 89e715d..31e11ce 100644 --- a/spug_web/src/pages/monitor/Table.js +++ b/spug_web/src/pages/monitor/Table.js @@ -83,7 +83,8 @@ class ComTable extends React.Component { } }, { title: '更新于', - dataIndex: 'latest_run_time', + dataIndex: 'latest_run_time_alias', + sorter: (a, b) => a.latest_run_time.localeCompare(b.latest_run_time) }, { title: '操作', render: info => ( diff --git a/spug_web/src/pages/monitor/store.js b/spug_web/src/pages/monitor/store.js index 2dc13b2..7ccf091 100644 --- a/spug_web/src/pages/monitor/store.js +++ b/spug_web/src/pages/monitor/store.js @@ -26,7 +26,7 @@ class Store { res.map(item => { tmp.add(item['type_alias']); const value = item['latest_run_time']; - item['latest_run_time'] = value ? moment(value).fromNow() : null; + item['latest_run_time_alias'] = value ? moment(value).fromNow() : null; return null }); this.types = Array.from(tmp); diff --git a/spug_web/src/pages/schedule/Table.js b/spug_web/src/pages/schedule/Table.js index 390c32d..cf9b00a 100644 --- a/spug_web/src/pages/schedule/Table.js +++ b/spug_web/src/pages/schedule/Table.js @@ -65,7 +65,8 @@ class ComTable extends React.Component { }, }, { title: '更新于', - dataIndex: 'latest_run_time', + dataIndex: 'latest_run_time_alias', + sorter: (a, b) => a.latest_run_time.localeCompare(b.latest_run_time) }, { title: '描述信息', dataIndex: 'desc', diff --git a/spug_web/src/pages/schedule/store.js b/spug_web/src/pages/schedule/store.js index a4e9a80..da1a8ba 100644 --- a/spug_web/src/pages/schedule/store.js +++ b/spug_web/src/pages/schedule/store.js @@ -27,7 +27,7 @@ class Store { .then(({types, tasks}) => { tasks.map(item => { const value = item['latest_run_time']; - item['latest_run_time'] = value ? moment(value).fromNow() : null; + item['latest_run_time_alias'] = value ? moment(value).fromNow() : null; return null }); this.records = tasks;