diff --git a/flink-runtime-web/web-dashboard/src/app/pages/job/checkpoints/subtask/job-checkpoints-subtask.component.html b/flink-runtime-web/web-dashboard/src/app/pages/job/checkpoints/subtask/job-checkpoints-subtask.component.html index 2647ae83a2ac0..d65e3c2a82a6d 100644 --- a/flink-runtime-web/web-dashboard/src/app/pages/job/checkpoints/subtask/job-checkpoints-subtask.component.html +++ b/flink-runtime-web/web-dashboard/src/app/pages/job/checkpoints/subtask/job-checkpoints-subtask.component.html @@ -144,6 +144,7 @@ ID + Endpoint Acknowledged End to End Duration @@ -166,6 +167,7 @@ {{ subTask['index'] }} + {{ mapOfSubtask.get(subTask['index'])?.endpoint || '-' }} {{ subTask['ack_timestamp'] | date: 'yyyy-MM-dd HH:mm:ss.SSS' }} diff --git a/flink-runtime-web/web-dashboard/src/app/pages/job/checkpoints/subtask/job-checkpoints-subtask.component.ts b/flink-runtime-web/web-dashboard/src/app/pages/job/checkpoints/subtask/job-checkpoints-subtask.component.ts index d80d1003111e7..1913cfa6c1685 100644 --- a/flink-runtime-web/web-dashboard/src/app/pages/job/checkpoints/subtask/job-checkpoints-subtask.component.ts +++ b/flink-runtime-web/web-dashboard/src/app/pages/job/checkpoints/subtask/job-checkpoints-subtask.component.ts @@ -48,13 +48,13 @@ import { NzTableModule, NzTableSortFn } from 'ng-zorro-antd/table'; import { JobLocalService } from '../../job-local.service'; function createSortFn( - selector: (item: CompletedSubTaskCheckpointStatistics) => number | boolean + selector: (item: CompletedSubTaskCheckpointStatistics) => number | boolean | string | null ): NzTableSortFn { - // FIXME This type-asserts that pre / next are a specific subtype. - return (pre, next) => - selector(pre as CompletedSubTaskCheckpointStatistics) > selector(next as CompletedSubTaskCheckpointStatistics) - ? 1 - : -1; + return (pre, next) => { + const a = selector(pre as CompletedSubTaskCheckpointStatistics) ?? ''; + const b = selector(next as CompletedSubTaskCheckpointStatistics) ?? ''; + return a > b ? 1 : -1; + }; } @Component({ @@ -77,6 +77,11 @@ export class JobCheckpointsSubtaskComponent implements OnInit, OnChanges, OnDest public mapOfSubtask: Map = new Map(); public readonly sortAckTimestampFn = createSortFn(item => item.ack_timestamp); + public readonly sortEndpointFn: NzTableSortFn = (a, b) => { + const endpointA = this.mapOfSubtask.get(a['index'])?.endpoint ?? ''; + const endpointB = this.mapOfSubtask.get(b['index'])?.endpoint ?? ''; + return endpointA > endpointB ? 1 : endpointA < endpointB ? -1 : 0; + }; public readonly sortEndToEndDurationFn = createSortFn(item => item.end_to_end_duration); public readonly sortCheckpointedSizeFn = createSortFn(item => item.checkpointed_size); public readonly sortStateSizeFn = createSortFn(item => item.state_size);