X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Badmin%2Fsystem%2Fjobs%2Fjobs.component.ts;h=d5da1b743a835f4f4fe4abf2f4b3534c117fc074;hb=b1934b7e9cdece7c0c38e05b0f905dc2ccab9167;hp=b1940b0d38138a0fc60827fd0768808a74f7acf0;hpb=a11a782f5c142f88acff8b604224cefeb8417cf1;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/+admin/system/jobs/jobs.component.ts b/client/src/app/+admin/system/jobs/jobs.component.ts index b1940b0d3..d5da1b743 100644 --- a/client/src/app/+admin/system/jobs/jobs.component.ts +++ b/client/src/app/+admin/system/jobs/jobs.component.ts @@ -22,18 +22,29 @@ export class JobsComponent extends RestTable implements OnInit { jobType: JobTypeClient = 'all' jobTypes: JobTypeClient[] = [ 'all', + + 'activitypub-cleaner', 'activitypub-follow', + 'activitypub-http-broadcast-parallel', 'activitypub-http-broadcast', 'activitypub-http-fetcher', 'activitypub-http-unicast', + 'activitypub-refresher', + 'actor-keys', + 'after-video-channel-import', 'email', - 'video-transcoding', + 'federate-video', + 'manage-video-torrent', + 'move-to-object-storage', + 'notify', + 'video-channel-import', 'video-file-import', 'video-import', - 'videos-views', - 'activitypub-refresher', + 'video-live-ending', 'video-redundancy', - 'video-live-ending' + 'video-studio-edition', + 'video-transcoding', + 'videos-views-stats' ] jobs: Job[] = [] @@ -44,7 +55,7 @@ export class JobsComponent extends RestTable implements OnInit { constructor ( private notifier: Notifier, private jobsService: JobService - ) { + ) { super() } @@ -73,17 +84,42 @@ export class JobsComponent extends RestTable implements OnInit { } getColspan () { - return this.jobState === 'all' ? 5 : 4 + if (this.jobState === 'all' && this.hasGlobalProgress()) return 7 + + if (this.jobState === 'all' || this.hasGlobalProgress()) return 6 + + return 5 } onJobStateOrTypeChanged () { this.pagination.start = 0 - this.loadData() + this.reloadData() this.saveJobStateAndType() } - protected loadData () { + hasGlobalProgress () { + return this.jobType === 'all' || this.jobType === 'video-transcoding' + } + + hasProgress (job: Job) { + return job.type === 'video-transcoding' + } + + getProgress (job: Job) { + if (job.state === 'active') return job.progress + '%' + + return '' + } + + refresh () { + this.jobs = [] + this.totalRecords = 0 + + this.reloadData() + } + + protected reloadData () { let jobState = this.jobState as JobState if (this.jobState === 'all') jobState = null @@ -94,14 +130,14 @@ export class JobsComponent extends RestTable implements OnInit { pagination: this.pagination, sort: this.sort }) - .subscribe( - resultList => { + .subscribe({ + next: resultList => { this.jobs = resultList.data this.totalRecords = resultList.total }, - err => this.notifier.error(err.message) - ) + error: err => this.notifier.error(err.message) + }) } private loadJobStateAndType () {