mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-27 19:17:47 +01:00
Fix cve export UI issues (#17227)
Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
parent
a4c577f9ec
commit
e9855a88dd
@ -235,56 +235,60 @@
|
||||
{{ 'OPERATION.FAILED' | translate }}
|
||||
</button>
|
||||
<clr-tab-content id="contentFailed" *clrIfActive>
|
||||
<div
|
||||
class="eventInfo"
|
||||
*ngFor="let item of exportJobs">
|
||||
<ng-container *ngFor="let item of exportJobs">
|
||||
<div
|
||||
class="iconsArea"
|
||||
*ngIf="item.state === 'failure'">
|
||||
<i
|
||||
class="spinner spinner-inline spinner-pos"
|
||||
[hidden]="
|
||||
item.state !== 'progressing'
|
||||
"></i>
|
||||
<clr-icon
|
||||
[hidden]="item.state !== 'success'"
|
||||
size="18"
|
||||
shape="success-standard"
|
||||
class="color-green"></clr-icon>
|
||||
<clr-icon
|
||||
[hidden]="item.state !== 'failure'"
|
||||
size="18"
|
||||
shape="error-standard"
|
||||
class="color-red"></clr-icon>
|
||||
<clr-icon
|
||||
[hidden]="item.state !== 'interrupt'"
|
||||
size="18"
|
||||
shape="unlink"
|
||||
class="color-orange"></clr-icon>
|
||||
*ngIf="item.state === 'failure'"
|
||||
class="eventInfo">
|
||||
<div class="iconsArea">
|
||||
<i
|
||||
class="spinner spinner-inline spinner-pos"
|
||||
[hidden]="
|
||||
item.state !== 'progressing'
|
||||
"></i>
|
||||
<clr-icon
|
||||
[hidden]="item.state !== 'success'"
|
||||
size="18"
|
||||
shape="success-standard"
|
||||
class="color-green"></clr-icon>
|
||||
<clr-icon
|
||||
[hidden]="item.state !== 'failure'"
|
||||
size="18"
|
||||
shape="error-standard"
|
||||
class="color-red"></clr-icon>
|
||||
<clr-icon
|
||||
[hidden]="
|
||||
item.state !== 'interrupt'
|
||||
"
|
||||
size="18"
|
||||
shape="unlink"
|
||||
class="color-orange"></clr-icon>
|
||||
</div>
|
||||
<div class="infoArea">
|
||||
<label
|
||||
class="eventName"
|
||||
(click)="
|
||||
toggleTitle(spanErrorInfo)
|
||||
">
|
||||
<span class="flex">
|
||||
<span class="job-name">{{
|
||||
item.name | translate
|
||||
}}</span>
|
||||
</span>
|
||||
</label>
|
||||
<span class="eventTarget">{{
|
||||
item.data.name
|
||||
}}</span
|
||||
><span class="eventTime">{{
|
||||
item.timeDiff | translate
|
||||
}}</span>
|
||||
<span
|
||||
#spanErrorInfo
|
||||
class="eventErrorInf hidden-info"
|
||||
>{{ item.data.errorInf }}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div class="infoArea">
|
||||
<label
|
||||
class="eventName"
|
||||
(click)="toggleTitle(spanErrorInfo)">
|
||||
<span class="flex">
|
||||
<span class="job-name">{{
|
||||
item.name | translate
|
||||
}}</span>
|
||||
</span>
|
||||
</label>
|
||||
<span class="eventTarget">{{
|
||||
item.data.name
|
||||
}}</span
|
||||
><span class="eventTime">{{
|
||||
item.timeDiff | translate
|
||||
}}</span>
|
||||
<span
|
||||
#spanErrorInfo
|
||||
class="eventErrorInf hidden-info"
|
||||
>{{ item.data.errorInf }}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
<div
|
||||
class="eventInfo"
|
||||
*ngFor="let list of failLists">
|
||||
|
@ -237,16 +237,6 @@ export class OperationComponent implements OnInit, OnDestroy {
|
||||
daysAgo
|
||||
);
|
||||
});
|
||||
this.exportJobs.forEach(data => {
|
||||
const timeDiff: number = new Date().getTime() - +data.timeStamp;
|
||||
data.timeDiff = this.calculateTime(
|
||||
timeDiff,
|
||||
secondsAgo,
|
||||
minutesAgo,
|
||||
hoursAgo,
|
||||
daysAgo
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
calculateTime(
|
||||
@ -299,6 +289,7 @@ export class OperationComponent implements OnInit, OnDestroy {
|
||||
flag = true;
|
||||
}
|
||||
});
|
||||
this.refreshTimestampForExportJob();
|
||||
if (flag) {
|
||||
this.timeout = setTimeout(() => {
|
||||
this.refreshExportJobs();
|
||||
@ -353,4 +344,30 @@ export class OperationComponent implements OnInit, OnDestroy {
|
||||
);
|
||||
}
|
||||
}
|
||||
refreshTimestampForExportJob() {
|
||||
let secondsAgo: string,
|
||||
minutesAgo: string,
|
||||
hoursAgo: string,
|
||||
daysAgo: string;
|
||||
forkJoin([
|
||||
this.translate.get('OPERATION.SECOND_AGO'),
|
||||
this.translate.get('OPERATION.MINUTE_AGO'),
|
||||
this.translate.get('OPERATION.HOUR_AGO'),
|
||||
this.translate.get('OPERATION.DAY_AGO'),
|
||||
]).subscribe(res => {
|
||||
[secondsAgo, minutesAgo, hoursAgo, daysAgo] = res;
|
||||
});
|
||||
if (this.exportJobs?.length) {
|
||||
this.exportJobs.forEach(data => {
|
||||
const timeDiff: number = new Date().getTime() - +data.timeStamp;
|
||||
data.timeDiff = this.calculateTime(
|
||||
timeDiff,
|
||||
secondsAgo,
|
||||
minutesAgo,
|
||||
hoursAgo,
|
||||
daysAgo
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user