Skip to content
This repository was archived by the owner on Jul 15, 2022. It is now read-only.

Commit 0ddfd75

Browse files
author
Leonardo Chaia
committed
feat: image info for docker hub images
1 parent 29554ad commit 0ddfd75

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/app/docker-hub/docker-hub-repo-list/docker-hub-repo-list.component.html

+6
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ <h2>
2525
</h2>
2626
</div>
2727

28+
<div>
29+
<a mat-raised-button
30+
(click)="imagePreview(repo)">
31+
+info
32+
</a>
33+
</div>
2834
<div>
2935
<a mat-raised-button
3036
color="primary"

src/app/docker-hub/docker-hub-repo-list/docker-hub-repo-list.component.ts

+13
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { TimoneerTabs } from '../../timoneer-tabs';
55
import { DockerHubRepositoryResponse } from '../docker-hub.model';
66
import { Subject } from 'rxjs';
77
import { takeUntil } from 'rxjs/operators';
8+
import { ImagePreviewContainerComponentData } from '../../docker-image-preview/image-preview-container/image-preview-container.component';
89

910
@Component({
1011
selector: 'tim-docker-hub-repo-list',
@@ -46,6 +47,18 @@ export class DockerHubRepoListComponent implements OnInit, OnDestroy {
4647
});
4748
}
4849

50+
public imagePreview(repo: { namespace: string; name: string; }) {
51+
const r = `${repo.namespace}/${repo.name}`;
52+
this.tabService.add(TimoneerTabs.IMAGE_PREVIEW, {
53+
title: r,
54+
params: {
55+
image: r,
56+
registry: 'https://index.docker.io/',
57+
tag: 'latest'
58+
} as ImagePreviewContainerComponentData
59+
});
60+
}
61+
4962
public ngOnDestroy() {
5063
this.componetDestroyed.next();
5164
this.componetDestroyed.unsubscribe();

0 commit comments

Comments
 (0)