]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+admin/system/jobs/jobs.component.ts
Safely remove webtorrent files
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / system / jobs / jobs.component.ts
index b1940b0d38138a0fc60827fd0768808a74f7acf0..925450286fba76e82dfc0a15a06342d1697df30c 100644 (file)
@@ -21,19 +21,19 @@ export class JobsComponent extends RestTable implements OnInit {
 
   jobType: JobTypeClient = 'all'
   jobTypes: JobTypeClient[] = [
-    'all',
     'activitypub-follow',
     'activitypub-http-broadcast',
     'activitypub-http-fetcher',
     'activitypub-http-unicast',
+    'activitypub-refresher',
+    'all',
     'email',
-    'video-transcoding',
     'video-file-import',
     'video-import',
-    'videos-views',
-    'activitypub-refresher',
+    'video-live-ending',
     'video-redundancy',
-    'video-live-ending'
+    'video-transcoding',
+    'videos-views'
   ]
 
   jobs: Job[] = []
@@ -73,7 +73,11 @@ export class JobsComponent extends RestTable implements OnInit {
   }
 
   getColspan () {
-    return this.jobState === 'all' ? 5 : 4
+    if (this.jobState === 'all' && this.hasProgress()) return 7
+
+    if (this.jobState === 'all' || this.hasProgress()) return 6
+
+    return 5
   }
 
   onJobStateOrTypeChanged () {
@@ -83,6 +87,16 @@ export class JobsComponent extends RestTable implements OnInit {
     this.saveJobStateAndType()
   }
 
+  hasProgress () {
+    return this.jobType === 'all' || this.jobType === 'video-transcoding'
+  }
+
+  getProgress (job: Job) {
+    if (job.state === 'active') return job.progress + '%'
+
+    return ''
+  }
+
   protected loadData () {
     let jobState = this.jobState as JobState
     if (this.jobState === 'all') jobState = null