diff options
author | Chocobozzz <me@florianbigard.com> | 2021-02-10 09:05:29 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-02-10 11:36:40 +0100 |
commit | 21e493d4d8acb7a650eff3a30cd7e086b3cb8a28 (patch) | |
tree | f3a451d6a59925907c62b0c36db99745a43b67db /client/src/app/+admin/config/edit-custom-config | |
parent | ead64cdf8d917fa0d6a20271e42378f38e5f2407 (diff) | |
download | PeerTube-21e493d4d8acb7a650eff3a30cd7e086b3cb8a28.tar.gz PeerTube-21e493d4d8acb7a650eff3a30cd7e086b3cb8a28.tar.zst PeerTube-21e493d4d8acb7a650eff3a30cd7e086b3cb8a28.zip |
Add ability to set a custom quota
Diffstat (limited to 'client/src/app/+admin/config/edit-custom-config')
-rw-r--r-- | client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html | 32 | ||||
-rw-r--r-- | client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts | 3 |
2 files changed, 20 insertions, 15 deletions
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html index 844620ca2..637203b96 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html | |||
@@ -402,25 +402,29 @@ | |||
402 | <ng-container formGroupName="user"> | 402 | <ng-container formGroupName="user"> |
403 | <div class="form-group"> | 403 | <div class="form-group"> |
404 | <label i18n for="userVideoQuota">Default video quota per user</label> | 404 | <label i18n for="userVideoQuota">Default video quota per user</label> |
405 | <div class="peertube-select-container"> | 405 | |
406 | <select id="userVideoQuota" formControlName="videoQuota" class="form-control"> | 406 | <my-select-custom-value |
407 | <option *ngFor="let videoQuotaOption of videoQuotaOptions" [value]="videoQuotaOption.value" [disabled]="videoQuotaOption.disabled"> | 407 | id="userVideoQuota" |
408 | {{ videoQuotaOption.label }} | 408 | [items]="videoQuotaOptions" |
409 | </option> | 409 | formControlName="videoQuota" |
410 | </select> | 410 | i18n-inputSuffix inputSuffix="bytes" inputType="number" |
411 | </div> | 411 | [clearable]="false" |
412 | ></my-select-custom-value> | ||
413 | |||
412 | <div *ngIf="formErrors.user.videoQuota" class="form-error">{{ formErrors.user.videoQuota }}</div> | 414 | <div *ngIf="formErrors.user.videoQuota" class="form-error">{{ formErrors.user.videoQuota }}</div> |
413 | </div> | 415 | </div> |
414 | 416 | ||
415 | <div class="form-group"> | 417 | <div class="form-group"> |
416 | <label i18n for="userVideoQuotaDaily">Default daily upload limit per user</label> | 418 | <label i18n for="userVideoQuotaDaily">Default daily upload limit per user</label> |
417 | <div class="peertube-select-container"> | 419 | |
418 | <select id="userVideoQuotaDaily" formControlName="videoQuotaDaily" class="form-control"> | 420 | <my-select-custom-value |
419 | <option *ngFor="let videoQuotaDailyOption of videoQuotaDailyOptions" [value]="videoQuotaDailyOption.value" [disabled]="videoQuotaDailyOption.disabled"> | 421 | id="userVideoQuotaDaily" |
420 | {{ videoQuotaDailyOption.label }} | 422 | [items]="videoQuotaDailyOptions" |
421 | </option> | 423 | formControlName="videoQuotaDaily" |
422 | </select> | 424 | i18n-inputSuffix inputSuffix="bytes" inputType="number" |
423 | </div> | 425 | [clearable]="false" |
426 | ></my-select-custom-value> | ||
427 | |||
424 | <div *ngIf="formErrors.user.videoQuotaDaily" class="form-error">{{ formErrors.user.videoQuotaDaily }}</div> | 428 | <div *ngIf="formErrors.user.videoQuotaDaily" class="form-error">{{ formErrors.user.videoQuotaDaily }}</div> |
425 | </div> | 429 | </div> |
426 | </ng-container> | 430 | </ng-container> |
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 a9f72d7db..56be97e84 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 | |||
@@ -19,9 +19,10 @@ import { | |||
19 | TRANSCODING_THREADS_VALIDATOR | 19 | TRANSCODING_THREADS_VALIDATOR |
20 | } from '@app/shared/form-validators/custom-config-validators' | 20 | } from '@app/shared/form-validators/custom-config-validators' |
21 | import { USER_VIDEO_QUOTA_DAILY_VALIDATOR, USER_VIDEO_QUOTA_VALIDATOR } from '@app/shared/form-validators/user-validators' | 21 | import { USER_VIDEO_QUOTA_DAILY_VALIDATOR, USER_VIDEO_QUOTA_VALIDATOR } from '@app/shared/form-validators/user-validators' |
22 | import { FormReactive, FormValidatorService, SelectOptionsItem } from '@app/shared/shared-forms' | 22 | import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' |
23 | import { NgbNav } from '@ng-bootstrap/ng-bootstrap' | 23 | import { NgbNav } from '@ng-bootstrap/ng-bootstrap' |
24 | import { CustomConfig, ServerConfig } from '@shared/models' | 24 | import { CustomConfig, ServerConfig } from '@shared/models' |
25 | import { SelectOptionsItem } from 'src/types/select-options-item.model' | ||
25 | 26 | ||
26 | @Component({ | 27 | @Component({ |
27 | selector: 'my-edit-custom-config', | 28 | selector: 'my-edit-custom-config', |