diff options
author | Florian CUNY <poslovitch@bentobox.world> | 2021-10-26 16:42:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-26 16:42:10 +0200 |
commit | 754b6f5f41bdc40aaaeefdb3c351666c305abe20 (patch) | |
tree | d36c8081f3137f1e2c9763879f71d41aa9a3efc1 /client/src/app/shared | |
parent | 615836dbd4f48fc563551446529fa9d3b14dc329 (diff) | |
download | PeerTube-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/shared')
-rw-r--r-- | client/src/app/shared/form-validators/custom-config-validators.ts | 9 | ||||
-rw-r--r-- | client/src/app/shared/shared-main/shared-main.module.ts | 7 |
2 files changed, 15 insertions, 1 deletions
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 fbf423d08..ba8512e95 100644 --- a/client/src/app/shared/form-validators/custom-config-validators.ts +++ b/client/src/app/shared/form-validators/custom-config-validators.ts | |||
@@ -98,6 +98,15 @@ export const MAX_USER_LIVES_VALIDATOR: BuildFormValidator = { | |||
98 | } | 98 | } |
99 | } | 99 | } |
100 | 100 | ||
101 | export const MAX_VIDEO_CHANNELS_PER_USER_VALIDATOR: BuildFormValidator = { | ||
102 | VALIDATORS: [ Validators.required, Validators.min(1), Validators.pattern('[0-9]+') ], | ||
103 | MESSAGES: { | ||
104 | required: $localize`Max video channels per user is required.`, | ||
105 | min: $localize`Max video channels per user must be greater or equal to 1.`, | ||
106 | pattern: $localize`Max video channels per user must be a number.` | ||
107 | } | ||
108 | } | ||
109 | |||
101 | export const CONCURRENCY_VALIDATOR: BuildFormValidator = { | 110 | export const CONCURRENCY_VALIDATOR: BuildFormValidator = { |
102 | VALIDATORS: [ Validators.required, Validators.min(1) ], | 111 | VALIDATORS: [ Validators.required, Validators.min(1) ], |
103 | MESSAGES: { | 112 | MESSAGES: { |
diff --git a/client/src/app/shared/shared-main/shared-main.module.ts b/client/src/app/shared/shared-main/shared-main.module.ts index 80d0a84f3..93989780d 100644 --- a/client/src/app/shared/shared-main/shared-main.module.ts +++ b/client/src/app/shared/shared-main/shared-main.module.ts | |||
@@ -43,7 +43,12 @@ import { | |||
43 | } from './misc' | 43 | } from './misc' |
44 | import { PluginPlaceholderComponent } from './plugins' | 44 | import { PluginPlaceholderComponent } from './plugins' |
45 | import { ActorRedirectGuard } from './router' | 45 | import { ActorRedirectGuard } from './router' |
46 | import { UserHistoryService, UserNotificationsComponent, UserNotificationService, UserQuotaComponent } from './users' | 46 | import { |
47 | UserHistoryService, | ||
48 | UserNotificationsComponent, | ||
49 | UserNotificationService, | ||
50 | UserQuotaComponent | ||
51 | } from './users' | ||
47 | import { RedundancyService, VideoImportService, VideoOwnershipService, VideoService } from './video' | 52 | import { RedundancyService, VideoImportService, VideoOwnershipService, VideoService } from './video' |
48 | import { VideoCaptionService } from './video-caption' | 53 | import { VideoCaptionService } from './video-caption' |
49 | import { VideoChannelService } from './video-channel' | 54 | import { VideoChannelService } from './video-channel' |