From 01283e2066314aaa167a2b0b55952b2ae26e650a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 19 May 2023 14:05:14 +0200 Subject: [PATCH] Improve remote runner config UX --- .../edit-configuration.service.ts | 8 ++ .../edit-live-configuration.component.html | 74 ++++++++++--------- .../edit-live-configuration.component.ts | 8 ++ .../edit-vod-transcoding.component.html | 36 ++++----- .../edit-vod-transcoding.component.ts | 8 ++ server/tests/api/check-params/upload-quota.ts | 2 +- .../tests/api/check-params/video-comments.ts | 2 +- server/tests/api/videos/video-comments.ts | 2 +- 8 files changed, 84 insertions(+), 56 deletions(-) diff --git a/client/src/app/+admin/config/edit-custom-config/edit-configuration.service.ts b/client/src/app/+admin/config/edit-custom-config/edit-configuration.service.ts index 6c431ce64..628c2d102 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-configuration.service.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-configuration.service.ts @@ -61,6 +61,14 @@ export class EditConfigurationService { 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) { return form.value['videoStudio']['enabled'] === true } diff --git a/client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.html b/client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.html index 34ce8efa6..e9919741f 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.html +++ b/client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.html @@ -110,10 +110,45 @@ -
+
+ + +
+ + +
+ + +
+ + +
+
+
+
+
+ +
+ + + Even if it's above your maximum enabled resolution + + +
+
+
+
+ +
@@ -124,38 +159,7 @@
-
- - -
- - -
- - -
-
-
-
-
- -
- - - Even if it's above your maximum enabled resolution - - -
-
-
- -
+
@@ -177,7 +181,7 @@
{{ formErrors.live.transcoding.threads }}
-
+
new live transcoding profiles can be added by PeerTube plugins diff --git a/client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.ts index d4892a571..50b882cb8 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.ts @@ -71,6 +71,10 @@ export class EditLiveConfigurationComponent implements OnInit, OnChanges { return this.editConfigurationService.isLiveEnabled(this.form) } + isRemoteRunnerLiveEnabled () { + return this.editConfigurationService.isRemoteRunnerLiveEnabled(this.form) + } + getDisabledLiveClass () { return { 'disabled-checkbox-extra': !this.isLiveEnabled() } } @@ -79,6 +83,10 @@ export class EditLiveConfigurationComponent implements OnInit, OnChanges { return { 'disabled-checkbox-extra': !this.isLiveEnabled() || !this.isLiveTranscodingEnabled() } } + getDisabledLiveLocalTranscodingClass () { + return { 'disabled-checkbox-extra': !this.isLiveEnabled() || !this.isLiveTranscodingEnabled() || this.isRemoteRunnerLiveEnabled() } + } + isLiveTranscodingEnabled () { return this.editConfigurationService.isLiveTranscodingEnabled(this.form) } diff --git a/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.html b/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.html index b17c51532..d3fc2e481 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.html +++ b/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.html @@ -37,20 +37,6 @@ -
- - - - Use remote runners to process VOD transcoding. - Remote runners has to register on your instance first. - - - -
-
@@ -155,7 +141,21 @@
-
+
+ + + + Use remote runners to process VOD transcoding. + Remote runners has to register on your instance first. + + + +
+ +
@@ -178,7 +178,7 @@
{{ formErrors.transcoding.threads }}
-
+
allows to transcode multiple files in parallel. ⚠️ Requires a PeerTube restart @@ -190,7 +190,7 @@
{{ formErrors.transcoding.concurrency }}
-
+
new transcoding profiles can be added by PeerTube plugins @@ -234,7 +234,7 @@
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.ts index e960533f9..0a1ebe8e2 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.ts @@ -58,6 +58,10 @@ export class EditVODTranscodingComponent implements OnInit, OnChanges { return 'transcoding.resolutions.' + resolution } + isRemoteRunnerVODEnabled () { + return this.editConfigurationService.isRemoteRunnerVODEnabled(this.form) + } + isTranscodingEnabled () { return this.editConfigurationService.isTranscodingEnabled(this.form) } @@ -70,6 +74,10 @@ export class EditVODTranscodingComponent implements OnInit, OnChanges { return { 'disabled-checkbox-extra': !this.isTranscodingEnabled() } } + getLocalTranscodingDisabledClass () { + return { 'disabled-checkbox-extra': !this.isTranscodingEnabled() || this.isRemoteRunnerVODEnabled() } + } + getStudioDisabledClass () { return { 'disabled-checkbox-extra': !this.isStudioEnabled() } } diff --git a/server/tests/api/check-params/upload-quota.ts b/server/tests/api/check-params/upload-quota.ts index fdc711bd5..008537524 100644 --- a/server/tests/api/check-params/upload-quota.ts +++ b/server/tests/api/check-params/upload-quota.ts @@ -39,7 +39,7 @@ describe('Test upload 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 () { - this.timeout(30000) + this.timeout(120000) const user = { username: 'registered' + randomInt(1, 1500), password: 'password' } await server.registrations.register(user) diff --git a/server/tests/api/check-params/video-comments.ts b/server/tests/api/check-params/video-comments.ts index 550198844..9f497c0cf 100644 --- a/server/tests/api/check-params/video-comments.ts +++ b/server/tests/api/check-params/video-comments.ts @@ -31,7 +31,7 @@ describe('Test video comments API validator', function () { // --------------------------------------------------------------- before(async function () { - this.timeout(30000) + this.timeout(120000) server = await createSingleServer(1) diff --git a/server/tests/api/videos/video-comments.ts b/server/tests/api/videos/video-comments.ts index e35500b0b..b7d5624a6 100644 --- a/server/tests/api/videos/video-comments.ts +++ b/server/tests/api/videos/video-comments.ts @@ -24,7 +24,7 @@ describe('Test video comments', function () { let command: CommentsCommand before(async function () { - this.timeout(30000) + this.timeout(120000) server = await createSingleServer(1) -- 2.41.0