From 5a8fbf48a2abe85b686eca78d47875ca455ab147 Mon Sep 17 00:00:00 2001 From: vapao Date: Sun, 14 Jun 2020 17:30:17 +0800 Subject: [PATCH] =?UTF-8?q?U=20=E4=BC=98=E5=8C=96=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=83=A8=E5=88=86=E5=AD=97=E6=AE=B5=E6=8E=92?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spug_web/src/pages/deploy/request/Table.js | 3 ++- spug_web/src/pages/host/Table.js | 2 ++ spug_web/src/pages/monitor/Table.js | 3 ++- spug_web/src/pages/monitor/store.js | 2 +- spug_web/src/pages/schedule/Table.js | 3 ++- spug_web/src/pages/schedule/store.js | 2 +- 6 files changed, 10 insertions(+), 5 deletions(-) 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;