You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by cw...@apache.org on 2019/04/11 23:10:45 UTC
[incubator-druid] branch master updated: Fixed grouping and sorting
by status in task table (#7440)
This is an automated email from the ASF dual-hosted git repository.
cwylie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-druid.git
The following commit(s) were added to refs/heads/master by this push:
new 7382dac Fixed grouping and sorting by status in task table (#7440)
7382dac is described below
commit 7382dac44ef736f7b9d625ad497b8a225c6b70ab
Author: Qi Shu <sh...@gmail.com>
AuthorDate: Thu Apr 11 16:10:37 2019 -0700
Fixed grouping and sorting by status in task table (#7440)
* Fixed group by status
* Shorten code
---
web-console/src/views/tasks-view.tsx | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/web-console/src/views/tasks-view.tsx b/web-console/src/views/tasks-view.tsx
index 2897c6d..5f0756c 100644
--- a/web-console/src/views/tasks-view.tsx
+++ b/web-console/src/views/tasks-view.tsx
@@ -87,6 +87,7 @@ export class TasksView extends React.Component<TasksViewProps, TasksViewState> {
private taskQueryManager: QueryManager<string, any[]>;
private supervisorTableColumnSelectionHandler: TableColumnSelectionHandler;
private taskTableColumnSelectionHandler: TableColumnSelectionHandler;
+ private statusRanking = {RUNNING: 4, PENDING: 3, WAITING: 2, SUCCESS: 1, FAILED: 1};
constructor(props: TasksViewProps, context: any) {
super(props, context);
@@ -491,7 +492,7 @@ ORDER BY "rank" DESC, "created_time" DESC`);
Header: 'Status',
id: 'status',
width: 110,
- accessor: (row) => `${row.rank}_${row.created_time}_${row.status}`,
+ accessor: 'status',
Cell: row => {
if (row.aggregated) return '';
const { status, location } = row.original;
@@ -519,6 +520,10 @@ ORDER BY "rank" DESC, "created_time" DESC`);
const previewCount = countBy(previewValues);
return <span>{Object.keys(previewCount).sort().map(v => `${v} (${previewCount[v]})`).join(', ')}</span>;
},
+ sortMethod: (status1: string, status2: string) => {
+ const statusRanking: any = this.statusRanking;
+ return statusRanking[status1] - statusRanking[status2];
+ },
show: taskTableColumnSelectionHandler.showColumn('Status')
},
{
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org