fixing start stop buttons

This commit is contained in:
Patrik J. Braun 2019-12-29 13:48:45 +01:00
parent 6c458e2dbb
commit c2d7931d8d
4 changed files with 12 additions and 11 deletions

View File

@ -30,12 +30,12 @@
<button class="btn btn-danger job-control-button" (click)="remove(i)"><span class="oi oi-trash"></span> <button class="btn btn-danger job-control-button" (click)="remove(i)"><span class="oi oi-trash"></span>
</button> </button>
<button class="btn btn-success job-control-button" <button class="btn btn-success job-control-button"
*ngIf="!jobsService.progress.value[schedule.jobName]" *ngIf="!getProgress(schedule)"
[disabled]="disableButtons" [disabled]="disableButtons"
(click)="start(schedule); $event.stopPropagation();"><span class="oi oi-media-play"></span> (click)="start(schedule); $event.stopPropagation();"><span class="oi oi-media-play"></span>
</button> </button>
<button class="btn btn-secondary job-control-button" <button class="btn btn-secondary job-control-button"
*ngIf="jobsService.progress.value[schedule.jobName]" *ngIf="getProgress(schedule)"
[disabled]="disableButtons || jobsService.progress.value[schedule.jobName].state !== JobProgressStates.running" [disabled]="disableButtons || jobsService.progress.value[schedule.jobName].state !== JobProgressStates.running"
(click)="stop(schedule); $event.stopPropagation();"><span class="oi oi-media-stop"></span> (click)="stop(schedule); $event.stopPropagation();"><span class="oi oi-media-stop"></span>
</button> </button>
@ -121,14 +121,14 @@
<div class="col-md-3"> <div class="col-md-3">
<button class="btn btn-success float-right" <button class="btn btn-success float-right"
*ngIf="!jobsService.progress.value[schedule.jobName]" *ngIf="!getProgress(schedule)"
[disabled]="disableButtons" [disabled]="disableButtons"
title="Trigger job run manually" title="Trigger job run manually"
i18n-title i18n-title
(click)="start(schedule)" i18n>Start now (click)="start(schedule)" i18n>Start now
</button> </button>
<button class="btn btn-secondary float-right" <button class="btn btn-secondary float-right"
*ngIf="jobsService.progress.value[schedule.jobName]" *ngIf="getProgress(schedule)"
[disabled]="disableButtons || jobsService.progress.value[schedule.jobName].state !== JobProgressStates.running" [disabled]="disableButtons || jobsService.progress.value[schedule.jobName].state !== JobProgressStates.running"
(click)="stop(schedule)" i18n>Stop (click)="stop(schedule)" i18n>Stop
</button> </button>

View File

@ -40,7 +40,7 @@
aria-valuemin="0" aria-valuemin="0"
aria-valuemax="100" aria-valuemax="100"
style="min-width: 2em;" style="min-width: 2em;"
[style.width.%]="(progress.steps.processed+progress.steps.skipped/(progress.steps.all))*100"> [style.width.%]="((progress.steps.processed+progress.steps.skipped)/progress.steps.all)*100">
{{progress.steps.processed}}+{{progress.steps.skipped}}/{{progress.steps.all}} {{progress.steps.processed}}+{{progress.steps.skipped}}/{{progress.steps.all}}
</div> </div>
<div <div

View File

@ -20,8 +20,8 @@ import {JobProgressStates} from '../../../../../common/entities/job/JobProgressD
providers: [ThumbnailSettingsService], providers: [ThumbnailSettingsService],
}) })
export class ThumbnailSettingsComponent export class ThumbnailSettingsComponent
extends SettingsComponent<{ server: ServerConfig.ThumbnailConfig, client: ClientConfig.ThumbnailConfig }> extends SettingsComponent<{ server: ServerConfig.ThumbnailConfig, client: ClientConfig.ThumbnailConfig }>
implements OnInit { implements OnInit {
JobProgressStates = JobProgressStates; JobProgressStates = JobProgressStates;
constructor(_authService: AuthenticationService, constructor(_authService: AuthenticationService,
@ -44,12 +44,13 @@ export class ThumbnailSettingsComponent
value = value.replace(new RegExp(',', 'g'), ';'); value = value.replace(new RegExp(',', 'g'), ';');
value = value.replace(new RegExp(' ', 'g'), ';'); value = value.replace(new RegExp(' ', 'g'), ';');
this.settings.client.thumbnailSizes = value.split(';') this.settings.client.thumbnailSizes = value.split(';')
.map(s => parseInt(s, 10)) .map(s => parseInt(s, 10))
.filter(i => !isNaN(i) && i > 0); .filter(i => !isNaN(i) && i > 0);
} }
get Progress() { get Progress() {
return this.jobsService.progress.value[JobDTO.getHashName(DefaultsJobs[DefaultsJobs['Thumbnail Generation']])]; return this.jobsService.progress.value[JobDTO.getHashName(DefaultsJobs[DefaultsJobs['Thumbnail Generation']],
{sizes: this.original.client.thumbnailSizes[0]})];
} }
ngOnInit() { ngOnInit() {

View File

@ -84,7 +84,7 @@ export class VideoSettingsComponent extends SettingsComponent<{ server: ServerCo
updateBitRate() { updateBitRate() {
this.settings.server.transcoding.bitRate = this.getRecommendedBitRate(this.settings.server.transcoding.resolution, this.settings.server.transcoding.bitRate = this.getRecommendedBitRate(this.settings.server.transcoding.resolution,
this.settings.server.transcoding.fps); this.settings.server.transcoding.fps);
} }
formatChanged(format: ServerConfig.formatType) { formatChanged(format: ServerConfig.formatType) {