Transcoding is enabled. The video quota only takes into account original video size.
At most, this user could upload ~ {{ computeQuotaWithTranscoding() | bytes: 0 }}.
+
+
+ {{ formErrors.videoQuota }}
+
-
-
+
+
+
+
+ {{ formErrors.videoQuotaDaily }}
diff --git a/client/src/app/+admin/users/user-edit/user-edit.component.scss b/client/src/app/+admin/users/user-edit/user-edit.component.scss
index 3b7715062..aa87b8d6d 100644
--- a/client/src/app/+admin/users/user-edit/user-edit.component.scss
+++ b/client/src/app/+admin/users/user-edit/user-edit.component.scss
@@ -1,6 +1,8 @@
@import '_variables';
@import '_mixins';
+$form-base-input-width: 340px;
+
label {
font-weight: $font-regular;
font-size: 100%;
@@ -15,18 +17,24 @@ label {
}
input:not([type=submit]) {
- @include peertube-input-text(340px);
+ @include peertube-input-text($form-base-input-width);
display: block;
}
my-input-toggle-hidden {
- @include responsive-width(340px);
+ @include responsive-width($form-base-input-width);
display: block;
}
.peertube-select-container {
- @include peertube-select-container(340px);
+ @include peertube-select-container($form-base-input-width);
+}
+
+my-select-custom-value {
+ @include responsive-width($form-base-input-width);
+
+ display: block;
}
input[type=submit], button {
diff --git a/client/src/app/+admin/users/user-edit/user-edit.ts b/client/src/app/+admin/users/user-edit/user-edit.ts
index faa2f5ad8..2fc3c5d3b 100644
--- a/client/src/app/+admin/users/user-edit/user-edit.ts
+++ b/client/src/app/+admin/users/user-edit/user-edit.ts
@@ -4,12 +4,13 @@ import { AuthService, ScreenService, ServerService, User } from '@app/core'
import { FormReactive } from '@app/shared/shared-forms'
import { USER_ROLE_LABELS } from '@shared/core-utils/users'
import { ServerConfig, UserAdminFlag, UserRole, VideoResolution } from '@shared/models'
+import { SelectOptionsItem } from '../../../../types/select-options-item.model'
@Directive()
// tslint:disable-next-line: directive-class-suffix
export abstract class UserEdit extends FormReactive implements OnInit {
- videoQuotaOptions: { value: string, label: string, disabled?: boolean }[] = []
- videoQuotaDailyOptions: { value: string, label: string, disabled?: boolean }[] = []
+ videoQuotaOptions: SelectOptionsItem[] = []
+ videoQuotaDailyOptions: SelectOptionsItem[] = []
username: string
user: User
@@ -97,19 +98,7 @@ export abstract class UserEdit extends FormReactive implements OnInit {
}
protected buildQuotaOptions () {
- // These are used by a HTML select, so convert key into strings
- this.videoQuotaOptions = this.configService
- .videoQuotaOptions.map(q => ({
- value: q.value?.toString(),
- label: q.label,
- disabled: q.disabled
- }))
-
- this.videoQuotaDailyOptions = this.configService
- .videoQuotaDailyOptions.map(q => ({
- value: q.value?.toString(),
- label: q.label,
- disabled: q.disabled
- }))
+ this.videoQuotaOptions = this.configService.videoQuotaOptions
+ this.videoQuotaDailyOptions = this.configService.videoQuotaDailyOptions
}
}
diff --git a/client/src/app/+my-library/my-video-playlists/my-video-playlist-edit.ts b/client/src/app/+my-library/my-video-playlists/my-video-playlist-edit.ts
index 40ba23e75..71db0592a 100644
--- a/client/src/app/+my-library/my-video-playlists/my-video-playlist-edit.ts
+++ b/client/src/app/+my-library/my-video-playlists/my-video-playlist-edit.ts
@@ -1,6 +1,7 @@
-import { FormReactive, SelectChannelItem } from '@app/shared/shared-forms'
+import { FormReactive } from '@app/shared/shared-forms'
import { VideoConstant, VideoPlaylistPrivacy } from '@shared/models'
import { VideoPlaylist } from '@shared/models/videos/playlist/video-playlist.model'
+import { SelectChannelItem } from '../../../types/select-options-item.model'
export abstract class MyVideoPlaylistEdit extends FormReactive {
// Declare it here to avoid errors in create template
diff --git a/client/src/app/+videos/+video-edit/shared/video-edit.component.ts b/client/src/app/+videos/+video-edit/shared/video-edit.component.ts
index 80b5dce46..f51f52160 100644
--- a/client/src/app/+videos/+video-edit/shared/video-edit.component.ts
+++ b/client/src/app/+videos/+video-edit/shared/video-edit.component.ts
@@ -1,5 +1,6 @@
import { forkJoin } from 'rxjs'
import { map } from 'rxjs/operators'
+import { SelectChannelItem } from 'src/types/select-options-item.model'
import { Component, EventEmitter, Input, NgZone, OnDestroy, OnInit, Output, ViewChild } from '@angular/core'
import { FormArray, FormControl, FormGroup, ValidatorFn, Validators } from '@angular/forms'
import { HooksService, PluginService, ServerService } from '@app/core'
@@ -17,10 +18,10 @@ import {
VIDEO_SUPPORT_VALIDATOR,
VIDEO_TAGS_ARRAY_VALIDATOR
} from '@app/shared/form-validators/video-validators'
-import { FormReactiveValidationMessages, FormValidatorService, SelectChannelItem } from '@app/shared/shared-forms'
+import { FormReactiveValidationMessages, FormValidatorService } from '@app/shared/shared-forms'
import { InstanceService } from '@app/shared/shared-instance'
import { VideoCaptionEdit, VideoEdit, VideoService } from '@app/shared/shared-main'
-import { ServerConfig, VideoConstant, LiveVideo, VideoPrivacy } from '@shared/models'
+import { LiveVideo, ServerConfig, VideoConstant, VideoPrivacy } from '@shared/models'
import { RegisterClientFormFieldOptions, RegisterClientVideoFieldOptions } from '@shared/models/plugins/register-client-form-field.model'
import { I18nPrimengCalendarService } from './i18n-primeng-calendar.service'
import { VideoCaptionAddModalComponent } from './video-caption-add-modal.component'
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-send.ts b/client/src/app/+videos/+video-edit/video-add-components/video-send.ts
index 812936d7a..9a22024e5 100644
--- a/client/src/app/+videos/+video-edit/video-add-components/video-send.ts
+++ b/client/src/app/+videos/+video-edit/video-add-components/video-send.ts
@@ -1,8 +1,9 @@
import { catchError, switchMap, tap } from 'rxjs/operators'
+import { SelectChannelItem } from 'src/types/select-options-item.model'
import { Directive, EventEmitter, OnInit } from '@angular/core'
import { AuthService, CanComponentDeactivateResult, Notifier, ServerService } from '@app/core'
import { populateAsyncUserVideoChannels } from '@app/helpers'
-import { FormReactive, SelectChannelItem } from '@app/shared/shared-forms'
+import { FormReactive } from '@app/shared/shared-forms'
import { VideoCaptionEdit, VideoCaptionService, VideoEdit, VideoService } from '@app/shared/shared-main'
import { LoadingBarService } from '@ngx-loading-bar/core'
import { ServerConfig, VideoConstant, VideoPrivacy } from '@shared/models'
diff --git a/client/src/app/+videos/+video-edit/video-update.component.ts b/client/src/app/+videos/+video-edit/video-update.component.ts
index 654901798..2973c6840 100644
--- a/client/src/app/+videos/+video-edit/video-update.component.ts
+++ b/client/src/app/+videos/+video-edit/video-update.component.ts
@@ -1,9 +1,10 @@
import { of } from 'rxjs'
import { map, switchMap } from 'rxjs/operators'
+import { SelectChannelItem } from 'src/types/select-options-item.model'
import { Component, HostListener, OnInit } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
import { Notifier } from '@app/core'
-import { FormReactive, FormValidatorService, SelectChannelItem } from '@app/shared/shared-forms'
+import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
import { VideoCaptionEdit, VideoCaptionService, VideoDetails, VideoEdit, VideoService } from '@app/shared/shared-main'
import { LiveVideoService } from '@app/shared/shared-video-live'
import { LoadingBarService } from '@ngx-loading-bar/core'
diff --git a/client/src/app/helpers/utils.ts b/client/src/app/helpers/utils.ts
index b4e26d792..6d7e76b11 100644
--- a/client/src/app/helpers/utils.ts
+++ b/client/src/app/helpers/utils.ts
@@ -1,10 +1,10 @@
+import { SelectChannelItem } from 'src/types/select-options-item.model'
import { DatePipe } from '@angular/common'
import { HttpErrorResponse } from '@angular/common/http'
import { Notifier } from '@app/core'
-import { SelectChannelItem } from '@app/shared/shared-forms'
+import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes'
import { environment } from '../../environments/environment'
import { AuthService } from '../core/auth'
-import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes'
// Thanks: https://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript
function getParameterByName (name: string, url: string) {
diff --git a/client/src/app/shared/form-validators/form-validator.model.ts b/client/src/app/shared/form-validators/form-validator.model.ts
index 248a3b1d3..07b1ea075 100644
--- a/client/src/app/shared/form-validators/form-validator.model.ts
+++ b/client/src/app/shared/form-validators/form-validator.model.ts
@@ -10,5 +10,5 @@ export type BuildFormArgument = {
}
export type BuildFormDefaultValues = {
- [ name: string ]: string | string[] | BuildFormDefaultValues
+ [ name: string ]: number | string | string[] | BuildFormDefaultValues
}
diff --git a/client/src/app/shared/shared-forms/select/select-channel.component.ts b/client/src/app/shared/shared-forms/select/select-channel.component.ts
index 1d91d59bc..40a7c53bb 100644
--- a/client/src/app/shared/shared-forms/select/select-channel.component.ts
+++ b/client/src/app/shared/shared-forms/select/select-channel.component.ts
@@ -1,13 +1,7 @@
-import { Component, forwardRef, Input } from '@angular/core'
+import { Component, forwardRef, Input, OnChanges } from '@angular/core'
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'
import { VideoChannel } from '@app/shared/shared-main'
-
-export type SelectChannelItem = {
- id: number
- label: string
- support: string
- avatarPath?: string
-}
+import { SelectChannelItem } from '../../../../types/select-options-item.model'
@Component({
selector: 'my-select-channel',
@@ -21,9 +15,10 @@ export type SelectChannelItem = {
}
]
})
-export class SelectChannelComponent implements ControlValueAccessor {
+export class SelectChannelComponent implements ControlValueAccessor, OnChanges {
@Input() items: SelectChannelItem[] = []
+ channels: SelectChannelItem[] = []
selectedId: number
// ng-select options
@@ -32,10 +27,14 @@ export class SelectChannelComponent implements ControlValueAccessor {
clearable = false
searchable = false
- get channels () {
- return this.items.map(c => Object.assign(c, {
- avatarPath: c.avatarPath ? c.avatarPath : VideoChannel.GET_DEFAULT_AVATAR_URL()
- }))
+ ngOnChanges () {
+ this.channels = this.items.map(c => {
+ const avatarPath = c.avatarPath
+ ? c.avatarPath
+ : VideoChannel.GET_DEFAULT_AVATAR_URL()
+
+ return Object.assign({}, c, { avatarPath })
+ })
}
propagateChange = (_: any) => { /* empty */ }
diff --git a/client/src/app/shared/shared-forms/select/select-checkbox.component.ts b/client/src/app/shared/shared-forms/select/select-checkbox.component.ts
index eb0c49034..c2523f15c 100644
--- a/client/src/app/shared/shared-forms/select/select-checkbox.component.ts
+++ b/client/src/app/shared/shared-forms/select/select-checkbox.component.ts
@@ -1,6 +1,6 @@
import { Component, forwardRef, Input, OnInit } from '@angular/core'
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'
-import { SelectOptionsItem } from './select-options.component'
+import { SelectOptionsItem } from '../../../../types/select-options-item.model'
export type ItemSelectCheckboxValue = { id?: string | number, group?: string } | string
diff --git a/client/src/app/shared/shared-forms/select/select-custom-value.component.html b/client/src/app/shared/shared-forms/select/select-custom-value.component.html
index 5fdf432ff..9dc8c2ec2 100644
--- a/client/src/app/shared/shared-forms/select/select-custom-value.component.html
+++ b/client/src/app/shared/shared-forms/select/select-custom-value.component.html
@@ -10,5 +10,9 @@
(ngModelChange)="onModelChange()"
>
-
+
+
+
+ {{ inputSuffix }}
+