diff options
author | Chocobozzz <me@florianbigard.com> | 2021-04-09 11:19:14 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-04-09 11:19:14 +0200 |
commit | 32d13b203b3abf756e751994836c28ddd1f4ebd9 (patch) | |
tree | 4fdaf486ecf57d39d0fa6cf45aebe1167d7a9438 /shared/models/plugins | |
parent | 55b84d5346f6db35454a1bd102997769021d6470 (diff) | |
download | PeerTube-32d13b203b3abf756e751994836c28ddd1f4ebd9.tar.gz PeerTube-32d13b203b3abf756e751994836c28ddd1f4ebd9.tar.zst PeerTube-32d13b203b3abf756e751994836c28ddd1f4ebd9.zip |
Plugins can register html/select settings
Diffstat (limited to 'shared/models/plugins')
-rw-r--r-- | shared/models/plugins/register-client-form-field.model.ts | 14 | ||||
-rw-r--r-- | shared/models/plugins/register-server-setting.model.ts | 2 |
2 files changed, 11 insertions, 5 deletions
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 @@ | |||
1 | export interface RegisterClientFormFieldOptions { | 1 | export type RegisterClientFormFieldOptions = { |
2 | name: string | 2 | name?: string |
3 | label: string | 3 | label?: string |
4 | type: 'input' | 'input-checkbox' | 'input-password' | 'input-textarea' | 'markdown-text' | 'markdown-enhanced' | 4 | type: 'input' | 'input-checkbox' | 'input-password' | 'input-textarea' | 'markdown-text' | 'markdown-enhanced' | 'select' | 'html' |
5 | |||
6 | // For select type | ||
7 | options?: { value: string, label: string }[] | ||
8 | |||
9 | // For html type | ||
10 | html?: string | ||
5 | 11 | ||
6 | descriptionHTML?: string | 12 | descriptionHTML?: string |
7 | 13 | ||
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 @@ | |||
1 | import { RegisterClientFormFieldOptions } from './register-client-form-field.model' | 1 | import { RegisterClientFormFieldOptions } from './register-client-form-field.model' |
2 | 2 | ||
3 | export interface RegisterServerSettingOptions extends RegisterClientFormFieldOptions { | 3 | export type RegisterServerSettingOptions = RegisterClientFormFieldOptions & { |
4 | // If the setting is not private, anyone can view its value (client code included) | 4 | // If the setting is not private, anyone can view its value (client code included) |
5 | // If the setting is private, only server-side hooks can access it | 5 | // If the setting is private, only server-side hooks can access it |
6 | // Mainly used by the PeerTube client to get admin config | 6 | // Mainly used by the PeerTube client to get admin config |