diff options
author | Chocobozzz <me@florianbigard.com> | 2021-02-08 10:51:10 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-02-08 15:38:45 +0100 |
commit | 9129b7694d577322327ee79e9b9aa64deee92765 (patch) | |
tree | eb23b7a952048c3725f29109d38c36368976dec0 /client | |
parent | 81b46cbc3417c46263c210c61b51a84a457abaaa (diff) | |
download | PeerTube-9129b7694d577322327ee79e9b9aa64deee92765.tar.gz PeerTube-9129b7694d577322327ee79e9b9aa64deee92765.tar.zst PeerTube-9129b7694d577322327ee79e9b9aa64deee92765.zip |
Allow to specify transcoding and import jobs concurrency
Diffstat (limited to 'client')
3 files changed, 46 insertions, 0 deletions
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html index 48678a194..5f0a5ff6c 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html | |||
@@ -436,8 +436,25 @@ | |||
436 | <div class="form-group form-group-right col-12 col-lg-8 col-xl-9"> | 436 | <div class="form-group form-group-right col-12 col-lg-8 col-xl-9"> |
437 | 437 | ||
438 | <ng-container formGroupName="import"> | 438 | <ng-container formGroupName="import"> |
439 | |||
439 | <ng-container formGroupName="videos"> | 440 | <ng-container formGroupName="videos"> |
440 | 441 | ||
442 | <div class="form-group mt-4"> | ||
443 | <label i18n for="importConcurrency">Import jobs concurrency</label> | ||
444 | <span class="text-muted ml-1"> | ||
445 | <span i18n>allows to import multiple videos in parallel. ⚠️ Requires a PeerTube restart.</span> | ||
446 | </span> | ||
447 | |||
448 | <div class="peertube-select-container"> | ||
449 | <select id="importConcurrency" formControlName="concurrency" class="form-control"> | ||
450 | <option *ngFor="let option of concurrencyOptions" [value]="option"> | ||
451 | {{ option }} | ||
452 | </option> | ||
453 | </select> | ||
454 | </div> | ||
455 | <div *ngIf="formErrors.import.concurrency" class="form-error">{{ formErrors.import.concurrency }}</div> | ||
456 | </div> | ||
457 | |||
441 | <div class="form-group" formGroupName="http"> | 458 | <div class="form-group" formGroupName="http"> |
442 | <my-peertube-checkbox | 459 | <my-peertube-checkbox |
443 | inputName="importVideosHttpEnabled" formControlName="enabled" | 460 | inputName="importVideosHttpEnabled" formControlName="enabled" |
@@ -886,6 +903,22 @@ | |||
886 | </div> | 903 | </div> |
887 | 904 | ||
888 | <div class="form-group mt-4" [ngClass]="{ 'disabled-checkbox-extra': !isTranscodingEnabled() }"> | 905 | <div class="form-group mt-4" [ngClass]="{ 'disabled-checkbox-extra': !isTranscodingEnabled() }"> |
906 | <label i18n for="transcodingConcurrency">Transcoding jobs concurrency</label> | ||
907 | <span class="text-muted ml-1"> | ||
908 | <span i18n>allows to transcode multiple files in parallel. ⚠️ Requires a PeerTube restart.</span> | ||
909 | </span> | ||
910 | |||
911 | <div class="peertube-select-container"> | ||
912 | <select id="transcodingConcurrency" formControlName="concurrency" class="form-control"> | ||
913 | <option *ngFor="let option of concurrencyOptions" [value]="option"> | ||
914 | {{ option }} | ||
915 | </option> | ||
916 | </select> | ||
917 | </div> | ||
918 | <div *ngIf="formErrors.transcoding.concurrency" class="form-error">{{ formErrors.transcoding.concurrency }}</div> | ||
919 | </div> | ||
920 | |||
921 | <div class="form-group mt-4" [ngClass]="{ 'disabled-checkbox-extra': !isTranscodingEnabled() }"> | ||
889 | <label i18n for="transcodingProfile">Transcoding profile</label> | 922 | <label i18n for="transcodingProfile">Transcoding profile</label> |
890 | <span class="text-muted ml-1" i18n>new transcoding profiles can be added by PeerTube plugins</span> | 923 | <span class="text-muted ml-1" i18n>new transcoding profiles can be added by PeerTube plugins</span> |
891 | 924 | ||
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts index ae6a9e844..48fb86968 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts | |||
@@ -9,6 +9,7 @@ import { | |||
9 | ADMIN_EMAIL_VALIDATOR, | 9 | ADMIN_EMAIL_VALIDATOR, |
10 | CACHE_CAPTIONS_SIZE_VALIDATOR, | 10 | CACHE_CAPTIONS_SIZE_VALIDATOR, |
11 | CACHE_PREVIEWS_SIZE_VALIDATOR, | 11 | CACHE_PREVIEWS_SIZE_VALIDATOR, |
12 | CONCURRENCY_VALIDATOR, | ||
12 | INDEX_URL_VALIDATOR, | 13 | INDEX_URL_VALIDATOR, |
13 | INSTANCE_NAME_VALIDATOR, | 14 | INSTANCE_NAME_VALIDATOR, |
14 | INSTANCE_SHORT_DESCRIPTION_VALIDATOR, | 15 | INSTANCE_SHORT_DESCRIPTION_VALIDATOR, |
@@ -36,6 +37,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A | |||
36 | 37 | ||
37 | resolutions: { id: string, label: string, description?: string }[] = [] | 38 | resolutions: { id: string, label: string, description?: string }[] = [] |
38 | liveResolutions: { id: string, label: string, description?: string }[] = [] | 39 | liveResolutions: { id: string, label: string, description?: string }[] = [] |
40 | concurrencyOptions: number[] = [] | ||
39 | transcodingThreadOptions: { label: string, value: number }[] = [] | 41 | transcodingThreadOptions: { label: string, value: number }[] = [] |
40 | liveMaxDurationOptions: { label: string, value: number }[] = [] | 42 | liveMaxDurationOptions: { label: string, value: number }[] = [] |
41 | 43 | ||
@@ -103,6 +105,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A | |||
103 | { value: 4, label: '4' }, | 105 | { value: 4, label: '4' }, |
104 | { value: 8, label: '8' } | 106 | { value: 8, label: '8' } |
105 | ] | 107 | ] |
108 | this.concurrencyOptions = [ 1, 2, 3, 4, 5, 6 ] | ||
106 | 109 | ||
107 | this.vodTranscodingProfileOptions = [ 'default' ] | 110 | this.vodTranscodingProfileOptions = [ 'default' ] |
108 | this.liveTranscodingProfileOptions = [ 'default' ] | 111 | this.liveTranscodingProfileOptions = [ 'default' ] |
@@ -230,6 +233,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A | |||
230 | }, | 233 | }, |
231 | import: { | 234 | import: { |
232 | videos: { | 235 | videos: { |
236 | concurrency: CONCURRENCY_VALIDATOR, | ||
233 | http: { | 237 | http: { |
234 | enabled: null | 238 | enabled: null |
235 | }, | 239 | }, |
@@ -262,6 +266,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A | |||
262 | allowAdditionalExtensions: null, | 266 | allowAdditionalExtensions: null, |
263 | allowAudioFiles: null, | 267 | allowAudioFiles: null, |
264 | profile: null, | 268 | profile: null, |
269 | concurrency: CONCURRENCY_VALIDATOR, | ||
265 | resolutions: {}, | 270 | resolutions: {}, |
266 | hls: { | 271 | hls: { |
267 | enabled: null | 272 | enabled: null |
diff --git a/client/src/app/shared/form-validators/custom-config-validators.ts b/client/src/app/shared/form-validators/custom-config-validators.ts index 41b3cbba9..23f2156c2 100644 --- a/client/src/app/shared/form-validators/custom-config-validators.ts +++ b/client/src/app/shared/form-validators/custom-config-validators.ts | |||
@@ -65,6 +65,14 @@ export const TRANSCODING_THREADS_VALIDATOR: BuildFormValidator = { | |||
65 | } | 65 | } |
66 | } | 66 | } |
67 | 67 | ||
68 | export const CONCURRENCY_VALIDATOR: BuildFormValidator = { | ||
69 | VALIDATORS: [Validators.required, Validators.min(1)], | ||
70 | MESSAGES: { | ||
71 | 'required': $localize`Concurrency is required.`, | ||
72 | 'min': $localize`Concurrency should be greater or equal to 1.` | ||
73 | } | ||
74 | } | ||
75 | |||
68 | export const INDEX_URL_VALIDATOR: BuildFormValidator = { | 76 | export const INDEX_URL_VALIDATOR: BuildFormValidator = { |
69 | VALIDATORS: [Validators.pattern(/^https:\/\//)], | 77 | VALIDATORS: [Validators.pattern(/^https:\/\//)], |
70 | MESSAGES: { | 78 | MESSAGES: { |