Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
2 changes: 1 addition & 1 deletion web-console/src/utils/general.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ exports[`tasks view matches snapshot 1`] = `
"accessor": [Function],
"id": "status",
"show": true,
"width": 300,
},
Object {
"Cell": [Function],
Expand Down
21 changes: 17 additions & 4 deletions web-console/src/views/task-view/tasks-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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[]>;
Expand Down Expand Up @@ -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>
Expand Down