From 32d13b203b3abf756e751994836c28ddd1f4ebd9 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 9 Apr 2021 11:19:14 +0200 Subject: Plugins can register html/select settings --- shared/models/plugins/register-client-form-field.model.ts | 14 ++++++++++---- shared/models/plugins/register-server-setting.model.ts | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'shared/models/plugins') diff --git a/shared/models/plugins/register-client-form-field.model.ts b/shared/models/plugins/register-client-form-field.model.ts index 641d7490c..cdcdaa181 100644 --- a/shared/models/plugins/register-client-form-field.model.ts +++ b/shared/models/plugins/register-client-form-field.model.ts @@ -1,7 +1,13 @@ -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 diff --git a/shared/models/plugins/register-server-setting.model.ts b/shared/models/plugins/register-server-setting.model.ts index 6872dc53e..6bc25b4ae 100644 --- a/shared/models/plugins/register-server-setting.model.ts +++ b/shared/models/plugins/register-server-setting.model.ts @@ -1,6 +1,6 @@ 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 -- cgit v1.2.3