Commit 19e728bf authored by Angelina Filippova's avatar Angelina Filippova

Merge branch 'fix/objects-in-config' into 'master'

Add new settings to config

See merge request pleroma/admin-fe!37
parents 8df49caf e79b4bfd
......@@ -6,9 +6,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]
### Added
- add ability to configure new settings (UploadS3 bucket namespace, Rate limit for Activity pub routes, Email notifications settings, MRF Vocabulary, user bio and name length and others)
### Changed
- removes "Dashboard" from dropdown menu
- makes all single selects clearable and allow to enter custom values in all multiple selects
- remove legacy activitypub accept_blocks setting
### Fixed
......
......@@ -42,7 +42,14 @@ export const initialSettings = [
{ 'tuple': [':remote_post_retention_days', 90] },
{ 'tuple': [':skip_thread_containment', true] },
{ 'tuple': [':limit_to_local_content', ':unauthenticated'] },
{ 'tuple': [':dynamic_configuration', true] }
{ 'tuple': [':dynamic_configuration', true] },
{ 'tuple': [':max_account_fields', 10] },
{ 'tuple': [':max_remote_account_fields', 20] },
{ 'tuple': [':account_field_name_length', 255] },
{ 'tuple': [':account_field_value_length', 255] },
{ 'tuple': [':external_user_synchronization', true] },
{ 'tuple': [':user_bio_length', 5000] },
{ 'tuple': [':user_name_length', 100] }
]
},
{
......
......@@ -33,6 +33,7 @@ const getters = {
corsPlugMethods: state => state.settings.settings['methods'],
database: state => state.settings.settings['database'],
ectoRepos: state => state.settings.settings['ecto_repos'],
emailNotifications: state => state.settings.settings['email_notifications'],
emoji: state => state.settings.settings['emoji'],
enabled: state => state.settings.settings['enabled'],
endpoint: state => state.settings.settings['Pleroma.Web.Endpoint'],
......@@ -67,6 +68,7 @@ const getters = {
mrfSimple: state => state.settings.settings['mrf_simple'],
mrfSubchain: state => state.settings.settings['mrf_subchain'],
mrfUserAllowlist: state => state.settings.settings['mrf_user_allowlist'],
mrfVocabulary: state => state.settings.settings['mrf_vocabulary'],
oauth2: state => state.settings.settings['oauth2'],
passwordAuthenticator: state => state.settings.settings['password_authenticator'],
pleromaAuthenticator: state => state.settings.settings['Pleroma.Web.Auth.Authenticator'],
......@@ -91,6 +93,7 @@ const getters = {
uploadS3: state => state.settings.settings['Pleroma.Uploaders.S3'],
uriSchemes: state => state.settings.settings['uri_schemes'],
user: state => state.settings.settings['user'],
userEmail: state => state.settings.settings['Pleroma.Emails.UserEmail'],
vapidDetails: state => state.settings.settings['vapid_details'],
webhookUrl: state => state.settings.settings['webhook_url']
}
......
const nonAtomsTuples = ['replace', ':replace']
const nonAtomsObjects = ['match_actor', ':match_actor']
const objects = ['digest', 'pleroma_fe', 'masto_fe', 'poll_limits']
const objects = ['digest', 'pleroma_fe', 'masto_fe', 'poll_limits', 'styling']
const objectParents = ['mascots']
const groups = {
'cors_plug': [
......@@ -24,6 +24,7 @@ const groups = {
'Pleroma.Captcha',
'Pleroma.Captcha.Kocaptcha',
'Pleroma.Emails.Mailer',
'Pleroma.Emails.UserEmail',
'Pleroma.Repo',
'Pleroma.ScheduledActivity',
'Pleroma.Upload',
......@@ -45,6 +46,7 @@ const groups = {
'chat',
'database',
'ecto_repos',
'email_notifications',
'emoji',
'env',
'fetch_initial_posts',
......@@ -65,6 +67,7 @@ const groups = {
'mrf_simple',
'mrf_subchain',
'mrf_user_allowlist',
'mrf_vocabulary',
'oauth2',
'rate_limit',
'rich_media',
......
......@@ -17,6 +17,7 @@ const settings = {
'credentials': {},
'database': {},
'ecto_repos': {},
'email_notifications': { digest: {}},
'emoji': { groups: {}},
'enabled': {},
'ex_syslogger': {},
......@@ -46,11 +47,13 @@ const settings = {
'mrf_simple': {},
'mrf_subchain': { match_actor: {}},
'mrf_user_allowlist': {},
'mrf_vocabulary': {},
'oauth2': {},
'password_authenticator': {},
'Pleroma.Captcha': {},
'Pleroma.Captcha.Kocaptcha': {},
'Pleroma.Emails.Mailer': {},
'Pleroma.Emails.UserEmail': { styling: {}},
'Pleroma.Repo': {},
'Pleroma.ScheduledActivity': {},
'Pleroma.Upload': { proxy_opts: {}},
......@@ -136,7 +139,9 @@ const settings = {
},
async UploadMedia({ dispatch, getters, state }, { file, tab, inputName, childName }) {
const response = await uploadMedia(file, getters.authHost, getters.token)
const updatedValue = { ...state.settings[tab][inputName], ...{ [childName]: response.data.url }}
const updatedValue = childName
? { ...state.settings[tab][inputName], ...{ [childName]: response.data.url }}
: response.data.url
dispatch('UpdateSettings', { tab, data: { [inputName]: updatedValue }})
}
}
......
<template>
<div>
<el-form ref="activityPub" :model="activityPub" :label-width="labelWidth">
<el-form-item label="Accept blocks">
<el-switch :value="activityPub.accept_blocks" @change="updateSetting($event, 'activitypub', 'accept_blocks')"/>
<p class="expl">Whether to accept incoming block activities from other instances</p>
</el-form-item>
<el-form-item label="Unfollow blocked">
<el-switch :value="activityPub.unfollow_blocked" @change="updateSetting($event, 'activitypub', 'unfollow_blocked')"/>
<p class="expl">Whether blocks result in people getting unfollowed</p>
......
......@@ -10,7 +10,7 @@
<p class="expl">The time in seconds for which the captcha is valid</p>
</el-form-item>
<el-form-item label="Method">
<el-select :value="captcha.method" placeholder="Select" @change="updateSetting($event, 'Pleroma.Captcha', 'method')">
<el-select :value="captcha.method" clearable @change="updateSetting($event, 'Pleroma.Captcha', 'method')">
<el-option label="Pleroma.Captcha.Kocaptcha" value="Pleroma.Captcha.Kocaptcha"/>
</el-select>
<p class="expl">The method/service to use for captcha</p>
......
......@@ -23,7 +23,7 @@
<div class="line"/>
<el-form ref="ectoRepos" :model="ectoRepos" :label-width="labelWidth">
<el-form-item label="Ecto repos">
<el-select :value="ectoRepos.value || []" multiple allow-create @change="updateSetting($event, 'ecto_repos', 'value')">
<el-select :value="ectoRepos.value || []" multiple filterable allow-create @change="updateSetting($event, 'ecto_repos', 'value')">
<el-option label="Pleroma.Repo" value="Pleroma.Repo"/>
</el-select>
</el-form-item>
......@@ -45,7 +45,7 @@
<p class="expl">An URL that specifies storage information</p>
</el-form-item>
<el-form-item label="Log level">
<el-select :value="pleromaRepo.log" @change="updateSetting($event, 'Pleroma.Repo', 'log')">
<el-select :value="pleromaRepo.log" clearable @change="updateSetting($event, 'Pleroma.Repo', 'log')">
<el-option :value="false" label="False - disables logging for that repository."/>
<el-option value=":debug" label=":debug - for debug-related messages"/>
<el-option value=":info" label=":info - for information of any kind"/>
......@@ -59,7 +59,7 @@
<p class="expl">The size of the pool used by the connection module. Defaults to <span class="code">10</span></p>
</el-form-item>
<el-form-item label="Telemetry prefix">
<el-select :value="pleromaRepo.telemetry_prefix || []" multiple allow-create @change="updateSetting($event, 'Pleroma.Repo', 'telemetry_prefix')">
<el-select :value="pleromaRepo.telemetry_prefix || []" multiple filterable allow-create @change="updateSetting($event, 'Pleroma.Repo', 'telemetry_prefix')">
<el-option label=":my_app" value=":my_app"/>
<el-option label=":repo" value=":repo"/>
<el-option label=":query" value=":query"/>
......@@ -69,7 +69,7 @@
<el-input :value="pleromaRepo.types" @input="updateSetting($event, 'Pleroma.Repo', 'types')"/>
</el-form-item>
<el-form-item label="Telemetry event">
<el-select :value="pleromaRepo.telemetry_event || []" multiple allow-create @change="updateSetting($event, 'Pleroma.Repo', 'telemetry_event')">
<el-select :value="pleromaRepo.telemetry_event || []" multiple filterable allow-create @change="updateSetting($event, 'Pleroma.Repo', 'telemetry_event')">
<el-option label="Pleroma.Repo.Instrumenter" value="Pleroma.Repo.Instrumenter"/>
</el-select>
</el-form-item>
......@@ -120,7 +120,7 @@
<p class="expl">The timeout for establishing new connections. Defaults to 5000</p>
</el-form-item>
<el-form-item label="Prepare">
<el-select :value="pleromaRepo.prepare" @change="updateSetting($event, 'Pleroma.Repo', 'prepare')">
<el-select :value="pleromaRepo.prepare" clearable @change="updateSetting($event, 'Pleroma.Repo', 'prepare')">
<el-option label="named" value=":named"/>
<el-option label="unnamed" value=":unnamed"/>
</el-select>
......
......@@ -8,7 +8,7 @@
</el-form-item>
<el-form-item label="Pleroma FE:"/>
<el-form-item label="Theme">
<el-select :value="frontend.pleroma_fe.theme" @change="processNestedData($event, 'frontend_configurations', 'pleroma_fe', 'theme')">
<el-select :value="frontend.pleroma_fe.theme" clearable @change="processNestedData($event, 'frontend_configurations', 'pleroma_fe', 'theme')">
<el-option
v-for="item in themeOptions"
:key="item.value"
......@@ -80,7 +80,7 @@
<p class="expl">Copy the scope <span class="code">(private/unlisted/public)</span> in replies to posts by default</p>
</el-form-item>
<el-form-item label="Subject line behavior">
<el-select :value="frontend.pleroma_fe.subjectLineBehavior" @change="processNestedData($event, 'frontend_configurations', 'pleroma_fe', 'subjectLineBehavior')">
<el-select :value="frontend.pleroma_fe.subjectLineBehavior" clearable @change="processNestedData($event, 'frontend_configurations', 'pleroma_fe', 'subjectLineBehavior')">
<el-option label="Email" value="email">Email / Copy and preprend re:, as in email</el-option>
<el-option label="Masto" value="masto">Masto / Copy verbatim, as in Mastodon</el-option>
<el-option label="Noop" value="noop">Noop / Don't copy the subject</el-option>
......@@ -123,7 +123,7 @@
<div class="line"/>
<el-form-item label="Masto FE:"/>
<el-form-item label="Theme">
<el-select :value="frontend.masto_fe.theme" @change="processNestedData($event, 'frontend_configurations', 'masto_fe', 'theme')">
<el-select :value="frontend.masto_fe.theme" clearable @change="processNestedData($event, 'frontend_configurations', 'masto_fe', 'theme')">
<el-option
v-for="item in themeOptions"
:key="item.value"
......@@ -195,7 +195,7 @@
<p class="expl">Copy the scope <span class="code">(private/unlisted/public)</span> in replies to posts by default</p>
</el-form-item>
<el-form-item label="Subject line behavior">
<el-select :value="frontend.masto_fe.subjectLineBehavior" @change="processNestedData($event, 'frontend_configurations', 'masto_fe', 'subjectLineBehavior')">
<el-select :value="frontend.masto_fe.subjectLineBehavior" clearable @change="processNestedData($event, 'frontend_configurations', 'masto_fe', 'subjectLineBehavior')">
<el-option label="Email" value="email">Email / Copy and preprend re:, as in email</el-option>
<el-option label="Masto" value="masto">Masto / Copy verbatim, as in Mastodon</el-option>
<el-option label="Noop" value="noop">Noop / Don't copy the subject</el-option>
......@@ -240,7 +240,7 @@
<el-form ref="assets" :model="assets" :label-width="labelWidth">
<el-form-item label="Assets:"/>
<el-form-item label="Default mascot">
<el-select :value="assets.default_mascot" @change="updateSetting($event, 'assets', 'default_mascot')"/>
<el-select :value="assets.default_mascot" clearable @change="updateSetting($event, 'assets', 'default_mascot')"/>
<p class="expl">An element from mascots - This will be used as the default mascot on MastoFE
(default: <span class="code">:pleroma_fox_tan</span>)</p>
</el-form-item>
......
......@@ -82,7 +82,7 @@
<p class="expl">The maximum age for the <span class="code">Expect-CT</span> header if sent</p>
</el-form-item>
<el-form-item label="Referrer policy">
<el-select :value="httpSecurity.referrer_policy" placeholder="Select" @change="updateSetting($event, 'http_security', 'referrer_policy')">
<el-select :value="httpSecurity.referrer_policy" clearable @change="updateSetting($event, 'http_security', 'referrer_policy')">
<el-option label="same-origin" value="same-origin"/>
<el-option label="no-referrer" value="no-referrer"/>
</el-select>
......
......@@ -41,6 +41,14 @@
<el-input-number :value="instance.banner_upload_limit / 1048576" :step="1" :min="0" size="large" @change="updateSetting($event * 1048576, 'instance', 'banner_upload_limit')"/>
<p class="expl">File size limit of user’s profile banners</p>
</el-form-item>
<el-form-item label="User bio length">
<el-input-number :value="instance.user_bio_length" :step="1" :min="0" size="large" @change="updateSetting($event, 'instance', 'user_bio_length')"/>
<p class="expl">A user bio maximum length (default: 5000)</p>
</el-form-item>
<el-form-item label="User name length">
<el-input-number :value="instance.user_name_length" :step="1" :min="0" size="large" @change="updateSetting($event, 'instance', 'user_name_length')"/>
<p class="expl">A user name maximum length (default: 100)</p>
</el-form-item>
<el-form-item label="Poll limits:"/>
<el-form-item label="Max options">
<el-input-number :value="instance.poll_limits.max_options" :step="1" :min="0" size="large" @change="processNestedData($event, 'instance', 'poll_limits', 'max_options')"/>
......@@ -84,7 +92,7 @@
<p class="expl">Timeout (in days) of each external federation target being unreachable prior to pausing federating to it</p>
</el-form-item>
<el-form-item label="Federation publisher modules">
<el-select :value="instance.federation_publisher_modules || []" multiple @change="updateSetting($event, 'instance', 'federation_publisher_modules')">
<el-select :value="instance.federation_publisher_modules || []" multiple filterable allow-create @change="updateSetting($event, 'instance', 'federation_publisher_modules')">
<el-option
v-for="item in federationPublisherModulesOptions"
:key="item.value"
......@@ -114,7 +122,7 @@
<p class="expl">Makes the client API in authentificated mode-only except for user-profiles. Useful for disabling the Local Timeline and The Whole Known Network</p>
</el-form-item>
<el-form-item label="Quarantined instances">
<el-select :value="instance.quarantined_instances || []" multiple placeholder="Select" @change="updateSetting($event, 'instance', 'quarantined_instances')">
<el-select :value="instance.quarantined_instances || []" multiple filterable allow-create @change="updateSetting($event, 'instance', 'quarantined_instances')">
<el-option
v-for="item in quarantinedInstancesOptions"
:key="item.value"
......@@ -132,7 +140,7 @@
<el-input :value="instance.static_dir" @input="updateSetting($event, 'instance', 'static_dir')"/>
</el-form-item>
<el-form-item label="Allowed post formats">
<el-select :value="instance.allowed_post_formats || []" multiple placeholder="Select" @change="updateSetting($event, 'instance', 'allowed_post_formats')">
<el-select :value="instance.allowed_post_formats || []" multiple filterable allow-create @change="updateSetting($event, 'instance', 'allowed_post_formats')">
<el-option label="text/plain" value="text/plain"/>
<el-option label="text/html" value="text/html"/>
<el-option label="text/markdown" value="text/markdown"/>
......@@ -152,7 +160,7 @@
<p class="expl">Copy the scope <span class="code">(private/unlisted/public)</span> in replies to posts by default</p>
</el-form-item>
<el-form-item label="Subject line behavior">
<el-select :value="instance.subject_line_behavior" @change="updateSetting($event, 'instance', 'subject_line_behavior')">
<el-select :value="instance.subject_line_behavior" clearable @change="updateSetting($event, 'instance', 'subject_line_behavior')">
<el-option label="Email" value="email">Email / Copy and preprend re:, as in email</el-option>
<el-option label="Masto" value="masto">Masto / Copy verbatim, as in Mastodon</el-option>
<el-option label="Noop" value="noop">Noop / Don't copy the subject</el-option>
......@@ -172,7 +180,7 @@
<p class="expl">The maximum number of pinned statuses. '0' will disable the feature</p>
</el-form-item>
<el-form-item label="Autofollowed nicknames">
<el-select :value="instance.autofollowed_nicknames || []" multiple placeholder="Select" @change="updateSetting($event, 'instance', 'autofollowed_nicknames')">
<el-select :value="instance.autofollowed_nicknames || []" multiple filterable allow-create @change="updateSetting($event, 'instance', 'autofollowed_nicknames')">
<el-option
v-for="item in autofollowedNicknamesOptions"
:key="item.value"
......@@ -214,7 +222,7 @@
<p class="expl">Skip filter out broken threads.</p>
</el-form-item>
<el-form-item label="Limit to local content">
<el-select :value="instance.limit_to_local_content" @change="updateSetting($event, 'instance', 'limit_to_local_content')">
<el-select :value="instance.limit_to_local_content" clearable @change="updateSetting($event, 'instance', 'limit_to_local_content')">
<el-option label="Unauthenticated" value=":unauthenticated"/>
<el-option label="All" value=":all"/>
<el-option label="False" value="false"/>
......@@ -224,6 +232,22 @@
<el-switch :value="instance.dynamic_configuration" @change="updateSetting($event, 'instance', 'dynamic_configuration')"/>
<p class="expl">Allow transferring configuration to DB with the subsequent customization from Admin API</p>
</el-form-item>
<el-form-item label="Max account fields">
<el-input-number :value="instance.max_account_fields" :step="1" :min="0" size="large" @change="updateSetting($event, 'instance', 'max_account_fields')"/>
<p class="expl">The maximum number of custom fields in the user profile (Default: 4)</p>
</el-form-item>
<el-form-item label="Max remote account fields">
<el-input-number :value="instance.max_remote_account_fields" :step="1" :min="0" size="large" @change="updateSetting($event, 'instance', 'max_remote_account_fields')"/>
<p class="expl">The maximum number of custom fields in the remote user profile (Default: 10)</p>
</el-form-item>
<el-form-item label="Account field name length">
<el-input-number :value="instance.account_field_name_length" :step="1" :min="0" size="large" @change="updateSetting($event, 'instance', 'account_field_name_length')"/>
<p class="expl">An account field name maximum length (Default: 255)</p>
</el-form-item>
<el-form-item label="Account field value length">
<el-input-number :value="instance.account_field_value_length" :step="1" :min="0" size="large" @change="updateSetting($event, 'instance', 'account_field_value_length')"/>
<p class="expl">An account field value maximum length (Default: 255)</p>
</el-form-item>
<el-form-item label="External user synchronization">
<el-switch :value="instance.external_user_synchronization" @change="updateSetting($event, 'instance', 'external_user_synchronization')"/>
<p class="expl">Enabling following/followers counters synchronization for external users.</p>
......@@ -232,7 +256,7 @@
<div class="line"/>
<el-form ref="uriSchemes" :model="uriSchemes" :label-width="labelWidth">
<el-form-item label="URI schemes">
<el-select :value="uriSchemes.valid_schemes || []" multiple filterable allow-create placeholder="Select" @change="updateSetting($event, 'uri_schemes', 'valid_schemes')">
<el-select :value="uriSchemes.valid_schemes || []" multiple filterable allow-create @change="updateSetting($event, 'uri_schemes', 'valid_schemes')">
<el-option
v-for="item in uriSchemesOptions"
:key="item.value"
......
......@@ -2,7 +2,7 @@
<div>
<el-form ref="loggerBackends" :model="loggerBackends" :label-width="labelWidth">
<el-form-item label="Backends">
<el-select :value="loggerBackendsValue" multiple @change="updateloggerBackends($event, 'backends', 'value')">
<el-select :value="loggerBackendsValue" multiple filterable allow-create @change="updateloggerBackends($event, 'backends', 'value')">
<el-option
v-for="(item, index) in loggerBackendsOptions"
:key="index"
......@@ -16,7 +16,7 @@
<el-form ref="consoleLogger" :model="consoleLogger" :label-width="labelWidth">
<el-form-item label="Console logger:"/>
<el-form-item label="Level">
<el-select :value="consoleLogger.level" @change="updateSetting($event, 'console', 'level')">
<el-select :value="consoleLogger.level" clearable @change="updateSetting($event, 'console', 'level')">
<el-option value=":debug" label=":debug - for debug-related messages"/>
<el-option value=":info" label=":info - for information of any kind"/>
<el-option value=":warn" label=":warn - for warnings"/>
......@@ -79,7 +79,7 @@
<el-form ref="exsyslogger" :model="exsyslogger" :label-width="labelWidth">
<el-form-item label="ExSyslogger:"/>
<el-form-item label="Level">
<el-select :value="exsyslogger.level" @change="updateSetting($event, 'ex_syslogger', 'level')">
<el-select :value="exsyslogger.level" clearable @change="updateSetting($event, 'ex_syslogger', 'level')">
<el-option value=":debug" label=":debug - for debug-related messages"/>
<el-option value=":info" label=":info - for information of any kind"/>
<el-option value=":warn" label=":warn - for warnings"/>
......@@ -120,7 +120,7 @@
<p class="expl">Syslog facility to be used. It defaults to <span class="code">:local0</span></p>
</el-form-item>
<el-form-item label="Options">
<el-select :value="exsyslogger.option || []" multiple @change="updateSetting($event, 'ex_syslogger', 'option')">
<el-select :value="exsyslogger.option || []" multiple filterable allow-create @change="updateSetting($event, 'ex_syslogger', 'option')">
<el-option value=":pid"/>
<el-option value=":cons"/>
<el-option value=":odelay"/>
......@@ -139,7 +139,7 @@
</el-form>
<el-form ref="level" :model="level" :label-width="labelWidth">
<el-form-item label="Level">
<el-select :value="level.value" @change="updateSetting($event, 'level', 'value')">
<el-select :value="level.value" clearable @change="updateSetting($event, 'level', 'value')">
<el-option value=":debug" label=":debug - for debug-related messages"/>
<el-option value=":info" label=":info - for information of any kind"/>
<el-option value=":warn" label=":warn - for warnings"/>
......
......@@ -124,6 +124,18 @@
<el-form-item label="Scrub policy">
<el-input :value="mrfNormalizeMarkup.scrub_policy" @input="updateSetting($event, 'mrf_normalize_markup', 'scrub_policy')"/>
</el-form-item>
</el-form>
<div class="line"/>
<el-form ref="mrfVocabulary" :model="mrfVocabulary" :label-width="labelWidth">
<el-form-item label="MRF Vocabulary:"/>
<el-form-item label="Accept">
<el-select :value="mrfVocabulary.accept || []" multiple allow-create filterable @change="updateSetting($event, 'mrf_vocabulary', 'accept')"/>
<p class="expl">A list of ActivityStreams terms to accept. If empty, all supported messages are accepted.</p>
</el-form-item>
<el-form-item label="Reject">
<el-select :value="mrfVocabulary.reject || []" multiple allow-create filterable @change="updateSetting($event, 'mrf_vocabulary', 'reject')"/>
<p class="expl">A list of ActivityStreams terms to reject. If empty, no messages are rejected.</p>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">Submit</el-button>
</el-form-item>
......@@ -153,7 +165,8 @@ export default {
'mrfSimple',
'mrfSubchain',
'mrfRejectnonpublic',
'mrfUserAllowlist'
'mrfUserAllowlist',
'mrfVocabulary'
]),
matchActor() {
return Object.keys(this.mrfSubchain.match_actor).map(key => [key, this.mrfSubchain.match_actor[key]])
......
<template>
<div>
<el-form ref="mailer" :model="mailer" :label-width="labelWidth">
<el-form-item label="Enabled">
<el-switch :value="mailer.enabled" @change="updateSetting($event, 'Pleroma.Emails.Mailer', 'enabled')"/>
<p class="expl">Allows to enable or disable sending emails. Defaults to false.</p>
</el-form-item>
<el-form-item label="Adapter">
<el-select :value="mailer.adapter" @change="updateSetting($event, 'Pleroma.Emails.Mailer', 'adapter')">
<el-select :value="mailer.adapter" clearable @change="updateSetting($event, 'Pleroma.Emails.Mailer', 'adapter')">
<el-option
v-for="item in adapterOptions"
:key="item.value"
......@@ -130,10 +131,74 @@
<el-input :value="mailer.access_token" @input="updateSetting($event, 'Pleroma.Emails.Mailer', 'access_token')"/>
</el-form-item>
</div>
</el-form>
<el-form ref="emailNotifications" :model="emailNotifications" :label-width="labelWidth">
<el-form-item label="Email notifications"/>
<el-form-item label="Digest:"/>
<el-form-item label="Active">
<el-switch :value="emailNotifications.digest.active" @change="processNestedData($event, 'email_notifications', 'digest', 'active')"/>
<p class="expl">Globally enable or disable digest emails.</p>
</el-form-item>
<el-form-item label="Schedule">
<el-input :value="emailNotifications.digest.schedule" @input="processNestedData($event, 'email_notifications', 'digest', 'schedule')"/>
<p class="expl">When to send digest email, in <a
href="https://en.wikipedia.org/wiki/Cron"
rel="nofollow noreferrer noopener"
target="_blank">
crontab format
</a>.
"0 0 * * 0" is the default, meaning "once a week at midnight on Sunday morning"</p>
</el-form-item>
<el-form-item label="Interval">
<el-input-number :value="emailNotifications.digest.interval" :step="1" :min="0" size="large" @change="processNestedData($event, 'email_notifications', 'digest', 'interval')"/>
<p class="expl">Minimum interval between digest emails to one user.</p>
</el-form-item>
<el-form-item label="Inactivity threshold">
<el-input-number :value="emailNotifications.digest.inactivity_threshold" :step="1" :min="0" size="large" @change="processNestedData($event, 'email_notifications', 'digest', 'inactivity_threshold')"/>
<p class="expl">Minimum user inactivity threshold.</p>
</el-form-item>
</el-form>
<div class="line"/>
<el-form ref="userEmail" :model="userEmail" :label-width="labelWidth">
<el-form-item label="Digest template styles:"/>
<el-form-item label="Logo">
<el-input :value="userEmail.logo" @input="updateSetting($event, 'Pleroma.Emails.UserEmail', 'logo')"/>
<div class="upload-container">
<p class="text">or</p>
<el-upload
:http-request="sendEmailLogo"
:multiple="false"
:show-file-list="false"
action="/api/v1/media">
<el-button size="small" type="primary">Click to upload</el-button>
</el-upload>
</div>
<p class="expl">A path to a custom logo.</p>
</el-form-item>
<el-form-item label="Styling:"/>
<el-form-item label="Link color">
<el-input :value="userEmail.styling.link_color" @input="processNestedData($event, 'Pleroma.Emails.UserEmail', 'styling', 'link_color')"/>
</el-form-item>
<el-form-item label="Background color">
<el-input :value="userEmail.styling.background_color" @input="processNestedData($event, 'Pleroma.Emails.UserEmail', 'styling', 'background_color')"/>
</el-form-item>
<el-form-item label="Content background color">
<el-input :value="userEmail.styling.content_background_color" @input="processNestedData($event, 'Pleroma.Emails.UserEmail', 'styling', 'content_background_color')"/>
</el-form-item>
<el-form-item label="Header color">
<el-input :value="userEmail.styling.header_color" @input="processNestedData($event, 'Pleroma.Emails.UserEmail', 'styling', 'header_color')"/>
</el-form-item>
<el-form-item label="Text color">
<el-input :value="userEmail.styling.text_color" @input="processNestedData($event, 'Pleroma.Emails.UserEmail', 'styling', 'text_color')"/>
</el-form-item>
<el-form-item label="Text muted color">
<el-input :value="userEmail.styling.text_muted_color" @input="processNestedData($event, 'Pleroma.Emails.UserEmail', 'styling', 'text_muted_color')"/>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">Submit</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
......@@ -151,7 +216,9 @@ export default {
},
computed: {
...mapGetters([
'mailer'
'emailNotifications',
'mailer',
'userEmail'
]),
editorContent: {
get: function() {
......@@ -172,6 +239,13 @@ export default {
}
},
methods: {
processNestedData(value, tab, inputName, childName) {
const updatedValue = { ...this.$store.state.settings.settings[tab][inputName], ...{ [childName]: value }}
this.updateSetting(updatedValue, tab, inputName)
},
sendEmailLogo({ file }) {
this.$store.dispatch('UploadMedia', { file, tab: 'Pleroma.Emails.UserEmail', inputName: 'logo' })
},
updateSetting(value, tab, input) {
this.$store.dispatch('UpdateSettings', { tab, data: { [input]: value }})
},
......
......@@ -23,7 +23,7 @@
<p class="expl">The total time the connection is allowed to read from the remote upstream</p>
</el-form-item>
<el-form-item label="Inline content types">
<el-select :value="inlineContentTypes" @change="processNestedData($event, 'media_proxy', 'proxy_opts', 'inline_content_types')">
<el-select :value="inlineContentTypes" clearable @change="processNestedData($event, 'media_proxy', 'proxy_opts', 'inline_content_types')">
<el-option :value="true" label="True"/>
<el-option :value="false" label="False"/>
<el-option value="whitelistedTypeArray" label="List of whitelisted content types"/>
......@@ -37,7 +37,7 @@
</p>
</el-form-item>
<el-form-item v-if="inlineContentTypes === 'whitelistedTypeArray'" label="Whitelisted content types">
<el-select :value="whitelistedContentTypes" multiple @change="processNestedData($event, 'media_proxy', 'proxy_opts', 'inline_content_types')">
<el-select :value="whitelistedContentTypes" multiple filterable allow-create @change="processNestedData($event, 'media_proxy', 'proxy_opts', 'inline_content_types')">
<el-option
v-for="item in whitelistedContentTypesOptions"
:label="item.label"
......@@ -54,7 +54,7 @@
<el-switch :value="http.follow_redirect" @change="processHttpSettings($event, 'media_proxy', 'proxy_opts', 'http', 'follow_redirect')"/>
</el-form-item>
<el-form-item label="Pool">
<el-select :value="http.pool" @change="processHttpSettings($event, 'media_proxy', 'proxy_opts', 'http', 'pool')">
<el-select :value="http.pool" clearable @change="processHttpSettings($event, 'media_proxy', 'proxy_opts', 'http', 'pool')">
<el-option
v-for="item in hackneyPoolsOptions"
:label="item.label"
......
......@@ -2,7 +2,7 @@
<div>
<el-form ref="metadata" :model="metadata" :label-width="labelWidth">
<el-form-item label="Providers">
<el-select :value="metadata.providers || []" multiple @change="updateSetting($event, 'Pleroma.Web.Metadata', 'providers')">
<el-select :value="metadata.providers || []" multiple filterable allow-create @change="updateSetting($event, 'Pleroma.Web.Metadata', 'providers')">
<el-option value="Pleroma.Web.Metadata.Providers.OpenGraph"/>
<el-option value="Pleroma.Web.Metadata.Providers.TwitterCard"/>
<el-option value="Pleroma.Web.Metadata.Providers.RelMe"/>
......
......@@ -192,6 +192,30 @@
</div>
</div>
</el-form-item>
<el-form-item label="Activity pub routes:">
<div v-if="!activityPubRoutesAuthUsers">
<el-input :value="activityPubRoutesAllUsers[0]" placeholder="scale" class="scale-input" @input="parseRateLimiter($event, 'ap_routes', 'scale', 'oneLimit', activityPubRoutesAllUsers)"/> :
<el-input :value="activityPubRoutesAllUsers[1]" placeholder="limit" class="limit-input" @input="parseRateLimiter($event, 'ap_routes', 'limit', 'oneLimit', activityPubRoutesAllUsers)"/>
<div class="limit-button-container">
<el-button icon="el-icon-plus" circle @click="toggleLimits([{ 'tuple': [null, null] }, { 'tuple': [null, null] }], 'ap_routes')"/>
<p class="expl limit-expl">Set different limits for unauthenticated and authenticated users</p>
</div>
</div>
<div v-if="activityPubRoutesAuthUsers">
<el-form-item label="Authenticated users:">
<el-input :value="activityPubRoutesAuthUsers[0]" placeholder="scale" class="scale-input" @input="parseRateLimiter($event, 'ap_routes', 'scale', 'authUserslimit', [activityPubRoutesUnauthUsers, activityPubRoutesAuthUsers])"/> :
<el-input :value="activityPubRoutesAuthUsers[1]" placeholder="limit" class="limit-input" @input="parseRateLimiter($event, 'ap_routes', 'limit', 'authUserslimit', [activityPubRoutesUnauthUsers, activityPubRoutesAuthUsers])"/>
</el-form-item>
<el-form-item label="Unauthenticated users:">
<el-input :value="activityPubRoutesUnauthUsers[0]" placeholder="scale" class="scale-input" @input="parseRateLimiter($event, 'ap_routes', 'scale', 'unauthUsersLimit', [activityPubRoutesUnauthUsers, activityPubRoutesAuthUsers])"/> :
<el-input :value="activityPubRoutesUnauthUsers[1]" placeholder="limit" class="limit-input" @input="parseRateLimiter($event, 'ap_routes', 'limit', 'unauthUsersLimit', [activityPubRoutesUnauthUsers, activityPubRoutesAuthUsers])"/>
</el-form-item>
<div class="limit-button-container">
<el-button icon="el-icon-minus" circle @click="toggleLimits({ 'tuple': [null, null] }, 'ap_routes')"/>
<p class="expl limit-expl">Set limit for all users</p>
</div>
</div>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">Submit</el-button>
</el-form-item>
......@@ -221,6 +245,19 @@ export default {
? this.rateLim