Improve remote runner config UX
This commit is contained in:
parent
be61627067
commit
01283e2066
|
@ -61,6 +61,14 @@ export class EditConfigurationService {
|
||||||
return form.value['transcoding']['enabled'] === true
|
return form.value['transcoding']['enabled'] === true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isRemoteRunnerVODEnabled (form: FormGroup) {
|
||||||
|
return form.value['transcoding']['remoteRunners']['enabled'] === true
|
||||||
|
}
|
||||||
|
|
||||||
|
isRemoteRunnerLiveEnabled (form: FormGroup) {
|
||||||
|
return form.value['live']['transcoding']['remoteRunners']['enabled'] === true
|
||||||
|
}
|
||||||
|
|
||||||
isStudioEnabled (form: FormGroup) {
|
isStudioEnabled (form: FormGroup) {
|
||||||
return form.value['videoStudio']['enabled'] === true
|
return form.value['videoStudio']['enabled'] === true
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,10 +110,45 @@
|
||||||
</my-peertube-checkbox>
|
</my-peertube-checkbox>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group" formGroupName="remoteRunners" [ngClass]="getDisabledLiveTranscodingClass()">
|
<div class="callout callout-light pt-2 mt-2 pb-0">
|
||||||
|
<label i18n>Output formats</label>
|
||||||
|
|
||||||
|
<div class="form-group" [ngClass]="getDisabledLiveTranscodingClass()">
|
||||||
|
<label i18n for="liveTranscodingThreads">Live resolutions to generate</label>
|
||||||
|
|
||||||
|
<div class="ms-2 mt-2 d-flex flex-column">
|
||||||
|
|
||||||
|
<ng-container formGroupName="resolutions">
|
||||||
|
<div class="form-group" *ngFor="let resolution of liveResolutions">
|
||||||
|
<my-peertube-checkbox
|
||||||
|
[inputName]="getResolutionKey(resolution.id)" [formControlName]="resolution.id"
|
||||||
|
labelText="{{resolution.label}}"
|
||||||
|
>
|
||||||
|
<ng-template *ngIf="resolution.description" ptTemplate="help">
|
||||||
|
<div [innerHTML]="resolution.description"></div>
|
||||||
|
</ng-template>
|
||||||
|
</my-peertube-checkbox>
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<my-peertube-checkbox
|
||||||
|
inputName="transcodingAlwaysTranscodeOriginalResolution" formControlName="alwaysTranscodeOriginalResolution"
|
||||||
|
i18n-labelText labelText="Also transcode original resolution"
|
||||||
|
>
|
||||||
|
<ng-container i18n ngProjectAs="description">
|
||||||
|
Even if it's above your maximum enabled resolution
|
||||||
|
</ng-container>
|
||||||
|
</my-peertube-checkbox>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group mt-4" formGroupName="remoteRunners" [ngClass]="getDisabledLiveTranscodingClass()">
|
||||||
<my-peertube-checkbox
|
<my-peertube-checkbox
|
||||||
inputName="transcodingRemoteRunnersEnabled" formControlName="enabled"
|
inputName="transcodingRemoteRunnersEnabled" formControlName="enabled"
|
||||||
i18n-labelText labelText="Enable remote runners"
|
i18n-labelText labelText="Enable remote runners for lives"
|
||||||
>
|
>
|
||||||
<ng-container ngProjectAs="description">
|
<ng-container ngProjectAs="description">
|
||||||
<span i18n>
|
<span i18n>
|
||||||
|
@ -124,38 +159,7 @@
|
||||||
</my-peertube-checkbox>
|
</my-peertube-checkbox>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group" [ngClass]="getDisabledLiveTranscodingClass()">
|
<div class="form-group" [ngClass]="getDisabledLiveLocalTranscodingClass()">
|
||||||
<label i18n for="liveTranscodingThreads">Live resolutions to generate</label>
|
|
||||||
|
|
||||||
<div class="ms-2 mt-2 d-flex flex-column">
|
|
||||||
|
|
||||||
<ng-container formGroupName="resolutions">
|
|
||||||
<div class="form-group" *ngFor="let resolution of liveResolutions">
|
|
||||||
<my-peertube-checkbox
|
|
||||||
[inputName]="getResolutionKey(resolution.id)" [formControlName]="resolution.id"
|
|
||||||
labelText="{{resolution.label}}"
|
|
||||||
>
|
|
||||||
<ng-template *ngIf="resolution.description" ptTemplate="help">
|
|
||||||
<div [innerHTML]="resolution.description"></div>
|
|
||||||
</ng-template>
|
|
||||||
</my-peertube-checkbox>
|
|
||||||
</div>
|
|
||||||
</ng-container>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<my-peertube-checkbox
|
|
||||||
inputName="transcodingAlwaysTranscodeOriginalResolution" formControlName="alwaysTranscodeOriginalResolution"
|
|
||||||
i18n-labelText labelText="Also transcode original resolution"
|
|
||||||
>
|
|
||||||
<ng-container i18n ngProjectAs="description">
|
|
||||||
Even if it's above your maximum enabled resolution
|
|
||||||
</ng-container>
|
|
||||||
</my-peertube-checkbox>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group" [ngClass]="getDisabledLiveTranscodingClass()">
|
|
||||||
<label i18n for="liveTranscodingThreads">Live transcoding threads</label>
|
<label i18n for="liveTranscodingThreads">Live transcoding threads</label>
|
||||||
|
|
||||||
<span class="small muted ms-1">
|
<span class="small muted ms-1">
|
||||||
|
@ -177,7 +181,7 @@
|
||||||
<div *ngIf="formErrors.live.transcoding.threads" class="form-error">{{ formErrors.live.transcoding.threads }}</div>
|
<div *ngIf="formErrors.live.transcoding.threads" class="form-error">{{ formErrors.live.transcoding.threads }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group mt-4" [ngClass]="getDisabledLiveTranscodingClass()">
|
<div class="form-group mt-4" [ngClass]="getDisabledLiveLocalTranscodingClass()">
|
||||||
<label i18n for="liveTranscodingProfile">Live transcoding profile</label>
|
<label i18n for="liveTranscodingProfile">Live transcoding profile</label>
|
||||||
<span class="small muted ms-1" i18n>new live transcoding profiles can be added by PeerTube plugins</span>
|
<span class="small muted ms-1" i18n>new live transcoding profiles can be added by PeerTube plugins</span>
|
||||||
|
|
||||||
|
|
|
@ -71,6 +71,10 @@ export class EditLiveConfigurationComponent implements OnInit, OnChanges {
|
||||||
return this.editConfigurationService.isLiveEnabled(this.form)
|
return this.editConfigurationService.isLiveEnabled(this.form)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isRemoteRunnerLiveEnabled () {
|
||||||
|
return this.editConfigurationService.isRemoteRunnerLiveEnabled(this.form)
|
||||||
|
}
|
||||||
|
|
||||||
getDisabledLiveClass () {
|
getDisabledLiveClass () {
|
||||||
return { 'disabled-checkbox-extra': !this.isLiveEnabled() }
|
return { 'disabled-checkbox-extra': !this.isLiveEnabled() }
|
||||||
}
|
}
|
||||||
|
@ -79,6 +83,10 @@ export class EditLiveConfigurationComponent implements OnInit, OnChanges {
|
||||||
return { 'disabled-checkbox-extra': !this.isLiveEnabled() || !this.isLiveTranscodingEnabled() }
|
return { 'disabled-checkbox-extra': !this.isLiveEnabled() || !this.isLiveTranscodingEnabled() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getDisabledLiveLocalTranscodingClass () {
|
||||||
|
return { 'disabled-checkbox-extra': !this.isLiveEnabled() || !this.isLiveTranscodingEnabled() || this.isRemoteRunnerLiveEnabled() }
|
||||||
|
}
|
||||||
|
|
||||||
isLiveTranscodingEnabled () {
|
isLiveTranscodingEnabled () {
|
||||||
return this.editConfigurationService.isLiveTranscodingEnabled(this.form)
|
return this.editConfigurationService.isLiveTranscodingEnabled(this.form)
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,20 +37,6 @@
|
||||||
|
|
||||||
<ng-container ngProjectAs="extra">
|
<ng-container ngProjectAs="extra">
|
||||||
|
|
||||||
<div class="form-group" formGroupName="remoteRunners" [ngClass]="getTranscodingDisabledClass()">
|
|
||||||
<my-peertube-checkbox
|
|
||||||
inputName="transcodingRemoteRunnersEnabled" formControlName="enabled"
|
|
||||||
i18n-labelText labelText="Enable remote runners"
|
|
||||||
>
|
|
||||||
<ng-container ngProjectAs="description">
|
|
||||||
<span i18n>
|
|
||||||
Use <a routerLink="/admin/system/runners/runners-list">remote runners</a> to process VOD transcoding.
|
|
||||||
Remote runners has to register on your instance first.
|
|
||||||
</span>
|
|
||||||
</ng-container>
|
|
||||||
</my-peertube-checkbox>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="callout callout-light pt-2 pb-0">
|
<div class="callout callout-light pt-2 pb-0">
|
||||||
<label i18n>Input formats</label>
|
<label i18n>Input formats</label>
|
||||||
|
|
||||||
|
@ -155,7 +141,21 @@
|
||||||
</my-peertube-checkbox>
|
</my-peertube-checkbox>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group mt-4" [ngClass]="getTranscodingDisabledClass()">
|
<div class="form-group mt-4" formGroupName="remoteRunners" [ngClass]="getTranscodingDisabledClass()">
|
||||||
|
<my-peertube-checkbox
|
||||||
|
inputName="transcodingRemoteRunnersEnabled" formControlName="enabled"
|
||||||
|
i18n-labelText labelText="Enable remote runners for VOD"
|
||||||
|
>
|
||||||
|
<ng-container ngProjectAs="description">
|
||||||
|
<span i18n>
|
||||||
|
Use <a routerLink="/admin/system/runners/runners-list">remote runners</a> to process VOD transcoding.
|
||||||
|
Remote runners has to register on your instance first.
|
||||||
|
</span>
|
||||||
|
</ng-container>
|
||||||
|
</my-peertube-checkbox>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group mt-4" [ngClass]="getLocalTranscodingDisabledClass()">
|
||||||
<label i18n for="transcodingThreads">Transcoding threads</label>
|
<label i18n for="transcodingThreads">Transcoding threads</label>
|
||||||
|
|
||||||
<span class="small muted ms-1">
|
<span class="small muted ms-1">
|
||||||
|
@ -178,7 +178,7 @@
|
||||||
<div *ngIf="formErrors.transcoding.threads" class="form-error">{{ formErrors.transcoding.threads }}</div>
|
<div *ngIf="formErrors.transcoding.threads" class="form-error">{{ formErrors.transcoding.threads }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group" [ngClass]="getTranscodingDisabledClass()">
|
<div class="form-group" [ngClass]="getLocalTranscodingDisabledClass()">
|
||||||
<label i18n for="transcodingConcurrency">Transcoding jobs concurrency</label>
|
<label i18n for="transcodingConcurrency">Transcoding jobs concurrency</label>
|
||||||
<span class="small muted ms-1" i18n>allows to transcode multiple files in parallel. ⚠️ Requires a PeerTube restart</span>
|
<span class="small muted ms-1" i18n>allows to transcode multiple files in parallel. ⚠️ Requires a PeerTube restart</span>
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@
|
||||||
<div *ngIf="formErrors.transcoding.concurrency" class="form-error">{{ formErrors.transcoding.concurrency }}</div>
|
<div *ngIf="formErrors.transcoding.concurrency" class="form-error">{{ formErrors.transcoding.concurrency }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group" [ngClass]="getTranscodingDisabledClass()">
|
<div class="form-group" [ngClass]="getLocalTranscodingDisabledClass()">
|
||||||
<label i18n for="transcodingProfile">Transcoding profile</label>
|
<label i18n for="transcodingProfile">Transcoding profile</label>
|
||||||
<span class="small muted ms-1" i18n>new transcoding profiles can be added by PeerTube plugins</span>
|
<span class="small muted ms-1" i18n>new transcoding profiles can be added by PeerTube plugins</span>
|
||||||
|
|
||||||
|
@ -234,7 +234,7 @@
|
||||||
<div class="form-group" formGroupName="remoteRunners" [ngClass]="getStudioDisabledClass()">
|
<div class="form-group" formGroupName="remoteRunners" [ngClass]="getStudioDisabledClass()">
|
||||||
<my-peertube-checkbox
|
<my-peertube-checkbox
|
||||||
inputName="videoStudioRemoteRunnersEnabled" formControlName="enabled"
|
inputName="videoStudioRemoteRunnersEnabled" formControlName="enabled"
|
||||||
i18n-labelText labelText="Enable remote runners"
|
i18n-labelText labelText="Enable remote runners for studio"
|
||||||
>
|
>
|
||||||
<ng-container ngProjectAs="description">
|
<ng-container ngProjectAs="description">
|
||||||
<span i18n>
|
<span i18n>
|
||||||
|
|
|
@ -58,6 +58,10 @@ export class EditVODTranscodingComponent implements OnInit, OnChanges {
|
||||||
return 'transcoding.resolutions.' + resolution
|
return 'transcoding.resolutions.' + resolution
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isRemoteRunnerVODEnabled () {
|
||||||
|
return this.editConfigurationService.isRemoteRunnerVODEnabled(this.form)
|
||||||
|
}
|
||||||
|
|
||||||
isTranscodingEnabled () {
|
isTranscodingEnabled () {
|
||||||
return this.editConfigurationService.isTranscodingEnabled(this.form)
|
return this.editConfigurationService.isTranscodingEnabled(this.form)
|
||||||
}
|
}
|
||||||
|
@ -70,6 +74,10 @@ export class EditVODTranscodingComponent implements OnInit, OnChanges {
|
||||||
return { 'disabled-checkbox-extra': !this.isTranscodingEnabled() }
|
return { 'disabled-checkbox-extra': !this.isTranscodingEnabled() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getLocalTranscodingDisabledClass () {
|
||||||
|
return { 'disabled-checkbox-extra': !this.isTranscodingEnabled() || this.isRemoteRunnerVODEnabled() }
|
||||||
|
}
|
||||||
|
|
||||||
getStudioDisabledClass () {
|
getStudioDisabledClass () {
|
||||||
return { 'disabled-checkbox-extra': !this.isStudioEnabled() }
|
return { 'disabled-checkbox-extra': !this.isStudioEnabled() }
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ describe('Test upload quota', function () {
|
||||||
describe('When having a video quota', function () {
|
describe('When having a video quota', function () {
|
||||||
|
|
||||||
it('Should fail with a registered user having too many videos with legacy upload', async function () {
|
it('Should fail with a registered user having too many videos with legacy upload', async function () {
|
||||||
this.timeout(30000)
|
this.timeout(120000)
|
||||||
|
|
||||||
const user = { username: 'registered' + randomInt(1, 1500), password: 'password' }
|
const user = { username: 'registered' + randomInt(1, 1500), password: 'password' }
|
||||||
await server.registrations.register(user)
|
await server.registrations.register(user)
|
||||||
|
|
|
@ -31,7 +31,7 @@ describe('Test video comments API validator', function () {
|
||||||
// ---------------------------------------------------------------
|
// ---------------------------------------------------------------
|
||||||
|
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(120000)
|
||||||
|
|
||||||
server = await createSingleServer(1)
|
server = await createSingleServer(1)
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ describe('Test video comments', function () {
|
||||||
let command: CommentsCommand
|
let command: CommentsCommand
|
||||||
|
|
||||||
before(async function () {
|
before(async function () {
|
||||||
this.timeout(30000)
|
this.timeout(120000)
|
||||||
|
|
||||||
server = await createSingleServer(1)
|
server = await createSingleServer(1)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue