Skip to content

Commit 32ee6d3

Browse files
committed
[FLINK-38899][runtime-web] Introduce the Rescales/History sub-page for streaming jobs with the adaptive scheduler enabled - Temporary commit for review (Changed the expand and styles in the job-rescales.component.html.)
1 parent d1843bc commit 32ee6d3

2 files changed

Lines changed: 54 additions & 29 deletions

File tree

flink-runtime-web/web-dashboard/src/app/pages/job/rescales/job-rescales.component.html

Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
<tr>
8383
<td
8484
nzShowExpand
85-
[(nzExpand)]="history.expand"
85+
[nzExpand]="isExpanded(history.rescaleUuid)"
8686
(nzExpandChange)="onExpandChange(history, $event)"
8787
></td>
8888
<td nz-tooltip [nzTooltipTitle]="history.rescaleUuid">
@@ -101,29 +101,44 @@
101101
</td>
102102
<td>{{ history.endTimestampInMillis | date: 'yyyy-MM-dd HH:mm:ss.SSS' }}</td>
103103
</tr>
104-
<tr [nzExpand]="history.expand">
105-
<td colspan="10" *ngIf="history.expand" class="collapse-td">
104+
<tr [nzExpand]="isExpanded(history.rescaleUuid)">
105+
<td colspan="10" *ngIf="isExpanded(history.rescaleUuid)" class="collapse-td">
106106
<div class="rescale-details-wrapper">
107107
<div class="rescale-details-box">
108108
<h3><strong>Rescale Details</strong></h3>
109-
<p>
110-
Rescale UUID:
111-
{{ truncateUuid(history.rescaleUuid) }}
112-
<nz-divider nzType="vertical"></nz-divider>
113-
Attempt ID:
114-
{{ history.rescaleAttemptId }}
115-
<nz-divider nzType="vertical"></nz-divider>
116-
Requirements ID:
117-
{{ truncateUuid(history.resourceRequirementsUuid) }}
118-
<nz-divider nzType="vertical"></nz-divider>
119-
Trigger Cause:
120-
{{ history.triggerCause }}
121-
<nz-divider nzType="vertical"></nz-divider>
122-
Terminal State:
123-
{{ history.terminalState }}
124-
<nz-divider nzType="vertical"></nz-divider>
125-
Terminal Reason: {{ history.terminatedReason }}
126-
</p>
109+
<tr>
110+
<td>
111+
<span>
112+
<strong>Rescale UUID:</strong>
113+
{{ truncateUuid(history.rescaleUuid) }}
114+
</span>
115+
<nz-divider nzType="vertical"></nz-divider>
116+
<span>
117+
<strong>Attempt ID:</strong>
118+
{{ history.rescaleAttemptId }}
119+
</span>
120+
<nz-divider nzType="vertical"></nz-divider>
121+
<span>
122+
<strong>Requirements ID:</strong>
123+
{{ truncateUuid(history.resourceRequirementsUuid) }}
124+
</span>
125+
<nz-divider nzType="vertical"></nz-divider>
126+
<span>
127+
<strong>Trigger Cause:</strong>
128+
{{ history.triggerCause }}
129+
</span>
130+
<nz-divider nzType="vertical"></nz-divider>
131+
<span>
132+
<strong>Terminal State:</strong>
133+
{{ history.terminalState }}
134+
</span>
135+
<nz-divider nzType="vertical"></nz-divider>
136+
<span>
137+
<strong>Terminal Reason:</strong>
138+
{{ history.terminatedReason }}
139+
</span>
140+
</td>
141+
</tr>
127142
<ng-container *ngIf="getDetail(history.rescaleUuid) as detail">
128143
<nz-table
129144
class="small"

flink-runtime-web/web-dashboard/src/app/pages/job/rescales/job-rescales.component.ts

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export class JobRescalesComponent implements OnInit, OnDestroy {
7070
public rescaleDetailsMap = new Map<string, JobRescaleDetails>();
7171
public rescalesConfig?: JobRescaleConfigInfo;
7272
public jobDetail: JobDetail;
73+
public expandedRowsSet = new Set<string>();
7374

7475
private refresh$ = new Subject<void>();
7576
private destroy$ = new Subject<void>();
@@ -133,17 +134,26 @@ export class JobRescalesComponent implements OnInit, OnDestroy {
133134
}
134135

135136
public onExpandChange(history: BriefJobRescaleDetails, expanded: boolean): void {
136-
if (expanded && !this.rescaleDetailsMap.has(history.rescaleUuid)) {
137-
this.jobService
138-
.loadRescaleDetail(this.jobDetail.jid, history.rescaleUuid)
139-
.pipe(takeUntil(this.destroy$))
140-
.subscribe(detail => {
141-
this.rescaleDetailsMap.set(history.rescaleUuid, detail);
142-
this.cdr.markForCheck();
143-
});
137+
if (expanded) {
138+
this.expandedRowsSet.add(history.rescaleUuid);
139+
if (!this.rescaleDetailsMap.has(history.rescaleUuid)) {
140+
this.jobService
141+
.loadRescaleDetail(this.jobDetail.jid, history.rescaleUuid)
142+
.pipe(takeUntil(this.destroy$))
143+
.subscribe(detail => {
144+
this.rescaleDetailsMap.set(history.rescaleUuid, detail);
145+
this.cdr.markForCheck();
146+
});
147+
}
148+
} else {
149+
this.expandedRowsSet.delete(history.rescaleUuid);
144150
}
145151
}
146152

153+
public isExpanded(rescaleUuid: string): boolean {
154+
return this.expandedRowsSet.has(rescaleUuid);
155+
}
156+
147157
public getDetail(rescaleUuid: string): JobRescaleDetails | undefined {
148158
return this.rescaleDetailsMap.get(rescaleUuid);
149159
}

0 commit comments

Comments
 (0)