mirror of https://github.com/Chocobozzz/PeerTube
Add missing live config validators
parent
4e9835e632
commit
4e55c132a0
|
@ -56,6 +56,8 @@
|
||||||
<div class="col-md-5 col-xl-5">
|
<div class="col-md-5 col-xl-5">
|
||||||
<span class="form-error submit-error" i18n *ngIf="!form.valid">
|
<span class="form-error submit-error" i18n *ngIf="!form.valid">
|
||||||
It seems like the configuration is invalid. Please search for potential errors in the different tabs.
|
It seems like the configuration is invalid. Please search for potential errors in the different tabs.
|
||||||
|
|
||||||
|
{{ formErrors }}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span class="form-error submit-error" i18n *ngIf="!hasLiveAllowReplayConsistentOptions()">
|
<span class="form-error submit-error" i18n *ngIf="!hasLiveAllowReplayConsistentOptions()">
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
|
|
||||||
|
import { forkJoin } from 'rxjs'
|
||||||
|
import { SelectOptionsItem } from 'src/types/select-options-item.model'
|
||||||
import { Component, OnInit } from '@angular/core'
|
import { Component, OnInit } from '@angular/core'
|
||||||
import { ActivatedRoute, Router } from '@angular/router'
|
import { ActivatedRoute, Router } from '@angular/router'
|
||||||
import { ConfigService } from '@app/+admin/config/shared/config.service'
|
import { ConfigService } from '@app/+admin/config/shared/config.service'
|
||||||
|
@ -12,6 +14,9 @@ import {
|
||||||
INDEX_URL_VALIDATOR,
|
INDEX_URL_VALIDATOR,
|
||||||
INSTANCE_NAME_VALIDATOR,
|
INSTANCE_NAME_VALIDATOR,
|
||||||
INSTANCE_SHORT_DESCRIPTION_VALIDATOR,
|
INSTANCE_SHORT_DESCRIPTION_VALIDATOR,
|
||||||
|
MAX_INSTANCE_LIVES_VALIDATOR,
|
||||||
|
MAX_LIVE_DURATION_VALIDATOR,
|
||||||
|
MAX_USER_LIVES_VALIDATOR,
|
||||||
SEARCH_INDEX_URL_VALIDATOR,
|
SEARCH_INDEX_URL_VALIDATOR,
|
||||||
SERVICES_TWITTER_USERNAME_VALIDATOR,
|
SERVICES_TWITTER_USERNAME_VALIDATOR,
|
||||||
SIGNUP_LIMIT_VALIDATOR,
|
SIGNUP_LIMIT_VALIDATOR,
|
||||||
|
@ -20,8 +25,6 @@ import {
|
||||||
import { USER_VIDEO_QUOTA_DAILY_VALIDATOR, USER_VIDEO_QUOTA_VALIDATOR } from '@app/shared/form-validators/user-validators'
|
import { USER_VIDEO_QUOTA_DAILY_VALIDATOR, USER_VIDEO_QUOTA_VALIDATOR } from '@app/shared/form-validators/user-validators'
|
||||||
import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
|
import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
|
||||||
import { CustomConfig, ServerConfig } from '@shared/models'
|
import { CustomConfig, ServerConfig } from '@shared/models'
|
||||||
import { forkJoin } from 'rxjs'
|
|
||||||
import { SelectOptionsItem } from 'src/types/select-options-item.model'
|
|
||||||
import { EditConfigurationService } from './edit-configuration.service'
|
import { EditConfigurationService } from './edit-configuration.service'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -156,9 +159,9 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit {
|
||||||
live: {
|
live: {
|
||||||
enabled: null,
|
enabled: null,
|
||||||
|
|
||||||
maxDuration: null,
|
maxDuration: MAX_LIVE_DURATION_VALIDATOR,
|
||||||
maxInstanceLives: null,
|
maxInstanceLives: MAX_INSTANCE_LIVES_VALIDATOR,
|
||||||
maxUserLives: null,
|
maxUserLives: MAX_USER_LIVES_VALIDATOR,
|
||||||
allowReplay: null,
|
allowReplay: null,
|
||||||
|
|
||||||
transcoding: {
|
transcoding: {
|
||||||
|
|
|
@ -65,6 +65,30 @@ export const TRANSCODING_THREADS_VALIDATOR: BuildFormValidator = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const MAX_LIVE_DURATION_VALIDATOR: BuildFormValidator = {
|
||||||
|
VALIDATORS: [Validators.required, Validators.min(-1)],
|
||||||
|
MESSAGES: {
|
||||||
|
'required': $localize`Max live duration is required.`,
|
||||||
|
'min': $localize`Max live duration should be greater or equal to -1.`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const MAX_INSTANCE_LIVES_VALIDATOR: BuildFormValidator = {
|
||||||
|
VALIDATORS: [Validators.required, Validators.min(-1)],
|
||||||
|
MESSAGES: {
|
||||||
|
'required': $localize`Max instance lives is required.`,
|
||||||
|
'min': $localize`Max instance lives should be greater or equal to -1.`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const MAX_USER_LIVES_VALIDATOR: BuildFormValidator = {
|
||||||
|
VALIDATORS: [Validators.required, Validators.min(-1)],
|
||||||
|
MESSAGES: {
|
||||||
|
'required': $localize`Max user lives is required.`,
|
||||||
|
'min': $localize`Max user lives should be greater or equal to -1.`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export const CONCURRENCY_VALIDATOR: BuildFormValidator = {
|
export const CONCURRENCY_VALIDATOR: BuildFormValidator = {
|
||||||
VALIDATORS: [Validators.required, Validators.min(1)],
|
VALIDATORS: [Validators.required, Validators.min(1)],
|
||||||
MESSAGES: {
|
MESSAGES: {
|
||||||
|
|
Loading…
Reference in New Issue