mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-26 20:26:13 +01:00
Fix tag retention ui loading issue (#13905)
Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
parent
2ae57cdeb5
commit
bd585481c7
@ -358,33 +358,33 @@ export class TagRetentionComponent implements OnInit {
|
|||||||
|
|
||||||
loadLog() {
|
loadLog() {
|
||||||
if (this.isDetailOpened) {
|
if (this.isDetailOpened) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {// when this.isDetailOpened is true, need to wait ngCheck finished
|
||||||
this.loadingHistories = true;
|
this.loadingHistories = true;
|
||||||
}, 0);
|
this.tagRetentionService.getExecutionHistory(this.retentionId, this.executionId, this.currentLogPage, this.logPageSize)
|
||||||
this.tagRetentionService.getExecutionHistory(this.retentionId, this.executionId, this.currentLogPage, this.logPageSize)
|
.pipe(finalize(() => this.loadingHistories = false))
|
||||||
.pipe(finalize(() => this.loadingHistories = false))
|
.subscribe(
|
||||||
.subscribe(
|
(response: any) => {
|
||||||
(response: any) => {
|
// Get total count
|
||||||
// Get total count
|
if (response.headers) {
|
||||||
if (response.headers) {
|
let xHeader: string = response.headers.get("x-total-count");
|
||||||
let xHeader: string = response.headers.get("x-total-count");
|
if (xHeader) {
|
||||||
if (xHeader) {
|
this.totalLogCount = parseInt(xHeader, 0);
|
||||||
this.totalLogCount = parseInt(xHeader, 0);
|
}
|
||||||
}
|
}
|
||||||
}
|
this.historyList = response.body as Array<any>;
|
||||||
this.historyList = response.body as Array<any>;
|
TagRetentionComponent.calculateDuration(this.historyList);
|
||||||
TagRetentionComponent.calculateDuration(this.historyList);
|
if (this.historyList && this.historyList.length
|
||||||
if (this.historyList && this.historyList.length
|
&& this.historyList.some(item => {
|
||||||
&& this.historyList.some(item => {
|
return item.status === RUNNING || item.status === PENDING;
|
||||||
return item.status === RUNNING || item.status === PENDING;
|
})) {
|
||||||
})) {
|
setTimeout(() => {
|
||||||
setTimeout(() => {
|
this.loadLog();
|
||||||
this.loadLog();
|
}, TIMEOUT);
|
||||||
}, TIMEOUT);
|
}
|
||||||
}
|
}, error => {
|
||||||
}, error => {
|
this.errorHandler.error(error);
|
||||||
this.errorHandler.error(error);
|
});
|
||||||
});
|
}, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
openDetail(index, executionId) {
|
openDetail(index, executionId) {
|
||||||
|
Loading…
Reference in New Issue
Block a user