diff --git a/package.json b/package.json index 8d5cd449e3996e4e029c2931b41bf9dab73fe6f7..876205ca49ff415ab45d6663e80dd153030149d8 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "localforage": "^1.7.3", "lodash": "^4.17.11", "lodash.debounce": "^4.0.8", + "marked": "^0.8.0", "moment": "^2.24.0", "normalize.css": "7.0.0", "nprogress": "0.2.0", diff --git a/src/store/modules/normalizers.js b/src/store/modules/normalizers.js index 6d0efe29f6c3a145d1088fb384a016a23b7fc64d..123847aab1988942306466afef5d3a6191402515 100644 --- a/src/store/modules/normalizers.js +++ b/src/store/modules/normalizers.js @@ -138,10 +138,7 @@ const parseProxyUrl = value => { } const partialUpdate = (group, key) => { - if (group === ':auto_linker' && key === ':opts') { - return false - } - return true + return !(group === ':auto_linker' && key === ':opts') } export const processNested = (valueForState, valueForUpdatedSettings, group, parentKey, parents, settings, updatedSettings) => { diff --git a/src/store/modules/settings.js b/src/store/modules/settings.js index c102c6eb94dbb87acd8661dfd0e38f8aa06e776f..06c9cebaf296f9bec724ffd7d4aaa93f1c53fb37 100644 --- a/src/store/modules/settings.js +++ b/src/store/modules/settings.js @@ -95,6 +95,9 @@ const settings = { if (key === 'Pleroma.Emails.Mailer' && input === ':adapter') { const subkeys = Object.keys(state.settings[group][key]).filter(el => el !== ':adapter') await removeSettings([{ group, key, delete: true, subkeys }], getters.authHost, getters.token) + } else if (key === 'Pleroma.Upload' && input === ':uploader') { + const deletedKey = value === 'Pleroma.Uploaders.Local' ? 'Pleroma.Uploaders.S3' : 'Pleroma.Uploaders.Local' + await removeSettings([{ group, key: deletedKey, delete: true }], getters.authHost, getters.token) } key ? commit('UPDATE_STATE', { group, key, input, value }) diff --git a/src/views/settings/components/ActivityPub.vue b/src/views/settings/components/ActivityPub.vue index 2eb9a654170e36c05ab3c248f4334299b994bf38..56a57b9a66916fb80b938191e4e2bb556170dd0a 100644 --- a/src/views/settings/components/ActivityPub.vue +++ b/src/views/settings/components/ActivityPub.vue @@ -1,15 +1,15 @@ <template> - <div v-if="!loading"> + <div v-if="!loading" class="form-container"> <el-form ref="activitypubData" :model="activitypubData" :label-width="labelWidth"> <setting :setting-group="activitypub" :data="activitypubData"/> </el-form> <div class="line"/> <el-form ref="userData" :model="userData" :label-width="labelWidth"> <setting :setting-group="user" :data="userData"/> - <el-form-item> - <el-button type="primary" @click="onSubmit">Submit</el-button> - </el-form-item> </el-form> + <div class="submit-button-container"> + <el-button class="submit-button" type="primary" @click="onSubmit">Submit</el-button> + </div> </div> </template> diff --git a/src/views/settings/components/Authentication.vue b/src/views/settings/components/Authentication.vue index f88b5b40f4d76fe0f3534dbd5da4c914592eb924..fa517f35d28f2ecf7c13f17a3afad530f759f09a 100644 --- a/src/views/settings/components/Authentication.vue +++ b/src/views/settings/components/Authentication.vue @@ -1,5 +1,5 @@ <template> - <div v-if="!loading"> + <div v-if="!loading" class="form-container"> <el-form ref="pleromaAuthenticatorData" :model="pleromaAuthenticatorData" :label-width="labelWidth"> <setting :setting-group="pleromaAuthenticator" :data="pleromaAuthenticatorData"/> </el-form> @@ -14,10 +14,10 @@ <div class="line"/> <el-form ref="oauth2" :model="oauth2Data" :label-width="labelWidth"> <setting :setting-group="oauth2" :data="oauth2Data"/> - <el-form-item> - <el-button type="primary" @click="onSubmit">Submit</el-button> - </el-form-item> </el-form> + <div class="submit-button-container"> + <el-button class="submit-button" type="primary" @click="onSubmit">Submit</el-button> + </div> </div> </template> @@ -62,7 +62,7 @@ export default { return _.get(this.settings.settings, [':pleroma', ':oauth2']) || {} }, pleromaAuthenticator() { - return this.settings.description.find(setting => setting.description === 'Authenticator') + return this.settings.description.find(setting => setting.children && setting.children[0].key === 'Pleroma.Web.Auth.Authenticator') }, pleromaAuthenticatorData() { return _.get(this.settings.settings, [':pleroma', 'Pleroma.Web.Auth.Authenticator']) || {} diff --git a/src/views/settings/components/AutoLinker.vue b/src/views/settings/components/AutoLinker.vue index e5fb7529ef7821dd7bfc9bc5c50a921289099656..18ebabc3fd8b2f77509d88cb46dd81a9201b6267 100644 --- a/src/views/settings/components/AutoLinker.vue +++ b/src/views/settings/components/AutoLinker.vue @@ -1,10 +1,12 @@ <template> - <el-form v-if="!loading" ref="autoLinker" :model="autoLinkerData" :label-width="labelWidth"> - <setting :setting-group="autoLinker" :data="autoLinkerData"/> - <el-form-item> - <el-button type="primary" @click="onSubmit">Submit</el-button> - </el-form-item> - </el-form> + <div v-if="!loading" class="form-container"> + <el-form ref="autoLinker" :model="autoLinkerData" :label-width="labelWidth"> + <setting :setting-group="autoLinker" :data="autoLinkerData"/> + </el-form> + <div class="submit-button-container"> + <el-button class="submit-button" type="primary" @click="onSubmit">Submit</el-button> + </div> + </div> </template> <script> diff --git a/src/views/settings/components/Captcha.vue b/src/views/settings/components/Captcha.vue index 5a942793899e054d51b07149f040919bc6741088..cc150337eaa0cbef9f44a284494562939744bfda 100644 --- a/src/views/settings/components/Captcha.vue +++ b/src/views/settings/components/Captcha.vue @@ -1,15 +1,15 @@ <template> - <div v-if="!loading"> + <div v-if="!loading" class="form-container"> <el-form ref="captchaData" :model="captchaData" :label-width="labelWidth"> <setting :setting-group="captcha" :data="captchaData"/> </el-form> <div class="line"/> <el-form ref="kocaptchaData" :model="kocaptchaData" :label-width="labelWidth"> <setting :setting-group="kocaptcha" :data="kocaptchaData"/> - <el-form-item> - <el-button type="primary" @click="onSubmit">Submit</el-button> - </el-form-item> </el-form> + <div class="submit-button-container"> + <el-button class="submit-button" type="primary" @click="onSubmit">Submit</el-button> + </div> </div> </template> diff --git a/src/views/settings/components/Esshd.vue b/src/views/settings/components/Esshd.vue index 6ca3ae15e3b2ecfad150a734789af273e6d02eec..38b0865ee20d0bc63cd16c5e89bd8511360bad9d 100644 --- a/src/views/settings/components/Esshd.vue +++ b/src/views/settings/components/Esshd.vue @@ -1,18 +1,11 @@ <template> - <div v-if="!loading"> + <div v-if="!loading" class="form-container"> <el-form ref="esshdData" :model="esshdData" :label-width="labelWidth"> <setting :setting-group="esshd" :data="esshdData"/> - <el-form-item> - <p class="expl">Feel free to adjust the priv_dir and port number. - Then you will have to create the key for the keys (in the example <span class="code">priv/ssh_keys</span>) and create the host keys with - <span class="code">ssh-keygen -m PEM -N "" -b 2048 -t rsa -f ssh_host_rsa_key</span>. - After restarting, you should be able to connect to your Pleroma instance with <span class="code">ssh username@server -p $PORT</span> - </p> - </el-form-item> - <el-form-item> - <el-button type="primary" @click="onSubmit">Submit</el-button> - </el-form-item> </el-form> + <div class="submit-button-container"> + <el-button class="submit-button" type="primary" @click="onSubmit">Submit</el-button> + </div> </div> </template> diff --git a/src/views/settings/components/Frontend.vue b/src/views/settings/components/Frontend.vue index 72c236a8304e19a95985356ef1d26cdc48fbc527..3931a2c8e247fd60feea091138b15c5dcd98170b 100644 --- a/src/views/settings/components/Frontend.vue +++ b/src/views/settings/components/Frontend.vue @@ -1,5 +1,5 @@ <template> - <div v-if="!loading"> + <div v-if="!loading" class="form-container"> <el-form ref="frontendData" :model="frontendData" :label-width="labelWidth"> <setting :setting-group="frontend" :data="frontendData"/> </el-form> @@ -20,10 +20,10 @@ <el-form ref="markupData" :model="markupData" :label-width="labelWidth"> <el-form-item label="Markup settings:"/> <setting :setting-group="markup" :data="markupData"/> - <el-form-item> - <el-button type="primary" @click="onSubmit">Submit</el-button> - </el-form-item> </el-form> + <div class="submit-button-container"> + <el-button class="submit-button" type="primary" @click="onSubmit">Submit</el-button> + </div> </div> </template> diff --git a/src/views/settings/components/Gopher.vue b/src/views/settings/components/Gopher.vue index 97b531fc7407f2218732647e9ad7ba7b41ad17ae..04aec56502159a2f92be769d690d206dd37a0000 100644 --- a/src/views/settings/components/Gopher.vue +++ b/src/views/settings/components/Gopher.vue @@ -1,10 +1,12 @@ <template> - <el-form v-if="!loading" ref="gopher" :model="gopherData" :label-width="labelWidth"> - <setting :setting-group="gopher" :data="gopherData"/> - <el-form-item> - <el-button type="primary" @click="onSubmit">Submit</el-button> - </el-form-item> - </el-form> + <div v-if="!loading" class="form-container"> + <el-form v-if="!loading" ref="gopher" :model="gopherData" :label-width="labelWidth"> + <setting :setting-group="gopher" :data="gopherData"/> + </el-form> + <div class="submit-button-container"> + <el-button class="submit-button" type="primary" @click="onSubmit">Submit</el-button> + </div> + </div> </template> <script> diff --git a/src/views/settings/components/Http.vue b/src/views/settings/components/Http.vue index 7c6292ead48028c29d2282291008649f8262314c..afbf79c6eafdd344968b3659ef8156f3dfb30520 100644 --- a/src/views/settings/components/Http.vue +++ b/src/views/settings/components/Http.vue @@ -1,5 +1,5 @@ <template> - <div v-if="!loading"> + <div v-if="!loading" class="form-container"> <el-form ref="httpData" :model="httpData" :label-width="labelWidth"> <setting :setting-group="http" :data="httpData"/> </el-form> @@ -18,10 +18,10 @@ <div class="line"/> <el-form ref="webCacheTtl" :model="webCacheTtlData" :label-width="labelWidth"> <setting :setting-group="webCacheTtl" :data="webCacheTtlData"/> - <el-form-item> - <el-button type="primary" @click="onSubmit">Submit</el-button> - </el-form-item> </el-form> + <div class="submit-button-container"> + <el-button class="submit-button" type="primary" @click="onSubmit">Submit</el-button> + </div> </div> </template> diff --git a/src/views/settings/components/Inputs.vue b/src/views/settings/components/Inputs.vue index 760d2c2cd847989d97cd2eb8cbce790a1f0458c8..1f5a79c6fa6760a5abed9e355db1965a195829c0 100644 --- a/src/views/settings/components/Inputs.vue +++ b/src/views/settings/components/Inputs.vue @@ -77,7 +77,11 @@ <prune-input v-if="setting.key === ':prune'" :data="data[setting.key]" :setting-group="settingGroup" :setting="setting"/> <rate-limit-input v-if="settingGroup.key === ':rate_limit'" :data="data" :setting-group="settingGroup" :setting="setting"/> <!--------------------> - <p v-if="setting.type !== 'keyword'" :class="inputClass" class="expl">{{ setting.description }}</p> + <span + v-if="setting.description && setting.type !== 'keyword'" + :class="inputClass" + class="expl" + v-html="getFormattedDescription(setting.description)"/> </el-form-item> </template> @@ -86,6 +90,7 @@ import i18n from '@/lang' import { AutoLinkerInput, EditableKeywordInput, IconsInput, MascotsInput, MultipleSelect, ProxyUrlInput, PruneInput, RateLimitInput } from './inputComponents' import { processNested } from '@/store/modules/normalizers' import _ from 'lodash' +import marked from 'marked' export default { name: 'Inputs', @@ -203,6 +208,9 @@ export default { type === 'map' || (Array.isArray(type) && type.includes('keyword') && type.findIndex(el => el.includes('list') && el.includes('string')) !== -1) }, + getFormattedDescription(desc) { + return marked(desc) + }, processNestedData(value, group, parentKey, parents) { const { valueForState, valueForUpdatedSettings, diff --git a/src/views/settings/components/Instance.vue b/src/views/settings/components/Instance.vue index 5a8350bff60f4d81ef3b9d785b4fca3a11936dc1..904fc088cbf5935b82c3c2dffda08c07e3391bd8 100644 --- a/src/views/settings/components/Instance.vue +++ b/src/views/settings/components/Instance.vue @@ -1,13 +1,9 @@ <template> - <div v-if="!loading"> + <div v-if="!loading" class="form-container"> <el-form ref="instanceData" :model="instanceData" :label-width="labelWidth"> <setting :setting-group="instance" :data="instanceData"/> </el-form> <div class="line"/> - <el-form ref="uriSchemes" :model="uriSchemesData" :label-width="labelWidth"> - <setting :setting-group="uriSchemes" :data="uriSchemesData"/> - </el-form> - <div class="line"/> <el-form ref="adminToken" :model="adminTokenData" :label-width="labelWidth"> <setting :setting-group="adminToken" :data="adminTokenData"/> </el-form> @@ -31,10 +27,10 @@ <div class="line"/> <el-form ref="pleromaUser" :model="pleromaUserData" :label-width="labelWidth"> <setting :setting-group="pleromaUser" :data="pleromaUserData"/> - <el-form-item> - <el-button type="primary" @click="onSubmit">Submit</el-button> - </el-form-item> </el-form> + <div class="submit-button-container"> + <el-button class="submit-button" type="primary" @click="onSubmit">Submit</el-button> + </div> </div> </template> @@ -54,7 +50,7 @@ export default { 'settings' ]), adminToken() { - return this.settings.description.find(setting => setting.description === `Allows to set a token that can be used to authenticate with the admin api without using an actual user by giving it as the 'admin_token' parameter`) + return this.settings.description.find(setting => setting.children && setting.children[0].key === ':admin_token') }, adminTokenData() { return _.get(this.settings.settings, [':pleroma', ':admin_token']) || {} @@ -103,12 +99,6 @@ export default { }, suggestionsData() { return _.get(this.settings.settings, [':pleroma', ':suggestions']) || {} - }, - uriSchemes() { - return this.$store.state.settings.description.find(setting => setting.key === ':uri_schemes') - }, - uriSchemesData() { - return _.get(this.settings.settings, [':pleroma', ':uri_schemes']) || {} } }, methods: { diff --git a/src/views/settings/components/JobQueue.vue b/src/views/settings/components/JobQueue.vue index 41a11015746d787a83acefe576d1d35c3e65f282..f823d63a7e24e7ce4a559349c71b41dca0f931ca 100644 --- a/src/views/settings/components/JobQueue.vue +++ b/src/views/settings/components/JobQueue.vue @@ -1,5 +1,5 @@ <template> - <div v-if="!loading"> + <div v-if="!loading" class="form-container"> <el-form ref="obanQueuesData" :model="obanQueuesData" :label-width="labelWidth"> <setting :setting-group="obanQueues" :data="obanQueuesData"/> </el-form> @@ -8,10 +8,10 @@ </el-form> <el-form ref="activityExpiration" :model="activityExpirationData" :label-width="labelWidth"> <setting :setting-group="activityExpiration" :data="activityExpirationData"/> - <el-form-item> - <el-button type="primary" @click="onSubmit">Submit</el-button> - </el-form-item> </el-form> + <div class="submit-button-container"> + <el-button class="submit-button" type="primary" @click="onSubmit">Submit</el-button> + </div> </div> </template> diff --git a/src/views/settings/components/Logger.vue b/src/views/settings/components/Logger.vue index 0dd308a416d8b6982c7128b188fbc6ea98d15c2e..aa7e361a0dad5d6678ca2d0045e4a500293e125c 100644 --- a/src/views/settings/components/Logger.vue +++ b/src/views/settings/components/Logger.vue @@ -1,5 +1,5 @@ <template> - <div v-if="!loading"> + <div v-if="!loading" class="form-container"> <el-form ref="loggerData" :model="loggerData" :label-width="labelWidth"> <setting :setting-group="logger" :data="loggerData"/> </el-form> @@ -15,10 +15,10 @@ <el-form ref="quackData" :model="quackData" :label-width="labelWidth"> <el-form-item label="Quack logger:"/> <setting :setting-group="quack" :data="quackData"/> - <el-form-item> - <el-button type="primary" @click="onSubmit">Submit</el-button> - </el-form-item> </el-form> + <div class="submit-button-container"> + <el-button class="submit-button" type="primary" @click="onSubmit">Submit</el-button> + </div> </div> </template> diff --git a/src/views/settings/components/MRF.vue b/src/views/settings/components/MRF.vue index 3c1584cc0a312d68dc1cd80402403756c2f5d248..8e49ca84b87b91b2ab7ed2be8cd3de530baac38d 100644 --- a/src/views/settings/components/MRF.vue +++ b/src/views/settings/components/MRF.vue @@ -1,5 +1,5 @@ <template> - <div v-if="!loading"> + <div v-if="!loading" class="form-container"> <el-form ref="mrfSimple" :model="mrfSimpleData" :label-width="labelWidth"> <setting :setting-group="mrfSimple" :data="mrfSimpleData"/> </el-form> @@ -28,10 +28,10 @@ <div class="line"/> <el-form ref="mrfVocabulary" :model="mrfVocabularyData" :label-width="labelWidth"> <setting :setting-group="mrfVocabulary" :data="mrfVocabularyData"/> - <el-form-item> - <el-button type="primary" @click="onSubmit">Submit</el-button> - </el-form-item> </el-form> + <div class="submit-button-container"> + <el-button class="submit-button" type="primary" @click="onSubmit">Submit</el-button> + </div> </div> </template> diff --git a/src/views/settings/components/Mailer.vue b/src/views/settings/components/Mailer.vue index 78be7eabaf1e81226bbab91efd6eea51bd8ea7d5..438129520402e5746cf2e053a393ad5ed84f31a0 100644 --- a/src/views/settings/components/Mailer.vue +++ b/src/views/settings/components/Mailer.vue @@ -1,5 +1,5 @@ <template> - <div v-if="!loading"> + <div v-if="!loading" class="form-container"> <el-form ref="mailer" :model="mailerData" :label-width="labelWidth"> <setting :setting-group="mailer" :data="mailerData"/> </el-form> @@ -9,10 +9,10 @@ </el-form> <el-form ref="userEmail" :model="userEmail" :label-width="labelWidth"> <setting :setting-group="userEmail" :data="userEmailData"/> - <el-form-item> - <el-button type="primary" @click="onSubmit">Submit</el-button> - </el-form-item> </el-form> + <div class="submit-button-container"> + <el-button class="submit-button" type="primary" @click="onSubmit">Submit</el-button> + </div> </div> </template> diff --git a/src/views/settings/components/MediaProxy.vue b/src/views/settings/components/MediaProxy.vue index 0811df50fd52af54e76c2752a26c4e699a66e8a2..a249ba29e31af5b7f6b9301b7d2fabf77539d17c 100644 --- a/src/views/settings/components/MediaProxy.vue +++ b/src/views/settings/components/MediaProxy.vue @@ -1,10 +1,12 @@ <template> - <el-form v-if="!loading" ref="mediaProxy" :model="mediaProxyData" :label-width="labelWidth"> - <setting :setting-group="mediaProxy" :data="mediaProxyData"/> - <el-form-item> - <el-button type="primary" @click="onSubmit">Submit</el-button> - </el-form-item> - </el-form> + <div v-if="!loading" class="form-container"> + <el-form v-if="!loading" ref="mediaProxy" :model="mediaProxyData" :label-width="labelWidth"> + <setting :setting-group="mediaProxy" :data="mediaProxyData"/> + </el-form> + <div class="submit-button-container"> + <el-button class="submit-button" type="primary" @click="onSubmit">Submit</el-button> + </div> + </div> </template> <script> diff --git a/src/views/settings/components/Metadata.vue b/src/views/settings/components/Metadata.vue index ff4b044819f24fefda1346d4688d0e22ad53a7c4..b43ab85ed5d9c97479f9c4b01e11b6dc3c825e5d 100644 --- a/src/views/settings/components/Metadata.vue +++ b/src/views/settings/components/Metadata.vue @@ -1,15 +1,15 @@ <template> - <div v-if="!loading"> + <div v-if="!loading" class="form-container"> <el-form ref="metadata" :model="metadataData" :label-width="labelWidth"> <setting :setting-group="metadata" :data="metadataData"/> </el-form> <div class="line"/> <el-form ref="richMedia" :model="richMediaData" :label-width="labelWidth"> <setting :setting-group="richMedia" :data="richMediaData"/> - <el-form-item> - <el-button type="primary" @click="onSubmit">Submit</el-button> - </el-form-item> </el-form> + <div class="submit-button-container"> + <el-button class="submit-button" type="primary" @click="onSubmit">Submit</el-button> + </div> </div> </template> diff --git a/src/views/settings/components/Other.vue b/src/views/settings/components/Other.vue index ebb21d51d33a3e034e5ffa9a28faec182dcb5375..0c0a797cfb4485f9ebb8432b5f2c7be2f1905b3d 100644 --- a/src/views/settings/components/Other.vue +++ b/src/views/settings/components/Other.vue @@ -1,5 +1,5 @@ <template> - <div v-if="!loading"> + <div v-if="!loading" class="form-container"> <el-form ref="teslaAdapter" :model="teslaAdapterData" :label-width="labelWidth"> <setting :setting-group="teslaAdapter" :data="teslaAdapterData"/> </el-form> @@ -9,10 +9,10 @@ </el-form> <el-form ref="remoteIp" :model="remoteIpData" :label-width="labelWidth"> <setting :setting-group="remoteIp" :data="remoteIpData"/> - <el-form-item> - <el-button type="primary" @click="onSubmit">Submit</el-button> - </el-form-item> </el-form> + <div class="submit-button-container"> + <el-button class="submit-button" type="primary" @click="onSubmit">Submit</el-button> + </div> </div> </template> diff --git a/src/views/settings/components/RateLimiters.vue b/src/views/settings/components/RateLimiters.vue index 224d22534f94599f70e21bc7d1773716367214bc..37ff5574cc061cdc181b089f258f4a88027a52e9 100644 --- a/src/views/settings/components/RateLimiters.vue +++ b/src/views/settings/components/RateLimiters.vue @@ -1,10 +1,12 @@ <template> - <el-form v-if="!loading" ref="rateLimiters" :model="rateLimitersData" :label-width="labelWidth"> - <setting :setting-group="rateLimiters" :data="rateLimitersData"/> - <el-form-item> - <el-button type="primary" @click="onSubmit">Submit</el-button> - </el-form-item> - </el-form> + <div v-if="!loading" class="form-container"> + <el-form v-if="!loading" ref="rateLimiters" :model="rateLimitersData" :label-width="labelWidth"> + <setting :setting-group="rateLimiters" :data="rateLimitersData"/> + </el-form> + <div class="submit-button-container"> + <el-button class="submit-button" type="primary" @click="onSubmit">Submit</el-button> + </div> + </div> </template> <script> diff --git a/src/views/settings/components/Setting.vue b/src/views/settings/components/Setting.vue index fb7b2252bbf3f2487c17667dd45501e8cf7b360d..82f8419f9c7109101bc63932f833f5fed436f458 100644 --- a/src/views/settings/components/Setting.vue +++ b/src/views/settings/components/Setting.vue @@ -1,7 +1,7 @@ <template> <div v-if="!loading"> <el-form-item v-if="settingGroup.description" class="description-container"> - <p class="description">{{ settingGroup.description }}</p> + <span class="description" v-html="getFormattedDescription(settingGroup.description)"/> </el-form-item> <div v-if="settingGroup.key === 'Pleroma.Emails.Mailer'"> <div v-for="setting in settingGroup.children.filter(setting => !setting.group)" :key="setting.key"> @@ -65,6 +65,7 @@ import Inputs from './Inputs' import i18n from '@/lang' import _ from 'lodash' +import marked from 'marked' export default { name: 'Setting', @@ -107,6 +108,9 @@ export default { type.includes('keyword') || key === ':replace' }, + getFormattedDescription(desc) { + return marked(desc) + }, async removeSetting(key) { const config = this.settingGroup.key ? [{ group: this.settingGroup.group, key: this.settingGroup.key, delete: true, subkeys: [key] }] diff --git a/src/views/settings/components/Upload.vue b/src/views/settings/components/Upload.vue index b31990b23df647a04c8a36eb25b7abc77053ecdd..a9a57619139969da71f129102554f722f5fc25d1 100644 --- a/src/views/settings/components/Upload.vue +++ b/src/views/settings/components/Upload.vue @@ -1,26 +1,29 @@ <template> - <div v-if="!loading"> + <div v-if="!loading" class="form-container"> <el-form ref="uploadData" :model="uploadData" :label-width="labelWidth"> <setting :setting-group="upload" :data="uploadData"/> </el-form> - <el-form ref="uploadersLocal" :model="uploadersLocalData" :label-width="labelWidth"> + <el-form v-if="showUploadersLocal" ref="uploadersLocal" :model="uploadersLocalData" :label-width="labelWidth"> + <el-form-item class="description-container description"> + <span class="description"><p>Pleroma.Uploaders.Local</p></span> + </el-form-item> <setting :setting-group="uploadersLocal" :data="uploadersLocalData"/> + <div class="line"/> </el-form> - <div class="line"/> - <el-form ref="uploadersS3" :model="uploadersS3Data" :label-width="labelWidth"> + <el-form v-if="showUploadersS3" ref="uploadersS3" :model="uploadersS3Data" :label-width="labelWidth"> <setting :setting-group="uploadersS3" :data="uploadersS3Data"/> + <div class="line"/> </el-form> - <div class="line"/> <el-form ref="uploadFilterMogrify" :model="uploadFilterMogrifyData" :label-width="labelWidth"> <setting :setting-group="uploadFilterMogrify" :data="uploadFilterMogrifyData"/> </el-form> <div class="line"/> <el-form ref="uploadAnonymizeFilename" :model="uploadAnonymizeFilenameData" :label-width="labelWidth"> <setting :setting-group="uploadAnonymizeFilename" :data="uploadAnonymizeFilenameData"/> - <el-form-item> - <el-button type="primary" @click="onSubmit">Submit</el-button> - </el-form-item> </el-form> + <div class="submit-button-container"> + <el-button class="submit-button" type="primary" @click="onSubmit">Submit</el-button> + </div> </div> </template> @@ -46,6 +49,14 @@ export default { loading() { return this.settings.loading }, + showUploadersS3() { + const uploader = _.get(this.settings.settings, [':pleroma', 'Pleroma.Upload', ':uploader']) + return uploader === 'Pleroma.Uploaders.S3' + }, + showUploadersLocal() { + const uploader = _.get(this.settings.settings, [':pleroma', 'Pleroma.Upload', ':uploader']) + return uploader === 'Pleroma.Uploaders.Local' + }, upload() { return this.settings.description.find(setting => setting.key === 'Pleroma.Upload') }, diff --git a/src/views/settings/components/WebPush.vue b/src/views/settings/components/WebPush.vue index dc03151a5348d0db05d3249fa697fe5c4fe3f297..9200fc31c19fcc7e4e9dc5298b9a0a65d7433832 100644 --- a/src/views/settings/components/WebPush.vue +++ b/src/views/settings/components/WebPush.vue @@ -1,10 +1,12 @@ <template> - <el-form v-if="!loading" ref="vapidDetailsData" :model="vapidDetailsData" :label-width="labelWidth"> - <setting :setting-group="vapidDetails" :data="vapidDetailsData"/> - <el-form-item> - <el-button type="primary" @click="onSubmit">Submit</el-button> - </el-form-item> - </el-form> + <div v-if="!loading" class="form-container"> + <el-form v-if="!loading" ref="vapidDetailsData" :model="vapidDetailsData" :label-width="labelWidth"> + <setting :setting-group="vapidDetails" :data="vapidDetailsData"/> + </el-form> + <div class="submit-button-container"> + <el-button class="submit-button" type="primary" @click="onSubmit">Submit</el-button> + </div> + </div> </template> <script> diff --git a/src/views/settings/styles/main.scss b/src/views/settings/styles/main.scss index 4ed52dfecad8baad3281a172e7f74d22162eb4e6..d0594549d5378f02b35c8ea058e1dd930c044ed5 100644 --- a/src/views/settings/styles/main.scss +++ b/src/views/settings/styles/main.scss @@ -2,19 +2,27 @@ a { text-decoration: underline; } + .center-label label { + text-align: center; + } .code { background-color: #adbed67a; border-radius: 3px; font-family: monospace; padding: 0 3px 0 3px; } - .description { + .description > p { font-size: 14px; color: #606266; font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei"; font-weight: 700; line-height: 20px; margin: 0 0 14px 0; + code { + display: inline; + padding: 2px 3px; + font-size: 14px; + } } .description-container { overflow-wrap: break-word; @@ -26,9 +34,6 @@ .el-form-item .rate-limit { margin-right: 0; } - .center-label label { - text-align: center; - } .el-input-group__prepend { padding-left: 10px; padding-right: 10px; @@ -39,12 +44,21 @@ .esshd-list { margin: 0; } - .expl { + .expl, .expl > p { color: #666666; font-size: 13px; line-height: 22px; margin: 5px 0 0 0; overflow-wrap: break-word; + code { + display: inline; + line-height: 22px; + font-size: 13px; + padding: 2px 3px; + } + } + .form-container { + margin-bottom: 80px; } .highlight { background-color: #e6e6e6; @@ -152,6 +166,17 @@ .ssl-tls-opts { margin: 36px 0 0 0; } + .submit-button { + float: right; + margin: 0 30px 22px 0; + } + .submit-button-container { + width: 100%; + position: fixed; + bottom: 0px; + right: 0; + z-index: 10000; + } .text { line-height: 20px; margin-right: 15px diff --git a/src/views/users/index.vue b/src/views/users/index.vue index 93b6a7f1bb4514d3de9964001b194e59f166b6a5..4cb241997d7ee82ab4b8cca33f61e675460593be 100644 --- a/src/views/users/index.vue +++ b/src/views/users/index.vue @@ -9,8 +9,8 @@ <el-input :placeholder="$t('users.search')" v-model="search" class="search" @input="handleDebounceSearchInput"/> </div> <div class="actions-container"> - <el-button class="actions-button create-account" @click="createAccountDialogOpen = true"> - <span> + <el-button class="actions-button" @click="createAccountDialogOpen = true"> + <span class="create-account"> <i class="el-icon-plus"/> {{ $t('users.createAccount') }} </span> @@ -354,7 +354,7 @@ export default { cursor: pointer; color: #409EFF; } -.el-icon-plus { +.create-account > .el-icon-plus { margin-right: 5px; } .password-reset-token { @@ -402,14 +402,14 @@ only screen and (max-width: 760px), h1 { margin: 7px 10px 15px 10px; } + .actions-button { + width: 100%; + } .actions-container { display: flex; flex-direction: column; margin: 0 10px 7px 10px } - .create-account { - width: 100%; - } .el-icon-arrow-down { font-size: 12px; } diff --git a/yarn.lock b/yarn.lock index d75e92b1ca3fb3cb6e4aa79aae958494c000164e..9a72fd1c2312b1a56abd645c9cbf1e96c6cf9d34 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6348,6 +6348,11 @@ markdown-it@^8.4.0: mdurl "^1.0.1" uc.micro "^1.0.5" +marked@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/marked/-/marked-0.8.0.tgz#ec5c0c9b93878dc52dd54be8d0e524097bd81a99" + integrity sha512-MyUe+T/Pw4TZufHkzAfDj6HarCBWia2y27/bhuYkTaiUnfDYFnCP3KUN+9oM7Wi6JA2rymtVYbQu3spE0GCmxQ== + md5.js@^1.3.4: version "1.3.5" resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f"