]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+admin/system/jobs/job.service.ts
add display of logs matching any state
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / system / jobs / job.service.ts
index 1ac50f050f9f3f39ef5cca0ed965f1d74a7e4f58..4b4a8914fdd5543776351be93853e790ffc5624a 100644 (file)
@@ -19,13 +19,20 @@ export class JobService {
     private restExtractor: RestExtractor
   ) {}
 
-  getJobs (jobState: JobStateClient, jobType: JobTypeClient, pagination: RestPagination, sort: SortMeta): Observable<ResultList<Job>> {
+  getJobs (options: {
+    jobState?: JobStateClient,
+    jobType: JobTypeClient,
+    pagination: RestPagination,
+    sort: SortMeta
+  }): Observable<ResultList<Job>> {
+    const { jobState, jobType, pagination, sort } = options
+
     let params = new HttpParams()
     params = this.restService.addRestGetParams(params, pagination, sort)
 
     if (jobType !== 'all') params = params.append('jobType', jobType)
 
-    return this.authHttp.get<ResultList<Job>>(JobService.BASE_JOB_URL + '/' + jobState, { params })
+    return this.authHttp.get<ResultList<Job>>(JobService.BASE_JOB_URL + `/${jobState ? jobState : ''}`, { params })
                .pipe(
                  map(res => {
                    return this.restExtractor.convertResultListDateToHuman(res, [ 'createdAt', 'processedOn', 'finishedOn' ])