only display images without previous tag;
This commit is contained in:
parent
3550076756
commit
80d6fd1c16
@ -7,8 +7,8 @@
|
||||
</div>
|
||||
|
||||
<mat-expansion-panel
|
||||
*ngFor="let image of images | slice:paginationGetStart():paginationGetEnd(); let i = index"
|
||||
(opened)="loadImage(i + paginationGetStart(), image.filename.split('.')[0])"
|
||||
*ngFor="let image of filterOnlyNewestImageVersion() | slice:paginationGetStart():paginationGetEnd()"
|
||||
(opened)="loadImage(getImageIndex(image), image.filename.split('.')[0])"
|
||||
>
|
||||
<mat-expansion-panel-header (click)="$event.stopPropagation()">
|
||||
<h4 style="width: 25em"
|
||||
@ -69,8 +69,8 @@
|
||||
</ng-template>
|
||||
</mat-expansion-panel>
|
||||
|
||||
<mat-paginator *ngIf="images.length > 0"
|
||||
[length]="images.length"
|
||||
<mat-paginator *ngIf="filterOnlyNewestImageVersion().length > 0"
|
||||
[length]="filterOnlyNewestImageVersion().length"
|
||||
[pageSize]="pageSizeOptions[0]"
|
||||
[pageSizeOptions]="pageSizeOptions"
|
||||
(page)="lastPageEvent = $event"
|
||||
|
||||
@ -58,4 +58,12 @@ export class ImagesComponent implements OnInit, AfterViewInit {
|
||||
this.logger.error('loadImage', i, id, err);
|
||||
});
|
||||
}
|
||||
|
||||
filterOnlyNewestImageVersion() {
|
||||
return this.images.filter(image => !image.previous);
|
||||
}
|
||||
|
||||
getImageIndex(image: ImageMetadata) {
|
||||
return this.images.findIndex(img => image === img);
|
||||
}
|
||||
}
|
||||
|
||||
@ -21,6 +21,7 @@ export interface ImageMetadata {
|
||||
image_b64?: string;
|
||||
tag?: string;
|
||||
version?: string;
|
||||
previous?: string;
|
||||
}
|
||||
|
||||
export interface GetImageResponse {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user