<div [formGroup]="form">
- <label *ngIf="setting.type !== 'input-checkbox'" [attr.for]="setting.name" [innerHTML]="setting.label"></label>
+ <label *ngIf="setting.label" [attr.for]="setting.name" [innerHTML]="setting.label"></label>
<div *ngIf="setting.descriptionHTML" class="label-small-info" [innerHTML]="setting.descriptionHTML"></div>
<input *ngIf="setting.type === 'input'" type="text" [id]="setting.name" [formControlName]="setting.name" />
+ <div *ngIf="setting.type === 'select'" class="peertube-select-container">
+ <select [id]="setting.name" [formControlName]="setting.name" class="form-control">
+ <option *ngFor="let option of setting.options" [value]="option.value">{{ option.label }}</option>
+ </select>
+ </div>
+
<my-input-toggle-hidden *ngIf="setting.type === 'input-password'" [formControlName]="setting.name" [inputId]="setting.name"></my-input-toggle-hidden>
<textarea *ngIf="setting.type === 'input-textarea'" type="text" [id]="setting.name" [formControlName]="setting.name"></textarea>
[labelInnerHTML]="setting.label"
></my-peertube-checkbox>
+ <div *ngIf="setting.type === 'html'" [innerHTML]="setting.html"></div>
+
<div *ngIf="formErrors[setting.name]" class="form-error">
{{ formErrors[setting.name] }}
</div>
-export interface RegisterClientFormFieldOptions {
- name: string
- label: string
- type: 'input' | 'input-checkbox' | 'input-password' | 'input-textarea' | 'markdown-text' | 'markdown-enhanced'
+export type RegisterClientFormFieldOptions = {
+ name?: string
+ label?: string
+ type: 'input' | 'input-checkbox' | 'input-password' | 'input-textarea' | 'markdown-text' | 'markdown-enhanced' | 'select' | 'html'
+
+ // For select type
+ options?: { value: string, label: string }[]
+
+ // For html type
+ html?: string
descriptionHTML?: string
import { RegisterClientFormFieldOptions } from './register-client-form-field.model'
-export interface RegisterServerSettingOptions extends RegisterClientFormFieldOptions {
+export type RegisterServerSettingOptions = RegisterClientFormFieldOptions & {
// If the setting is not private, anyone can view its value (client code included)
// If the setting is private, only server-side hooks can access it
// Mainly used by the PeerTube client to get admin config