Web-console: add hostname to tasks view (#7758)

* add host name

* change to location

* remove space
This commit is contained in:
mcbrewster 2019-05-24 23:18:18 -07:00 committed by Clint Wylie
parent 2b7bb064b5
commit 7eac685e47
3 changed files with 22 additions and 3 deletions

View File

@ -88,9 +88,10 @@ function getNeedleAndMode(input: string): NeedleAndMode {
} }
export function booleanCustomTableFilter(filter: Filter, value: any): boolean { export function booleanCustomTableFilter(filter: Filter, value: any): boolean {
if (value === undefined) { if (value === undefined ) {
return true; return true;
} }
if (value === null) return false;
const haystack = String(value.toLowerCase()); const haystack = String(value.toLowerCase());
const needleAndMode: NeedleAndMode = getNeedleAndMode(filter.value.toLowerCase()); const needleAndMode: NeedleAndMode = getNeedleAndMode(filter.value.toLowerCase());
const needle = needleAndMode.needle; const needle = needleAndMode.needle;

View File

@ -362,6 +362,7 @@ exports[`describe tasks view tasks view snapshot 1`] = `
"Task ID", "Task ID",
"Type", "Type",
"Datasource", "Datasource",
"Location",
"Created time", "Created time",
"Status", "Status",
"Duration", "Duration",
@ -446,6 +447,13 @@ exports[`describe tasks view tasks view snapshot 1`] = `
"accessor": "datasource", "accessor": "datasource",
"show": true, "show": true,
}, },
Object {
"Aggregated": [Function],
"Header": "Location",
"accessor": "location",
"filterMethod": [Function],
"show": true,
},
Object { Object {
"Aggregated": [Function], "Aggregated": [Function],
"Header": "Created time", "Header": "Created time",

View File

@ -41,7 +41,7 @@ import { BasicAction, basicActionsToMenu } from '../../utils/basic-action';
import './tasks-view.scss'; import './tasks-view.scss';
const supervisorTableColumns: string[] = ['Datasource', 'Type', 'Topic/Stream', 'Status', 'Actions']; const supervisorTableColumns: string[] = ['Datasource', 'Type', 'Topic/Stream', 'Status', 'Actions'];
const taskTableColumns: string[] = ['Task ID', 'Type', 'Datasource', 'Created time', 'Status', 'Duration', 'Actions']; const taskTableColumns: string[] = ['Task ID', 'Type', 'Datasource', 'Location', 'Created time', 'Status', 'Duration', 'Actions'];
export interface TasksViewProps extends React.Props<any> { export interface TasksViewProps extends React.Props<any> {
taskId: string | null; taskId: string | null;
@ -608,6 +608,16 @@ ORDER BY "rank" DESC, "created_time" DESC`);
}, },
show: taskTableColumnSelectionHandler.showColumn('Datasource') show: taskTableColumnSelectionHandler.showColumn('Datasource')
}, },
{
Header: 'Location',
accessor: 'location',
Aggregated: row => '',
filterMethod: (filter: Filter, row: any) => {
return booleanCustomTableFilter(filter, row.location);
},
show: taskTableColumnSelectionHandler.showColumn('Location')
},
{ {
Header: 'Created time', Header: 'Created time',
accessor: 'created_time', accessor: 'created_time',