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

Commit 5483436

Browse files
author
Leonardo Chaia
committed
feat: open image logs modal when pulling
1 parent 6620f44 commit 5483436

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/app/daemon-tools/docker-jobs.service.ts

+12-3
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,29 @@ import { PullImageJob, PullImageJobParams, PullImageJobProgress } from './pull-i
44
import { ContainerCreateBody } from '../../../node_modules/@types/dockerode';
55
import { ContainerCreationJobParams, ContainerCreationJob } from './container-creation-job';
66
import { JobProgress } from '../jobs/jobs.model';
7+
import { JobDetailsService } from '../jobs/job-details.service';
78

89
@Injectable({
910
providedIn: 'root'
1011
})
1112
export class DockerJobsService {
1213

13-
constructor(private jobRunner: JobRunnerService) { }
14+
constructor(
15+
private jobRunner: JobRunnerService,
16+
private jobDetails: JobDetailsService) { }
1417

15-
public pullImage(image: string) {
18+
public pullImage(image: string, openDetails = true) {
1619
const params = new PullImageJobParams(image);
17-
return this.jobRunner.startJob<PullImageJob, void, PullImageJobProgress>(PullImageJob, {
20+
const job = this.jobRunner.startJob<PullImageJob, void, PullImageJobProgress>(PullImageJob, {
1821
provide: PullImageJobParams,
1922
useValue: params
2023
});
24+
25+
if (openDetails) {
26+
this.jobDetails.openDetailsModal(job);
27+
}
28+
29+
return job;
2130
}
2231

2332
public createContainer(creationData: ContainerCreateBody) {

src/app/jobs/job-logs/job-logs.component.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<div fxLayout="column">
1+
<div fxLayout="column"
2+
style="min-width: 350px; min-height:250px;">
23

34
<div>
45
<h1>

0 commit comments

Comments
 (0)