Merge pull request #5523 from zhoumeina/pr/error_log_fix

Add onError for some logo return 404
This commit is contained in:
Mia ZHOU 2018-08-06 09:18:06 +08:00 committed by GitHub
commit 034367f202
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 10 deletions

View File

@ -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 + ',';
}

View File

@ -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>

View File

@ -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;
}
}