-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(admin-ui): Display live list of queued jobs
- Loading branch information
1 parent
2d78e64
commit bbe5855
Showing
27 changed files
with
672 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 0 additions & 20 deletions
20
packages/admin-ui/src/lib/core/src/components/job-list/job-list.component.html
This file was deleted.
Oops, something went wrong.
35 changes: 0 additions & 35 deletions
35
packages/admin-ui/src/lib/core/src/components/job-list/job-list.component.ts
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
packages/admin-ui/src/lib/core/src/components/job-queue-link/job-queue-link.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<a | ||
type="button" | ||
class="btn btn-link btn-sm job-button" | ||
[class.active]="activeJobCount > 0" | ||
[routerLink]="['/settings/jobs']" | ||
> | ||
<ng-container *ngIf="activeJobCount; else noJobs"> | ||
<clr-icon shape="hourglass" class="has-badge"></clr-icon> | ||
{{ 'common.jobs-in-progress' | translate: { count: activeJobCount } }} | ||
</ng-container> | ||
<ng-template #noJobs> | ||
<clr-icon shape="hourglass"></clr-icon> | ||
{{ 'nav.job-queue' | translate }} | ||
</ng-template> | ||
</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,9 @@ | |
|
||
:host { | ||
position: fixed; | ||
bottom: 12px; | ||
left: 12px; | ||
display: block; | ||
bottom: 0; | ||
left: 0; | ||
z-index: 5; | ||
} | ||
|
||
|
33 changes: 33 additions & 0 deletions
33
packages/admin-ui/src/lib/core/src/components/job-queue-link/job-queue-link.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core'; | ||
import { Subscription } from 'rxjs'; | ||
import { map } from 'rxjs/operators'; | ||
|
||
import { JobQueueService } from '../../providers/job-queue/job-queue.service'; | ||
|
||
@Component({ | ||
selector: 'vdr-job-link', | ||
templateUrl: './job-queue-link.component.html', | ||
styleUrls: ['./job-queue-link.component.scss'], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class JobQueueLinkComponent implements OnInit, OnDestroy { | ||
activeJobCount: number; | ||
private subscription: Subscription; | ||
|
||
constructor(private jobQueueService: JobQueueService, private changeDetectorRef: ChangeDetectorRef) {} | ||
|
||
ngOnInit() { | ||
this.subscription = this.jobQueueService.activeJobs$ | ||
.pipe(map((jobs) => jobs.length)) | ||
.subscribe((value) => { | ||
this.activeJobCount = value; | ||
this.changeDetectorRef.markForCheck(); | ||
}); | ||
} | ||
|
||
ngOnDestroy(): void { | ||
if (this.subscription) { | ||
this.subscription.unsubscribe(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.