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