Fix progress display
This commit is contained in:
parent
1740952b8c
commit
e5830ac64b
|
@ -46,7 +46,7 @@
|
|||
<th style="width: 200px" class="job-type" i18n>Type</th>
|
||||
<th style="width: 200px" class="job-priority" i18n>Priority <small>(1 = highest priority)</small></th>
|
||||
<th style="width: 200px" class="job-state" i18n *ngIf="jobState === 'all'">State</th>
|
||||
<th style="width: 100px" class="job-progress" i18n *ngIf="hasProgress()">Progress</th>
|
||||
<th style="width: 100px" class="job-progress" i18n *ngIf="hasGlobalProgress()">Progress</th>
|
||||
<th style="width: 150px" class="job-date" i18n pSortableColumn="createdAt">Created <p-sortIcon field="createdAt"></p-sortIcon></th>
|
||||
</tr>
|
||||
</ng-template>
|
||||
|
@ -65,8 +65,8 @@
|
|||
<span class="badge" [ngClass]="getJobStateClass(job.state)">{{ job.state }}</span>
|
||||
</td>
|
||||
|
||||
<td class="job-progress c-hand" [pRowToggler]="job" *ngIf="hasProgress()">
|
||||
{{ getProgress(job) }}
|
||||
<td class="job-progress c-hand" [pRowToggler]="job">
|
||||
<ng-container *ngIf="hasProgress(job)">{{ getProgress(job) }}</ng-container>
|
||||
</td>
|
||||
|
||||
<td class="job-date c-hand" [pRowToggler]="job">{{ job.createdAt | date: 'short' }}</td>
|
||||
|
|
|
@ -77,9 +77,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
|
||||
}
|
||||
|
@ -91,10 +91,14 @@ export class JobsComponent extends RestTable implements OnInit {
|
|||
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 + '%'
|
||||
|
||||
|
|
Loading…
Reference in New Issue