]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+admin/system/jobs/jobs.component.ts
Fix broken player on live reload
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / system / jobs / jobs.component.ts
index 9f5c044064e2888fb60a87f320d11d1fd55d5f0a..d5da1b743a835f4f4fe4abf2f4b3534c117fc074 100644 (file)
@@ -23,19 +23,28 @@ export class JobsComponent extends RestTable implements OnInit {
   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',
+    'federate-video',
+    'manage-video-torrent',
+    'move-to-object-storage',
+    'notify',
+    'video-channel-import',
     'video-file-import',
     'video-import',
     'video-live-ending',
     'video-redundancy',
+    'video-studio-edition',
     'video-transcoding',
-    'videos-views'
+    'videos-views-stats'
   ]
 
   jobs: Job[] = []
@@ -75,9 +84,9 @@ export class JobsComponent extends RestTable implements OnInit {
   }
 
   getColspan () {
-    if (this.jobState === 'all' && this.hasProgress()) return 7
+    if (this.jobState === 'all' && this.hasGlobalProgress()) return 7
 
-    if (this.jobState === 'all' || this.hasProgress()) return 6
+    if (this.jobState === 'all' || this.hasGlobalProgress()) return 6
 
     return 5
   }
@@ -85,14 +94,18 @@ export class JobsComponent extends RestTable implements OnInit {
   onJobStateOrTypeChanged () {
     this.pagination.start = 0
 
-    this.loadData()
+    this.reloadData()
     this.saveJobStateAndType()
   }
 
-  hasProgress () {
+  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 + '%'
 
@@ -103,10 +116,10 @@ export class JobsComponent extends RestTable implements OnInit {
     this.jobs = []
     this.totalRecords = 0
 
-    this.loadData()
+    this.reloadData()
   }
 
-  protected loadData () {
+  protected reloadData () {
     let jobState = this.jobState as JobState
     if (this.jobState === 'all') jobState = null
 
@@ -117,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 () {