mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-22 16:48:30 +01:00
Add onError for some logo return 404
We need to set a default logo for some logo may not exsit
This commit is contained in:
parent
7649cc5f1b
commit
4c8976da71
@ -319,8 +319,7 @@ export class CreateEditRuleComponent implements OnInit, OnDestroy {
|
||||
if (!data.value.deleted) {
|
||||
count++;
|
||||
this.filterLabelInfo.push(data.value);
|
||||
}
|
||||
if (data.value.deleted) {
|
||||
} else {
|
||||
this.deletedLabelCount++;
|
||||
delLabel += data.value.name + ',';
|
||||
}
|
||||
|
@ -54,8 +54,10 @@
|
||||
<clr-dg-column>{{'HELM_CHART.CREATED' | translate }}</clr-dg-column>
|
||||
<clr-dg-row *ngFor="let v of chartVersions" [clrDgItem]="v">
|
||||
<clr-dg-cell>
|
||||
<span class="list-img"><img [src]="getImgLink(v)"/></span>
|
||||
<a href="javascript:void(0)" (click)="onVersionClick(v)">{{ v.version }}</a>
|
||||
<span class="list-img">
|
||||
<img [src]="v.icon ?v.icon:chartDefaultIcon" (error)="getDefaultIcon(v);" />
|
||||
</span>
|
||||
<a href="#" (click)="onVersionClick(v)">{{ v.version }}</a>
|
||||
</clr-dg-cell>
|
||||
<clr-dg-cell>{{ v.engine }}</clr-dg-cell>
|
||||
<clr-dg-cell>{{ getMaintainerString(v.maintainers) }}</clr-dg-cell>
|
||||
|
@ -51,9 +51,11 @@ export class ChartVersionComponent implements OnInit {
|
||||
@Input() roleName: string;
|
||||
@Input() hasSignedIn: boolean;
|
||||
@Input() hasProjectAdminRole: boolean;
|
||||
@Input() chartDefaultIcon: string = DefaultHelmIcon;
|
||||
@Output() versionClickEvt = new EventEmitter<string>();
|
||||
@Output() backEvt = new EventEmitter<any>();
|
||||
|
||||
|
||||
lastFilteredVersionName: string;
|
||||
chartVersions: HelmChartVersion[] = [];
|
||||
versionsCopy: HelmChartVersion[] = [];
|
||||
@ -288,11 +290,8 @@ export class ChartVersionComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
getImgLink(v: HelmChartVersion) {
|
||||
if (v.icon) {
|
||||
return v.icon;
|
||||
} else {
|
||||
return DefaultHelmIcon;
|
||||
}
|
||||
|
||||
getDefaultIcon(v: HelmChartVersion) {
|
||||
v.icon = this.chartDefaultIcon;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user