diff options
author | Chocobozzz <me@florianbigard.com> | 2021-02-10 11:27:36 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-02-10 11:36:40 +0100 |
commit | 70e335158499b0ac9e6da2193219d87512759876 (patch) | |
tree | a46c8f5a19592f93afc3a48996e55bfaa362f2ed | |
parent | 5f46d28ccac4a20fcbb12c96a047a84a08e485ae (diff) | |
download | PeerTube-70e335158499b0ac9e6da2193219d87512759876.tar.gz PeerTube-70e335158499b0ac9e6da2193219d87512759876.tar.zst PeerTube-70e335158499b0ac9e6da2193219d87512759876.zip |
Small edit config refactor
9 files changed, 136 insertions, 61 deletions
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-advanced-configuration.component.html b/client/src/app/+admin/config/edit-custom-config/edit-advanced-configuration.component.html index db3036c4e..6018ff5e0 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-advanced-configuration.component.html +++ b/client/src/app/+admin/config/edit-custom-config/edit-advanced-configuration.component.html | |||
@@ -13,25 +13,29 @@ | |||
13 | <ng-container formGroupName="cache"> | 13 | <ng-container formGroupName="cache"> |
14 | <div class="form-group" formGroupName="previews"> | 14 | <div class="form-group" formGroupName="previews"> |
15 | <label i18n for="cachePreviewsSize">Number of previews to keep in cache</label> | 15 | <label i18n for="cachePreviewsSize">Number of previews to keep in cache</label> |
16 | |||
16 | <div class="number-with-unit"> | 17 | <div class="number-with-unit"> |
17 | <input | 18 | <input |
18 | type="number" min="0" id="cachePreviewsSize" class="form-control" | 19 | type="number" min="0" id="cachePreviewsSize" class="form-control" |
19 | formControlName="size" [ngClass]="{ 'input-error': formErrors['cache.previews.size'] }" | 20 | formControlName="size" [ngClass]="{ 'input-error': formErrors['cache.previews.size'] }" |
20 | > | 21 | > |
21 | <span i18n>{form.value['cache']['previews']['size'], plural, =1 {cached image} other {cached images}}</span> | 22 | <span i18n>{getCacheSize('previews'), plural, =1 {cached image} other {cached images}}</span> |
22 | </div> | 23 | </div> |
24 | |||
23 | <div *ngIf="formErrors.cache.previews.size" class="form-error">{{ formErrors.cache.previews.size }}</div> | 25 | <div *ngIf="formErrors.cache.previews.size" class="form-error">{{ formErrors.cache.previews.size }}</div> |
24 | </div> | 26 | </div> |
25 | 27 | ||
26 | <div class="form-group" formGroupName="captions"> | 28 | <div class="form-group" formGroupName="captions"> |
27 | <label i18n for="cacheCaptionsSize">Number of video captions to keep in cache</label> | 29 | <label i18n for="cacheCaptionsSize">Number of video captions to keep in cache</label> |
30 | |||
28 | <div class="number-with-unit"> | 31 | <div class="number-with-unit"> |
29 | <input | 32 | <input |
30 | type="number" min="0" id="cacheCaptionsSize" class="form-control" | 33 | type="number" min="0" id="cacheCaptionsSize" class="form-control" |
31 | formControlName="size" [ngClass]="{ 'input-error': formErrors['cache.captions.size'] }" | 34 | formControlName="size" [ngClass]="{ 'input-error': formErrors['cache.captions.size'] }" |
32 | > | 35 | > |
33 | <span i18n>{form.value['cache']['captions']['size'], plural, =1 {cached image} other {cached images}}</span> | 36 | <span i18n>{getCacheSize('captions'), plural, =1 {cached caption} other {cached captions}}</span> |
34 | </div> | 37 | </div> |
38 | |||
35 | <div *ngIf="formErrors.cache.captions.size" class="form-error">{{ formErrors.cache.captions.size }}</div> | 39 | <div *ngIf="formErrors.cache.captions.size" class="form-error">{{ formErrors.cache.captions.size }}</div> |
36 | </div> | 40 | </div> |
37 | </ng-container> | 41 | </ng-container> |
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-advanced-configuration.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-advanced-configuration.component.ts index a37b7b7d5..934438a50 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-advanced-configuration.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-advanced-configuration.component.ts | |||
@@ -11,4 +11,8 @@ import { FormGroup } from '@angular/forms' | |||
11 | export class EditAdvancedConfigurationComponent { | 11 | export class EditAdvancedConfigurationComponent { |
12 | @Input() form: FormGroup | 12 | @Input() form: FormGroup |
13 | @Input() formErrors: any | 13 | @Input() formErrors: any |
14 | |||
15 | getCacheSize (type: 'captions' | 'previews') { | ||
16 | return this.form.value['cache'][type]['size'] | ||
17 | } | ||
14 | } | 18 | } |
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.html b/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.html index ac1a11b4d..21a719d42 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.html +++ b/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.html | |||
@@ -25,6 +25,7 @@ | |||
25 | 25 | ||
26 | <div class="form-group" formGroupName="instance"> | 26 | <div class="form-group" formGroupName="instance"> |
27 | <label i18n for="instanceDefaultClientRoute">Landing page</label> | 27 | <label i18n for="instanceDefaultClientRoute">Landing page</label> |
28 | |||
28 | <div class="peertube-select-container"> | 29 | <div class="peertube-select-container"> |
29 | <select id="instanceDefaultClientRoute" formControlName="defaultClientRoute" class="form-control"> | 30 | <select id="instanceDefaultClientRoute" formControlName="defaultClientRoute" class="form-control"> |
30 | <option i18n value="/videos/overview">Discover videos</option> | 31 | <option i18n value="/videos/overview">Discover videos</option> |
@@ -41,6 +42,7 @@ | |||
41 | <option i18n value="/videos/local">Local videos</option> | 42 | <option i18n value="/videos/local">Local videos</option> |
42 | </select> | 43 | </select> |
43 | </div> | 44 | </div> |
45 | |||
44 | <div *ngIf="formErrors.instance.defaultClientRoute" class="form-error">{{ formErrors.instance.defaultClientRoute }}</div> | 46 | <div *ngIf="formErrors.instance.defaultClientRoute" class="form-error">{{ formErrors.instance.defaultClientRoute }}</div> |
45 | </div> | 47 | </div> |
46 | 48 | ||
@@ -48,6 +50,7 @@ | |||
48 | <ng-container formGroupName="videos"> | 50 | <ng-container formGroupName="videos"> |
49 | <ng-container formGroupName="algorithms"> | 51 | <ng-container formGroupName="algorithms"> |
50 | <label i18n for="trendingVideosAlgorithmsDefault">Default trending page</label> | 52 | <label i18n for="trendingVideosAlgorithmsDefault">Default trending page</label> |
53 | |||
51 | <div class="peertube-select-container"> | 54 | <div class="peertube-select-container"> |
52 | <select id="trendingVideosAlgorithmsDefault" formControlName="default" class="form-control"> | 55 | <select id="trendingVideosAlgorithmsDefault" formControlName="default" class="form-control"> |
53 | <option i18n value="best">Best videos</option> | 56 | <option i18n value="best">Best videos</option> |
@@ -56,6 +59,7 @@ | |||
56 | <option i18n value="most-liked">Most liked videos</option> | 59 | <option i18n value="most-liked">Most liked videos</option> |
57 | </select> | 60 | </select> |
58 | </div> | 61 | </div> |
62 | |||
59 | <div *ngIf="formErrors.trending.videos.algorithms.default" class="form-error">{{ formErrors.trending.videos.algorithms.default }}</div> | 63 | <div *ngIf="formErrors.trending.videos.algorithms.default" class="form-error">{{ formErrors.trending.videos.algorithms.default }}</div> |
60 | </ng-container> | 64 | </ng-container> |
61 | </ng-container> | 65 | </ng-container> |
@@ -92,6 +96,7 @@ | |||
92 | 96 | ||
93 | <div class="form-group"> | 97 | <div class="form-group"> |
94 | <label i18n for="broadcastMessageLevel">Broadcast message level</label> | 98 | <label i18n for="broadcastMessageLevel">Broadcast message level</label> |
99 | |||
95 | <div class="peertube-select-container"> | 100 | <div class="peertube-select-container"> |
96 | <select id="broadcastMessageLevel" formControlName="level" class="form-control"> | 101 | <select id="broadcastMessageLevel" formControlName="level" class="form-control"> |
97 | <option value="info">info</option> | 102 | <option value="info">info</option> |
@@ -99,15 +104,18 @@ | |||
99 | <option value="error">error</option> | 104 | <option value="error">error</option> |
100 | </select> | 105 | </select> |
101 | </div> | 106 | </div> |
107 | |||
102 | <div *ngIf="formErrors.broadcastMessage.level" class="form-error">{{ formErrors.broadcastMessage.level }}</div> | 108 | <div *ngIf="formErrors.broadcastMessage.level" class="form-error">{{ formErrors.broadcastMessage.level }}</div> |
103 | </div> | 109 | </div> |
104 | 110 | ||
105 | <div class="form-group"> | 111 | <div class="form-group"> |
106 | <label i18n for="broadcastMessageMessage">Message</label><my-help helpType="markdownText"></my-help> | 112 | <label i18n for="broadcastMessageMessage">Message</label><my-help helpType="markdownText"></my-help> |
113 | |||
107 | <my-markdown-textarea | 114 | <my-markdown-textarea |
108 | name="broadcastMessageMessage" formControlName="message" textareaMaxWidth="500px" | 115 | name="broadcastMessageMessage" formControlName="message" textareaMaxWidth="500px" |
109 | [classes]="{ 'input-error': formErrors['broadcastMessage.message'] }" | 116 | [classes]="{ 'input-error': formErrors['broadcastMessage.message'] }" |
110 | ></my-markdown-textarea> | 117 | ></my-markdown-textarea> |
118 | |||
111 | <div *ngIf="formErrors.broadcastMessage.message" class="form-error">{{ formErrors.broadcastMessage.message }}</div> | 119 | <div *ngIf="formErrors.broadcastMessage.message" class="form-error">{{ formErrors.broadcastMessage.message }}</div> |
112 | </div> | 120 | </div> |
113 | 121 | ||
@@ -139,13 +147,14 @@ | |||
139 | </ng-container> | 147 | </ng-container> |
140 | 148 | ||
141 | <ng-container ngProjectAs="extra"> | 149 | <ng-container ngProjectAs="extra"> |
142 | <my-peertube-checkbox [ngClass]="{ 'disabled-checkbox-extra': !isSignupEnabled() }" | 150 | <my-peertube-checkbox [ngClass]="getDisabledSignupClass()" |
143 | inputName="signupRequiresEmailVerification" formControlName="requiresEmailVerification" | 151 | inputName="signupRequiresEmailVerification" formControlName="requiresEmailVerification" |
144 | i18n-labelText labelText="Signup requires email verification" | 152 | i18n-labelText labelText="Signup requires email verification" |
145 | ></my-peertube-checkbox> | 153 | ></my-peertube-checkbox> |
146 | 154 | ||
147 | <div [ngClass]="{ 'disabled-checkbox-extra': !isSignupEnabled() }" class="mt-3"> | 155 | <div [ngClass]="getDisabledSignupClass()" class="mt-3"> |
148 | <label i18n for="signupLimit">Signup limit</label> | 156 | <label i18n for="signupLimit">Signup limit</label> |
157 | |||
149 | <div class="number-with-unit"> | 158 | <div class="number-with-unit"> |
150 | <input | 159 | <input |
151 | type="number" min="-1" id="signupLimit" class="form-control" | 160 | type="number" min="-1" id="signupLimit" class="form-control" |
@@ -153,8 +162,10 @@ | |||
153 | > | 162 | > |
154 | <span i18n>{form.value['signup']['limit'], plural, =1 {user} other {users}}</span> | 163 | <span i18n>{form.value['signup']['limit'], plural, =1 {user} other {users}}</span> |
155 | </div> | 164 | </div> |
165 | |||
156 | <div *ngIf="formErrors.signup.limit" class="form-error">{{ formErrors.signup.limit }}</div> | 166 | <div *ngIf="formErrors.signup.limit" class="form-error">{{ formErrors.signup.limit }}</div> |
157 | <small *ngIf="form.value['signup']['limit'] === -1" class="text-muted">Signup won't be limited to a fixed number of users.</small> | 167 | |
168 | <small i18n *ngIf="hasUnlimitedSignup()" class="text-muted">Signup won't be limited to a fixed number of users.</small> | ||
158 | </div> | 169 | </div> |
159 | </ng-container> | 170 | </ng-container> |
160 | </my-peertube-checkbox> | 171 | </my-peertube-checkbox> |
@@ -207,9 +218,7 @@ | |||
207 | 218 | ||
208 | <div class="form-group mt-4"> | 219 | <div class="form-group mt-4"> |
209 | <label i18n for="importConcurrency">Import jobs concurrency</label> | 220 | <label i18n for="importConcurrency">Import jobs concurrency</label> |
210 | <span class="text-muted ml-1"> | 221 | <span i18n class="text-muted ml-1">allows to import multiple videos in parallel. ⚠️ Requires a PeerTube restart.</span> |
211 | <span i18n>allows to import multiple videos in parallel. ⚠️ Requires a PeerTube restart.</span> | ||
212 | </span> | ||
213 | 222 | ||
214 | <div class="number-with-unit"> | 223 | <div class="number-with-unit"> |
215 | <input type="number" name="importConcurrency" formControlName="concurrency" /> | 224 | <input type="number" name="importConcurrency" formControlName="concurrency" /> |
@@ -307,24 +316,26 @@ | |||
307 | </ng-container> | 316 | </ng-container> |
308 | 317 | ||
309 | <ng-container ngProjectAs="extra"> | 318 | <ng-container ngProjectAs="extra"> |
310 | <div [ngClass]="{ 'disabled-checkbox-extra': !isSearchIndexEnabled() }"> | 319 | <div [ngClass]="getDisabledSearchIndexClass()"> |
311 | <label i18n for="searchIndexUrl">Search index URL</label> | 320 | <label i18n for="searchIndexUrl">Search index URL</label> |
321 | |||
312 | <input | 322 | <input |
313 | type="text" id="searchIndexUrl" class="form-control" | 323 | type="text" id="searchIndexUrl" class="form-control" |
314 | formControlName="url" [ngClass]="{ 'input-error': formErrors['search.searchIndex.url'] }" | 324 | formControlName="url" [ngClass]="{ 'input-error': formErrors['search.searchIndex.url'] }" |
315 | > | 325 | > |
326 | |||
316 | <div *ngIf="formErrors.search.searchIndex.url" class="form-error">{{ formErrors.search.searchIndex.url }}</div> | 327 | <div *ngIf="formErrors.search.searchIndex.url" class="form-error">{{ formErrors.search.searchIndex.url }}</div> |
317 | </div> | 328 | </div> |
318 | 329 | ||
319 | <div class="mt-3"> | 330 | <div class="mt-3"> |
320 | <my-peertube-checkbox [ngClass]="{ 'disabled-checkbox-extra': !isSearchIndexEnabled() }" | 331 | <my-peertube-checkbox [ngClass]="getDisabledSearchIndexClass()" |
321 | inputName="searchIndexDisableLocalSearch" formControlName="disableLocalSearch" | 332 | inputName="searchIndexDisableLocalSearch" formControlName="disableLocalSearch" |
322 | i18n-labelText labelText="Disable local search in search bar" | 333 | i18n-labelText labelText="Disable local search in search bar" |
323 | ></my-peertube-checkbox> | 334 | ></my-peertube-checkbox> |
324 | </div> | 335 | </div> |
325 | 336 | ||
326 | <div class="mt-3"> | 337 | <div class="mt-3"> |
327 | <my-peertube-checkbox [ngClass]="{ 'disabled-checkbox-extra': !isSearchIndexEnabled() }" | 338 | <my-peertube-checkbox [ngClass]="getDisabledSearchIndexClass()" |
328 | inputName="searchIndexIsDefaultSearch" formControlName="isDefaultSearch" | 339 | inputName="searchIndexIsDefaultSearch" formControlName="isDefaultSearch" |
329 | i18n-labelText labelText="Search bar uses the global search index by default" | 340 | i18n-labelText labelText="Search bar uses the global search index by default" |
330 | > | 341 | > |
@@ -433,10 +444,12 @@ | |||
433 | 444 | ||
434 | <div class="form-group" formGroupName="admin"> | 445 | <div class="form-group" formGroupName="admin"> |
435 | <label i18n for="adminEmail">Admin email</label> | 446 | <label i18n for="adminEmail">Admin email</label> |
447 | |||
436 | <input | 448 | <input |
437 | type="text" id="adminEmail" class="form-control" | 449 | type="text" id="adminEmail" class="form-control" |
438 | formControlName="email" [ngClass]="{ 'input-error': formErrors['admin.email'] }" | 450 | formControlName="email" [ngClass]="{ 'input-error': formErrors['admin.email'] }" |
439 | > | 451 | > |
452 | |||
440 | <div *ngIf="formErrors.admin.email" class="form-error">{{ formErrors.admin.email }}</div> | 453 | <div *ngIf="formErrors.admin.email" class="form-error">{{ formErrors.admin.email }}</div> |
441 | </div> | 454 | </div> |
442 | 455 | ||
@@ -471,6 +484,7 @@ | |||
471 | type="text" id="servicesTwitterUsername" class="form-control" | 484 | type="text" id="servicesTwitterUsername" class="form-control" |
472 | formControlName="username" [ngClass]="{ 'input-error': formErrors['services.twitter.username'] }" | 485 | formControlName="username" [ngClass]="{ 'input-error': formErrors['services.twitter.username'] }" |
473 | > | 486 | > |
487 | |||
474 | <div *ngIf="formErrors.services.twitter.username" class="form-error">{{ formErrors.services.twitter.username }}</div> | 488 | <div *ngIf="formErrors.services.twitter.username" class="form-error">{{ formErrors.services.twitter.username }}</div> |
475 | </div> | 489 | </div> |
476 | 490 | ||
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.ts index 9a19c2913..34d05f9f3 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.ts | |||
@@ -50,10 +50,22 @@ export class EditBasicConfigurationComponent implements OnInit { | |||
50 | return this.form.value['signup']['enabled'] === true | 50 | return this.form.value['signup']['enabled'] === true |
51 | } | 51 | } |
52 | 52 | ||
53 | getDisabledSignupClass () { | ||
54 | return { 'disabled-checkbox-extra': !this.isSignupEnabled() } | ||
55 | } | ||
56 | |||
57 | hasUnlimitedSignup () { | ||
58 | return this.form.value['signup']['limit'] === -1 | ||
59 | } | ||
60 | |||
53 | isSearchIndexEnabled () { | 61 | isSearchIndexEnabled () { |
54 | return this.form.value['search']['searchIndex']['enabled'] === true | 62 | return this.form.value['search']['searchIndex']['enabled'] === true |
55 | } | 63 | } |
56 | 64 | ||
65 | getDisabledSearchIndexClass () { | ||
66 | return { 'disabled-checkbox-extra': !this.isSearchIndexEnabled() } | ||
67 | } | ||
68 | |||
57 | isAutoFollowIndexEnabled () { | 69 | isAutoFollowIndexEnabled () { |
58 | return this.form.value['followings']['instance']['autoFollowIndex']['enabled'] === true | 70 | return this.form.value['followings']['instance']['autoFollowIndex']['enabled'] === true |
59 | } | 71 | } |
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-instance-information.component.html b/client/src/app/+admin/config/edit-custom-config/edit-instance-information.component.html index 6f19ede0a..35b42e742 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-instance-information.component.html +++ b/client/src/app/+admin/config/edit-custom-config/edit-instance-information.component.html | |||
@@ -11,28 +11,34 @@ | |||
11 | 11 | ||
12 | <div class="form-group"> | 12 | <div class="form-group"> |
13 | <label i18n for="instanceName">Name</label> | 13 | <label i18n for="instanceName">Name</label> |
14 | |||
14 | <input | 15 | <input |
15 | type="text" id="instanceName" class="form-control" | 16 | type="text" id="instanceName" class="form-control" |
16 | formControlName="name" [ngClass]="{ 'input-error': formErrors.instance.name }" | 17 | formControlName="name" [ngClass]="{ 'input-error': formErrors.instance.name }" |
17 | > | 18 | > |
19 | |||
18 | <div *ngIf="formErrors.instance.name" class="form-error">{{ formErrors.instance.name }}</div> | 20 | <div *ngIf="formErrors.instance.name" class="form-error">{{ formErrors.instance.name }}</div> |
19 | </div> | 21 | </div> |
20 | 22 | ||
21 | <div class="form-group"> | 23 | <div class="form-group"> |
22 | <label i18n for="instanceShortDescription">Short description</label> | 24 | <label i18n for="instanceShortDescription">Short description</label> |
25 | |||
23 | <textarea | 26 | <textarea |
24 | id="instanceShortDescription" formControlName="shortDescription" class="form-control small" | 27 | id="instanceShortDescription" formControlName="shortDescription" class="form-control small" |
25 | [ngClass]="{ 'input-error': formErrors['instance.shortDescription'] }" | 28 | [ngClass]="{ 'input-error': formErrors['instance.shortDescription'] }" |
26 | ></textarea> | 29 | ></textarea> |
30 | |||
27 | <div *ngIf="formErrors.instance.shortDescription" class="form-error">{{ formErrors.instance.shortDescription }}</div> | 31 | <div *ngIf="formErrors.instance.shortDescription" class="form-error">{{ formErrors.instance.shortDescription }}</div> |
28 | </div> | 32 | </div> |
29 | 33 | ||
30 | <div class="form-group"> | 34 | <div class="form-group"> |
31 | <label i18n for="instanceDescription">Description</label><my-help helpType="markdownText"></my-help> | 35 | <label i18n for="instanceDescription">Description</label><my-help helpType="markdownText"></my-help> |
36 | |||
32 | <my-markdown-textarea | 37 | <my-markdown-textarea |
33 | name="instanceDescription" formControlName="description" textareaMaxWidth="500px" | 38 | name="instanceDescription" formControlName="description" textareaMaxWidth="500px" |
34 | [classes]="{ 'input-error': formErrors['instance.description'] }" | 39 | [classes]="{ 'input-error': formErrors['instance.description'] }" |
35 | ></my-markdown-textarea> | 40 | ></my-markdown-textarea> |
41 | |||
36 | <div *ngIf="formErrors.instance.description" class="form-error">{{ formErrors.instance.description }}</div> | 42 | <div *ngIf="formErrors.instance.description" class="form-error">{{ formErrors.instance.description }}</div> |
37 | </div> | 43 | </div> |
38 | 44 | ||
@@ -111,24 +117,29 @@ | |||
111 | <option i18n value="display">Display</option> | 117 | <option i18n value="display">Display</option> |
112 | </select> | 118 | </select> |
113 | </div> | 119 | </div> |
120 | |||
114 | <div *ngIf="formErrors.instance.defaultNSFWPolicy" class="form-error">{{ formErrors.instance.defaultNSFWPolicy }}</div> | 121 | <div *ngIf="formErrors.instance.defaultNSFWPolicy" class="form-error">{{ formErrors.instance.defaultNSFWPolicy }}</div> |
115 | </div> | 122 | </div> |
116 | 123 | ||
117 | <div class="form-group"> | 124 | <div class="form-group"> |
118 | <label i18n for="instanceTerms">Terms</label><my-help helpType="markdownText"></my-help> | 125 | <label i18n for="instanceTerms">Terms</label><my-help helpType="markdownText"></my-help> |
126 | |||
119 | <my-markdown-textarea | 127 | <my-markdown-textarea |
120 | name="instanceTerms" formControlName="terms" textareaMaxWidth="500px" | 128 | name="instanceTerms" formControlName="terms" textareaMaxWidth="500px" |
121 | [ngClass]="{ 'input-error': formErrors['instance.terms'] }" | 129 | [ngClass]="{ 'input-error': formErrors['instance.terms'] }" |
122 | ></my-markdown-textarea> | 130 | ></my-markdown-textarea> |
131 | |||
123 | <div *ngIf="formErrors.instance.terms" class="form-error">{{ formErrors.instance.terms }}</div> | 132 | <div *ngIf="formErrors.instance.terms" class="form-error">{{ formErrors.instance.terms }}</div> |
124 | </div> | 133 | </div> |
125 | 134 | ||
126 | <div class="form-group"> | 135 | <div class="form-group"> |
127 | <label i18n for="instanceCodeOfConduct">Code of conduct</label><my-help helpType="markdownText"></my-help> | 136 | <label i18n for="instanceCodeOfConduct">Code of conduct</label><my-help helpType="markdownText"></my-help> |
137 | |||
128 | <my-markdown-textarea | 138 | <my-markdown-textarea |
129 | name="instanceCodeOfConduct" formControlName="codeOfConduct" textareaMaxWidth="500px" | 139 | name="instanceCodeOfConduct" formControlName="codeOfConduct" textareaMaxWidth="500px" |
130 | [ngClass]="{ 'input-error': formErrors['instance.codeOfConduct'] }" | 140 | [ngClass]="{ 'input-error': formErrors['instance.codeOfConduct'] }" |
131 | ></my-markdown-textarea> | 141 | ></my-markdown-textarea> |
142 | |||
132 | <div *ngIf="formErrors.instance.codeOfConduct" class="form-error">{{ formErrors.instance.codeOfConduct }}</div> | 143 | <div *ngIf="formErrors.instance.codeOfConduct" class="form-error">{{ formErrors.instance.codeOfConduct }}</div> |
133 | </div> | 144 | </div> |
134 | 145 | ||
@@ -140,6 +151,7 @@ | |||
140 | name="instanceModerationInformation" formControlName="moderationInformation" textareaMaxWidth="500px" | 151 | name="instanceModerationInformation" formControlName="moderationInformation" textareaMaxWidth="500px" |
141 | [ngClass]="{ 'input-error': formErrors['instance.moderationInformation'] }" | 152 | [ngClass]="{ 'input-error': formErrors['instance.moderationInformation'] }" |
142 | ></my-markdown-textarea> | 153 | ></my-markdown-textarea> |
154 | |||
143 | <div *ngIf="formErrors.instance.moderationInformation" class="form-error">{{ formErrors.instance.moderationInformation }}</div> | 155 | <div *ngIf="formErrors.instance.moderationInformation" class="form-error">{{ formErrors.instance.moderationInformation }}</div> |
144 | </div> | 156 | </div> |
145 | 157 | ||
@@ -173,6 +185,7 @@ | |||
173 | name="instanceCreationReason" formControlName="creationReason" textareaMaxWidth="500px" | 185 | name="instanceCreationReason" formControlName="creationReason" textareaMaxWidth="500px" |
174 | [ngClass]="{ 'input-error': formErrors['instance.creationReason'] }" | 186 | [ngClass]="{ 'input-error': formErrors['instance.creationReason'] }" |
175 | ></my-markdown-textarea> | 187 | ></my-markdown-textarea> |
188 | |||
176 | <div *ngIf="formErrors.instance.creationReason" class="form-error">{{ formErrors.instance.creationReason }}</div> | 189 | <div *ngIf="formErrors.instance.creationReason" class="form-error">{{ formErrors.instance.creationReason }}</div> |
177 | </div> | 190 | </div> |
178 | 191 | ||
@@ -184,6 +197,7 @@ | |||
184 | name="instanceMaintenanceLifetime" formControlName="maintenanceLifetime" textareaMaxWidth="500px" | 197 | name="instanceMaintenanceLifetime" formControlName="maintenanceLifetime" textareaMaxWidth="500px" |
185 | [ngClass]="{ 'input-error': formErrors['instance.maintenanceLifetime'] }" | 198 | [ngClass]="{ 'input-error': formErrors['instance.maintenanceLifetime'] }" |
186 | ></my-markdown-textarea> | 199 | ></my-markdown-textarea> |
200 | |||
187 | <div *ngIf="formErrors.instance.maintenanceLifetime" class="form-error">{{ formErrors.instance.maintenanceLifetime }}</div> | 201 | <div *ngIf="formErrors.instance.maintenanceLifetime" class="form-error">{{ formErrors.instance.maintenanceLifetime }}</div> |
188 | </div> | 202 | </div> |
189 | 203 | ||
@@ -195,6 +209,7 @@ | |||
195 | name="instanceBusinessModel" formControlName="businessModel" textareaMaxWidth="500px" | 209 | name="instanceBusinessModel" formControlName="businessModel" textareaMaxWidth="500px" |
196 | [ngClass]="{ 'input-error': formErrors['instance.businessModel'] }" | 210 | [ngClass]="{ 'input-error': formErrors['instance.businessModel'] }" |
197 | ></my-markdown-textarea> | 211 | ></my-markdown-textarea> |
212 | |||
198 | <div *ngIf="formErrors.instance.businessModel" class="form-error">{{ formErrors.instance.businessModel }}</div> | 213 | <div *ngIf="formErrors.instance.businessModel" class="form-error">{{ formErrors.instance.businessModel }}</div> |
199 | </div> | 214 | </div> |
200 | 215 | ||
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 4b1a55245..65fc31412 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 | |||
@@ -25,7 +25,7 @@ | |||
25 | 25 | ||
26 | <ng-container ngProjectAs="extra"> | 26 | <ng-container ngProjectAs="extra"> |
27 | 27 | ||
28 | <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isLiveEnabled() }"> | 28 | <div class="form-group" [ngClass]="getDisabledLiveClass()"> |
29 | <my-peertube-checkbox | 29 | <my-peertube-checkbox |
30 | inputName="liveAllowReplay" formControlName="allowReplay" | 30 | inputName="liveAllowReplay" formControlName="allowReplay" |
31 | i18n-labelText labelText="Allow your users to automatically publish a replay of their live" | 31 | i18n-labelText labelText="Allow your users to automatically publish a replay of their live" |
@@ -36,23 +36,29 @@ | |||
36 | </my-peertube-checkbox> | 36 | </my-peertube-checkbox> |
37 | </div> | 37 | </div> |
38 | 38 | ||
39 | <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isLiveEnabled() }"> | 39 | <div class="form-group" [ngClass]="getDisabledLiveClass()"> |
40 | <label i18n for="liveMaxInstanceLives">Max simultaneous lives created on your instance <span class="text-muted">(-1 for "unlimited")</span></label> | 40 | <label i18n for="liveMaxInstanceLives"> |
41 | Max simultaneous lives created on your instance <span class="text-muted">(-1 for "unlimited")</span> | ||
42 | </label> | ||
43 | |||
41 | <div class="number-with-unit"> | 44 | <div class="number-with-unit"> |
42 | <input type="number" name="liveMaxInstanceLives" formControlName="maxInstanceLives" /> | 45 | <input type="number" name="liveMaxInstanceLives" formControlName="maxInstanceLives" /> |
43 | <span i18n>{form.value['live']['maxInstanceLives'], plural, =1 {live} other {lives}}</span> | 46 | <span i18n>{form.value['live']['maxInstanceLives'], plural, =1 {live} other {lives}}</span> |
44 | </div> | 47 | </div> |
45 | </div> | 48 | </div> |
46 | 49 | ||
47 | <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isLiveEnabled() }"> | 50 | <div class="form-group" [ngClass]="getDisabledLiveClass()"> |
48 | <label i18n for="liveMaxUserLives">Max simultaneous lives created per user <span class="text-muted">(-1 for "unlimited")</span></label> | 51 | <label i18n for="liveMaxUserLives"> |
52 | Max simultaneous lives created per user <span class="text-muted">(-1 for "unlimited")</span> | ||
53 | </label> | ||
54 | |||
49 | <div class="number-with-unit"> | 55 | <div class="number-with-unit"> |
50 | <input type="number" name="liveMaxUserLives" formControlName="maxUserLives" /> | 56 | <input type="number" name="liveMaxUserLives" formControlName="maxUserLives" /> |
51 | <span i18n>{form.value['live']['maxUserLives'], plural, =1 {live} other {lives}}</span> | 57 | <span i18n>{form.value['live']['maxUserLives'], plural, =1 {live} other {lives}}</span> |
52 | </div> | 58 | </div> |
53 | </div> | 59 | </div> |
54 | 60 | ||
55 | <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isLiveEnabled() }"> | 61 | <div class="form-group" [ngClass]="getDisabledLiveClass()"> |
56 | <label i18n for="liveMaxDuration">Max live duration</label> | 62 | <label i18n for="liveMaxDuration">Max live duration</label> |
57 | 63 | ||
58 | <my-select-options | 64 | <my-select-options |
@@ -81,7 +87,7 @@ | |||
81 | <ng-container formGroupName="live"> | 87 | <ng-container formGroupName="live"> |
82 | <ng-container formGroupName="transcoding"> | 88 | <ng-container formGroupName="transcoding"> |
83 | 89 | ||
84 | <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isLiveEnabled() }"> | 90 | <div class="form-group" [ngClass]="getDisabledLiveClass()"> |
85 | <my-peertube-checkbox | 91 | <my-peertube-checkbox |
86 | inputName="liveTranscodingEnabled" formControlName="enabled" | 92 | inputName="liveTranscodingEnabled" formControlName="enabled" |
87 | > | 93 | > |
@@ -91,11 +97,12 @@ | |||
91 | </my-peertube-checkbox> | 97 | </my-peertube-checkbox> |
92 | </div> | 98 | </div> |
93 | 99 | ||
94 | <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isLiveEnabled() || !isLiveTranscodingEnabled() }"> | 100 | <div class="form-group" [ngClass]="getDisabledLiveTranscodingClass()"> |
95 | <label i18n for="liveTranscodingThreads">Live resolutions to generate</label> | 101 | <label i18n for="liveTranscodingThreads">Live resolutions to generate</label> |
96 | 102 | ||
97 | <div class="ml-2 mt-2 d-flex flex-column"> | 103 | <div class="ml-2 mt-2 d-flex flex-column"> |
98 | <ng-container formGroupName="resolutions"> | 104 | <ng-container formGroupName="resolutions"> |
105 | |||
99 | <div class="form-group" *ngFor="let resolution of liveResolutions"> | 106 | <div class="form-group" *ngFor="let resolution of liveResolutions"> |
100 | <my-peertube-checkbox | 107 | <my-peertube-checkbox |
101 | [inputName]="getResolutionKey(resolution.id)" [formControlName]="resolution.id" | 108 | [inputName]="getResolutionKey(resolution.id)" [formControlName]="resolution.id" |
@@ -106,15 +113,22 @@ | |||
106 | </ng-template> | 113 | </ng-template> |
107 | </my-peertube-checkbox> | 114 | </my-peertube-checkbox> |
108 | </div> | 115 | </div> |
116 | |||
109 | </ng-container> | 117 | </ng-container> |
110 | </div> | 118 | </div> |
111 | </div> | 119 | </div> |
112 | 120 | ||
113 | <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isLiveEnabled() || !isLiveTranscodingEnabled() }"> | 121 | <div class="form-group" [ngClass]="getDisabledLiveTranscodingClass()"> |
114 | <label i18n for="liveTranscodingThreads">Live transcoding threads</label> | 122 | <label i18n for="liveTranscodingThreads">Live transcoding threads</label> |
123 | |||
115 | <span class="text-muted ml-1"> | 124 | <span class="text-muted ml-1"> |
116 | <ng-container *ngIf="getTotalTranscodingThreads().atMost" i18n>will claim at most {{ getTotalTranscodingThreads().value }} {{ getTotalTranscodingThreads().unit }} with VOD transcoding</ng-container> | 125 | <ng-container *ngIf="getTotalTranscodingThreads().atMost" i18n> |
117 | <ng-container *ngIf="!getTotalTranscodingThreads().atMost" i18n>will claim at least {{ getTotalTranscodingThreads().value }} {{ getTotalTranscodingThreads().unit }} with VOD transcoding</ng-container> | 126 | will claim at most {{ getTotalTranscodingThreads().value }} {{ getTotalTranscodingThreads().unit }} with VOD transcoding |
127 | </ng-container> | ||
128 | |||
129 | <ng-container *ngIf="!getTotalTranscodingThreads().atMost" i18n> | ||
130 | will claim at least {{ getTotalTranscodingThreads().value }} {{ getTotalTranscodingThreads().unit }} with VOD transcoding | ||
131 | </ng-container> | ||
118 | </span> | 132 | </span> |
119 | 133 | ||
120 | <my-select-custom-value | 134 | <my-select-custom-value |
@@ -126,7 +140,7 @@ | |||
126 | <div *ngIf="formErrors.live.transcoding.threads" class="form-error">{{ formErrors.live.transcoding.threads }}</div> | 140 | <div *ngIf="formErrors.live.transcoding.threads" class="form-error">{{ formErrors.live.transcoding.threads }}</div> |
127 | </div> | 141 | </div> |
128 | 142 | ||
129 | <div class="form-group mt-4" [ngClass]="{ 'disabled-checkbox-extra': !isLiveEnabled() || !isLiveTranscodingEnabled() }"> | 143 | <div class="form-group mt-4" [ngClass]="getDisabledLiveTranscodingClass()"> |
130 | <label i18n for="liveTranscodingProfile">Live transcoding profile</label> | 144 | <label i18n for="liveTranscodingProfile">Live transcoding profile</label> |
131 | <span class="text-muted ml-1" i18n>new live transcoding profiles can be added by PeerTube plugins</span> | 145 | <span class="text-muted ml-1" i18n>new live transcoding profiles can be added by PeerTube plugins</span> |
132 | 146 | ||
@@ -136,14 +150,8 @@ | |||
136 | [items]="getAvailableTranscodingProfile()" | 150 | [items]="getAvailableTranscodingProfile()" |
137 | [clearable]="false" | 151 | [clearable]="false" |
138 | > | 152 | > |
139 | <ng-template ng-option-tmp let-item="item" let-index="index"> | ||
140 | {{ item }} | ||
141 | <ng-container *ngIf="item === 'default'"> | ||
142 | <br> | ||
143 | <span class="text-muted" i18n>x264, targeting maximum device compatibility</span> | ||
144 | </ng-container> | ||
145 | </ng-template> | ||
146 | </my-select-options> | 153 | </my-select-options> |
154 | |||
147 | <div *ngIf="formErrors.live.transcoding.profile" class="form-error">{{ formErrors.live.transcoding.profile }}</div> | 155 | <div *ngIf="formErrors.live.transcoding.profile" class="form-error">{{ formErrors.live.transcoding.profile }}</div> |
148 | </div> | 156 | </div> |
149 | 157 | ||
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 a82a40a84..3328d28a9 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 | |||
@@ -42,7 +42,13 @@ export class EditLiveConfigurationComponent implements OnInit { | |||
42 | getAvailableTranscodingProfile () { | 42 | getAvailableTranscodingProfile () { |
43 | const profiles = this.serverConfig.live.transcoding.availableProfiles | 43 | const profiles = this.serverConfig.live.transcoding.availableProfiles |
44 | 44 | ||
45 | return profiles.map(p => ({ id: p, label: p })) | 45 | return profiles.map(p => { |
46 | const description = p === 'default' | ||
47 | ? $localize`x264, targeting maximum device compatibility` | ||
48 | : '' | ||
49 | |||
50 | return { id: p, label: p, description } | ||
51 | }) | ||
46 | } | 52 | } |
47 | 53 | ||
48 | getResolutionKey (resolution: string) { | 54 | getResolutionKey (resolution: string) { |
@@ -57,6 +63,14 @@ export class EditLiveConfigurationComponent implements OnInit { | |||
57 | return this.editConfigurationService.isLiveEnabled(this.form) | 63 | return this.editConfigurationService.isLiveEnabled(this.form) |
58 | } | 64 | } |
59 | 65 | ||
66 | getDisabledLiveClass () { | ||
67 | return { 'disabled-checkbox-extra': !this.isLiveEnabled() } | ||
68 | } | ||
69 | |||
70 | getDisabledLiveTranscodingClass () { | ||
71 | return { 'disabled-checkbox-extra': !this.isLiveEnabled() || !this.isLiveTranscodingEnabled() } | ||
72 | } | ||
73 | |||
60 | isLiveTranscodingEnabled () { | 74 | isLiveTranscodingEnabled () { |
61 | return this.editConfigurationService.isLiveTranscodingEnabled(this.form) | 75 | return this.editConfigurationService.isLiveTranscodingEnabled(this.form) |
62 | } | 76 | } |
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 a51909865..5669b81ce 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 | |||
@@ -13,7 +13,9 @@ | |||
13 | </span> | 13 | </span> |
14 | 14 | ||
15 | <div class="callout-container"> | 15 | <div class="callout-container"> |
16 | <a class="callout-link" target="_blank" rel="noopener noreferrer" href="https://docs.joinpeertube.org/#/admin-configuration?id=transcoding" i18n>Read guidelines</a> | 16 | <a class="callout-link" target="_blank" rel="noopener noreferrer" href="https://docs.joinpeertube.org/#/admin-configuration?id=transcoding" i18n> |
17 | Read guidelines | ||
18 | </a> | ||
17 | </div> | 19 | </div> |
18 | </div> | 20 | </div> |
19 | </div> | 21 | </div> |
@@ -43,7 +45,7 @@ | |||
43 | <div class="callout callout-light pt-2 pb-0"> | 45 | <div class="callout callout-light pt-2 pb-0"> |
44 | <label i18n>Input formats</label> | 46 | <label i18n>Input formats</label> |
45 | 47 | ||
46 | <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isTranscodingEnabled() }"> | 48 | <div class="form-group" [ngClass]="getTranscodingDisabledClass()"> |
47 | <my-peertube-checkbox | 49 | <my-peertube-checkbox |
48 | inputName="transcodingAllowAdditionalExtensions" formControlName="allowAdditionalExtensions" | 50 | inputName="transcodingAllowAdditionalExtensions" formControlName="allowAdditionalExtensions" |
49 | i18n-labelText labelText="Allow additional extensions" | 51 | i18n-labelText labelText="Allow additional extensions" |
@@ -54,7 +56,7 @@ | |||
54 | </my-peertube-checkbox> | 56 | </my-peertube-checkbox> |
55 | </div> | 57 | </div> |
56 | 58 | ||
57 | <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isTranscodingEnabled() }"> | 59 | <div class="form-group" [ngClass]="getTranscodingDisabledClass()"> |
58 | <my-peertube-checkbox | 60 | <my-peertube-checkbox |
59 | inputName="transcodingAllowAudioFiles" formControlName="allowAudioFiles" | 61 | inputName="transcodingAllowAudioFiles" formControlName="allowAudioFiles" |
60 | i18n-labelText labelText="Allow audio files upload" | 62 | i18n-labelText labelText="Allow audio files upload" |
@@ -71,18 +73,14 @@ | |||
71 | <label i18n>Output formats</label> | 73 | <label i18n>Output formats</label> |
72 | 74 | ||
73 | <ng-container formGroupName="webtorrent"> | 75 | <ng-container formGroupName="webtorrent"> |
74 | <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isTranscodingEnabled() }"> | 76 | <div class="form-group" [ngClass]="getTranscodingDisabledClass()"> |
75 | <my-peertube-checkbox | 77 | <my-peertube-checkbox |
76 | inputName="transcodingWebTorrentEnabled" formControlName="enabled" | 78 | inputName="transcodingWebTorrentEnabled" formControlName="enabled" |
77 | i18n-labelText labelText="WebTorrent enabled" | 79 | i18n-labelText labelText="WebTorrent enabled" |
78 | > | 80 | > |
79 | <ng-template ptTemplate="help"> | 81 | <ng-template ptTemplate="help"> |
80 | <ng-container i18n> | 82 | <ng-container> |
81 | <p>If you also enabled HLS support, it will multiply videos storage by 2</p> | 83 | <p i18n>If you also enabled HLS support, it will multiply videos storage by 2</p> |
82 | |||
83 | <br /> | ||
84 | |||
85 | <strong>If disabled, breaks federation with PeerTube instances < 2.1</strong> | ||
86 | </ng-container> | 84 | </ng-container> |
87 | </ng-template> | 85 | </ng-template> |
88 | </my-peertube-checkbox> | 86 | </my-peertube-checkbox> |
@@ -90,7 +88,7 @@ | |||
90 | </ng-container> | 88 | </ng-container> |
91 | 89 | ||
92 | <ng-container formGroupName="hls"> | 90 | <ng-container formGroupName="hls"> |
93 | <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isTranscodingEnabled() }"> | 91 | <div class="form-group" [ngClass]="getTranscodingDisabledClass()"> |
94 | <my-peertube-checkbox | 92 | <my-peertube-checkbox |
95 | inputName="transcodingHlsEnabled" formControlName="enabled" | 93 | inputName="transcodingHlsEnabled" formControlName="enabled" |
96 | i18n-labelText labelText="HLS with P2P support enabled" | 94 | i18n-labelText labelText="HLS with P2P support enabled" |
@@ -114,7 +112,7 @@ | |||
114 | </div> | 112 | </div> |
115 | </ng-container> | 113 | </ng-container> |
116 | 114 | ||
117 | <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isTranscodingEnabled() }"> | 115 | <div class="form-group" [ngClass]="getTranscodingDisabledClass()"> |
118 | <label i18n>Resolutions to generate per enabled format</label> | 116 | <label i18n>Resolutions to generate per enabled format</label> |
119 | 117 | ||
120 | <div class="ml-2 mt-2 d-flex flex-column"> | 118 | <div class="ml-2 mt-2 d-flex flex-column"> |
@@ -142,11 +140,16 @@ | |||
142 | </my-peertube-checkbox> | 140 | </my-peertube-checkbox> |
143 | </div> | 141 | </div> |
144 | 142 | ||
145 | <div class="form-group mt-4" [ngClass]="{ 'disabled-checkbox-extra': !isTranscodingEnabled() }"> | 143 | <div class="form-group mt-4" [ngClass]="getTranscodingDisabledClass()"> |
146 | <label i18n for="transcodingThreads">Transcoding threads</label> | 144 | <label i18n for="transcodingThreads">Transcoding threads</label> |
147 | <span class="text-muted ml-1"> | 145 | <span class="text-muted ml-1"> |
148 | <ng-container *ngIf="getTotalTranscodingThreads().atMost" i18n>will claim at most {{ getTotalTranscodingThreads().value }} {{ getTotalTranscodingThreads().unit }} with live transcoding</ng-container> | 146 | <ng-container *ngIf="getTotalTranscodingThreads().atMost" i18n> |
149 | <ng-container *ngIf="!getTotalTranscodingThreads().atMost" i18n>will claim at least {{ getTotalTranscodingThreads().value }} {{ getTotalTranscodingThreads().unit }} with live transcoding</ng-container> | 147 | will claim at most {{ getTotalTranscodingThreads().value }} {{ getTotalTranscodingThreads().unit }} with live transcoding |
148 | </ng-container> | ||
149 | |||
150 | <ng-container *ngIf="!getTotalTranscodingThreads().atMost" i18n> | ||
151 | will claim at least {{ getTotalTranscodingThreads().value }} {{ getTotalTranscodingThreads().unit }} with live transcoding | ||
152 | </ng-container> | ||
150 | </span> | 153 | </span> |
151 | 154 | ||
152 | <my-select-custom-value | 155 | <my-select-custom-value |
@@ -159,11 +162,9 @@ | |||
159 | <div *ngIf="formErrors.transcoding.threads" class="form-error">{{ formErrors.transcoding.threads }}</div> | 162 | <div *ngIf="formErrors.transcoding.threads" class="form-error">{{ formErrors.transcoding.threads }}</div> |
160 | </div> | 163 | </div> |
161 | 164 | ||
162 | <div class="form-group mt-4" [ngClass]="{ 'disabled-checkbox-extra': !isTranscodingEnabled() }"> | 165 | <div class="form-group mt-4" [ngClass]="getTranscodingDisabledClass()"> |
163 | <label i18n for="transcodingConcurrency">Transcoding jobs concurrency</label> | 166 | <label i18n for="transcodingConcurrency">Transcoding jobs concurrency</label> |
164 | <span class="text-muted ml-1"> | 167 | <span class="text-muted ml-1" i18n>allows to transcode multiple files in parallel. ⚠️ Requires a PeerTube restart</span> |
165 | <span i18n>allows to transcode multiple files in parallel. ⚠️ Requires a PeerTube restart.</span> | ||
166 | </span> | ||
167 | 168 | ||
168 | <div class="number-with-unit"> | 169 | <div class="number-with-unit"> |
169 | <input type="number" name="transcodingConcurrency" formControlName="concurrency" /> | 170 | <input type="number" name="transcodingConcurrency" formControlName="concurrency" /> |
@@ -173,7 +174,7 @@ | |||
173 | <div *ngIf="formErrors.transcoding.concurrency" class="form-error">{{ formErrors.transcoding.concurrency }}</div> | 174 | <div *ngIf="formErrors.transcoding.concurrency" class="form-error">{{ formErrors.transcoding.concurrency }}</div> |
174 | </div> | 175 | </div> |
175 | 176 | ||
176 | <div class="form-group mt-4" [ngClass]="{ 'disabled-checkbox-extra': !isTranscodingEnabled() }"> | 177 | <div class="form-group mt-4" [ngClass]="getTranscodingDisabledClass()"> |
177 | <label i18n for="transcodingProfile">Transcoding profile</label> | 178 | <label i18n for="transcodingProfile">Transcoding profile</label> |
178 | <span class="text-muted ml-1" i18n>new transcoding profiles can be added by PeerTube plugins</span> | 179 | <span class="text-muted ml-1" i18n>new transcoding profiles can be added by PeerTube plugins</span> |
179 | 180 | ||
@@ -182,15 +183,8 @@ | |||
182 | formControlName="profile" | 183 | formControlName="profile" |
183 | [items]="getAvailableTranscodingProfile()" | 184 | [items]="getAvailableTranscodingProfile()" |
184 | [clearable]="false" | 185 | [clearable]="false" |
185 | > | 186 | ></my-select-options> |
186 | <ng-template ng-option-tmp let-item="item" let-index="index"> | 187 | |
187 | {{ item }} | ||
188 | <ng-container *ngIf="item === 'default'"> | ||
189 | <br> | ||
190 | <span class="text-muted" i18n>x264, targeting maximum device compatibility</span> | ||
191 | </ng-container> | ||
192 | </ng-template> | ||
193 | </my-select-options> | ||
194 | <div *ngIf="formErrors.transcoding.profile" class="form-error">{{ formErrors.transcoding.profile }}</div> | 188 | <div *ngIf="formErrors.transcoding.profile" class="form-error">{{ formErrors.transcoding.profile }}</div> |
195 | </div> | 189 | </div> |
196 | 190 | ||
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 d745912a0..b864f1bc4 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 | |||
@@ -34,7 +34,13 @@ export class EditVODTranscodingComponent implements OnInit { | |||
34 | getAvailableTranscodingProfile () { | 34 | getAvailableTranscodingProfile () { |
35 | const profiles = this.serverConfig.transcoding.availableProfiles | 35 | const profiles = this.serverConfig.transcoding.availableProfiles |
36 | 36 | ||
37 | return profiles.map(p => ({ id: p, label: p })) | 37 | return profiles.map(p => { |
38 | const description = p === 'default' | ||
39 | ? $localize`x264, targeting maximum device compatibility` | ||
40 | : '' | ||
41 | |||
42 | return { id: p, label: p, description } | ||
43 | }) | ||
38 | } | 44 | } |
39 | 45 | ||
40 | getResolutionKey (resolution: string) { | 46 | getResolutionKey (resolution: string) { |
@@ -45,6 +51,10 @@ export class EditVODTranscodingComponent implements OnInit { | |||
45 | return this.editConfigurationService.isTranscodingEnabled(this.form) | 51 | return this.editConfigurationService.isTranscodingEnabled(this.form) |
46 | } | 52 | } |
47 | 53 | ||
54 | getTranscodingDisabledClass () { | ||
55 | return { 'disabled-checkbox-extra': !this.isTranscodingEnabled() } | ||
56 | } | ||
57 | |||
48 | getTotalTranscodingThreads () { | 58 | getTotalTranscodingThreads () { |
49 | return this.editConfigurationService.getTotalTranscodingThreads(this.form) | 59 | return this.editConfigurationService.getTotalTranscodingThreads(this.form) |
50 | } | 60 | } |