Web-console: update supervisors table (#7799)

* add new columns

* fix syling

* fix spaces

* update snapshots

* fix Spelling

* fix capitalization

* reorder action dialog

* set color using state

* fix snapshots

* fix array

* update snapshots

* remove extra columns

* update snapshots

* update snapshots

* fixes

* update snapshots

* use cell

* fix spacing

* update snapshot
This commit is contained in:
mcbrewster 2019-06-11 13:06:35 -07:00 committed by Clint Wylie
parent 8117222da3
commit 0763585208
9 changed files with 19 additions and 5 deletions

View File

@ -92,7 +92,7 @@ export function booleanCustomTableFilter(filter: Filter, value: any): boolean {
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 needle = needleAndMode.needle;
if (needleAndMode.mode === 'exact') {

View File

View File

@ -126,6 +126,7 @@ exports[`tasks view matches snapshot 1`] = `
"accessor": [Function],
"id": "status",
"show": true,
"width": 300,
},
Object {
"Cell": [Function],

View File

@ -109,6 +109,18 @@ function statusToColor(status: string): string {
}
}
function stateToColor(status: string): string {
switch (status) {
case 'UNHEALTHY_SUPERVISOR': return '#d5100a';
case 'UNHEALTHY_TASKS': return '#d5100a';
case 'PENDING': return '#ffbf00';
case `SUSPENDED`: return '#ffbf00';
case 'STOPPING': return '#d5100a';
case 'RUNNING': return '#2167d5';
default: return '#0a1500';
}
}
export class TasksView extends React.PureComponent<TasksViewProps, TasksViewState> {
private supervisorQueryManager: QueryManager<string, SupervisorQueryResultRow[]>;
private taskQueryManager: QueryManager<string, TaskQueryResultRow[]>;
@ -464,12 +476,13 @@ ORDER BY "rank" DESC, "created_time" DESC`);
{
Header: 'Status',
id: 'status',
accessor: (row) => row.spec.suspended ? 'Suspended' : 'Running',
Cell: row => {
const value = row.value;
width: 300,
accessor: (row) => { return row.detailedState; },
Cell: (row) => {
const value = row.original.detailedState;
return <span>
<span
style={{ color: value === 'Suspended' ? '#d58512' : '#2167d5' }}
style={{ color: stateToColor(row.original.state)}}
>
&#x25cf;&nbsp;
</span>