aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin
diff options
context:
space:
mode:
authorFlorian CUNY <poslovitch@bentobox.world>2021-10-26 16:42:10 +0200
committerGitHub <noreply@github.com>2021-10-26 16:42:10 +0200
commit754b6f5f41bdc40aaaeefdb3c351666c305abe20 (patch)
treed36c8081f3137f1e2c9763879f71d41aa9a3efc1 /client/src/app/+admin
parent615836dbd4f48fc563551446529fa9d3b14dc329 (diff)
downloadPeerTube-754b6f5f41bdc40aaaeefdb3c351666c305abe20.tar.gz
PeerTube-754b6f5f41bdc40aaaeefdb3c351666c305abe20.tar.zst
PeerTube-754b6f5f41bdc40aaaeefdb3c351666c305abe20.zip
Made the video channels limit (per user) server-wide configurable (#4491)
* Made the video channels limit (per user) server-wide configurable Implements https://github.com/Chocobozzz/PeerTube/issues/3092 Also added a "quota bar" in the account's settings page * Fixed lint errors * Another pass at fixing lint errors * Applied code suggestions * Removed 'video channels quota'
Diffstat (limited to 'client/src/app/+admin')
-rw-r--r--client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.html22
-rw-r--r--client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts6
2 files changed, 27 insertions, 1 deletions
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 537e06d4d..318c8e2c2 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
@@ -272,6 +272,28 @@
272 </div> 272 </div>
273 </div> 273 </div>
274 274
275 <div class="form-row mt-4"> <!-- video channels grid -->
276 <div class="form-group col-12 col-lg-4 col-xl-3">
277 <div i18n class="inner-form-title">VIDEO CHANNELS</div>
278 </div>
279
280 <div class="form-group form-group-right col-12 col-lg-8 col-xl-9">
281 <div class="form-group" formGroupName="videoChannels">
282 <label i18n for="videoChannelsMaxPerUser">Max video channels per user</label>
283
284 <div class="number-with-unit">
285 <input
286 type="number" min="1" id="videoChannelsMaxPerUser" class="form-control"
287 formControlName="maxPerUser" [ngClass]="{ 'input-error': formErrors['videoChannels.maxPerUser'] }"
288 >
289 <span i18n>{form.value['videoChannels']['maxPerUser'], plural, =1 {channel} other {channels}}</span>
290 </div>
291
292 <div *ngIf="formErrors.videoChannels.maxPerUser" class="form-error">{{ formErrors.videoChannels.maxPerUser }}</div>
293 </div>
294 </div>
295 </div>
296
275 <div class="form-row mt-4"> <!-- search grid --> 297 <div class="form-row mt-4"> <!-- search grid -->
276 <div class="form-group col-12 col-lg-4 col-xl-3"> 298 <div class="form-group col-12 col-lg-4 col-xl-3">
277 <div i18n class="inner-form-title">SEARCH</div> 299 <div i18n class="inner-form-title">SEARCH</div>
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 96c67fac7..fdb0a7532 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
@@ -22,7 +22,8 @@ import {
22 SERVICES_TWITTER_USERNAME_VALIDATOR, 22 SERVICES_TWITTER_USERNAME_VALIDATOR,
23 SIGNUP_LIMIT_VALIDATOR, 23 SIGNUP_LIMIT_VALIDATOR,
24 SIGNUP_MINIMUM_AGE_VALIDATOR, 24 SIGNUP_MINIMUM_AGE_VALIDATOR,
25 TRANSCODING_THREADS_VALIDATOR 25 TRANSCODING_THREADS_VALIDATOR,
26 MAX_VIDEO_CHANNELS_PER_USER_VALIDATOR
26} from '@app/shared/form-validators/custom-config-validators' 27} from '@app/shared/form-validators/custom-config-validators'
27import { USER_VIDEO_QUOTA_DAILY_VALIDATOR, USER_VIDEO_QUOTA_VALIDATOR } from '@app/shared/form-validators/user-validators' 28import { USER_VIDEO_QUOTA_DAILY_VALIDATOR, USER_VIDEO_QUOTA_VALIDATOR } from '@app/shared/form-validators/user-validators'
28import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' 29import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
@@ -151,6 +152,9 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit {
151 videoQuota: USER_VIDEO_QUOTA_VALIDATOR, 152 videoQuota: USER_VIDEO_QUOTA_VALIDATOR,
152 videoQuotaDaily: USER_VIDEO_QUOTA_DAILY_VALIDATOR 153 videoQuotaDaily: USER_VIDEO_QUOTA_DAILY_VALIDATOR
153 }, 154 },
155 videoChannels: {
156 maxPerUser: MAX_VIDEO_CHANNELS_PER_USER_VALIDATOR
157 },
154 transcoding: { 158 transcoding: {
155 enabled: null, 159 enabled: null,
156 threads: TRANSCODING_THREADS_VALIDATOR, 160 threads: TRANSCODING_THREADS_VALIDATOR,