Merge branch 'feature/show-settings-from-whitelist' into 'develop'
Disable tab if its settings are not on the whitelist Closes #113 See merge request pleroma/admin-fe!130
This commit is contained in:
commit
af929419fb
14 changed files with 56 additions and 41 deletions
|
@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||
|
||||
- Statuses count changes when an instance is selected and shows the amount of statuses from an originating instance
|
||||
- Add a dialog window with a confirmation when a remove button is clicked on the Settings page
|
||||
- Disable tab on the Settings page if there are no settings on this tab that can be changed in Admin FE
|
||||
|
||||
### Fixed
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<el-form ref="activitypubData" :model="activitypubData" :label-position="labelPosition" :label-width="labelWidth" data-search=":activitypub">
|
||||
<setting :setting-group="activitypub" :data="activitypubData"/>
|
||||
</el-form>
|
||||
<el-divider class="divider thick-line"/>
|
||||
<el-divider v-if="activitypub" class="divider thick-line"/>
|
||||
<el-form ref="userData" :model="userData" :label-position="labelPosition" :label-width="labelWidth" data-search=":user">
|
||||
<setting :setting-group="user" :data="userData"/>
|
||||
</el-form>
|
||||
|
|
|
@ -3,15 +3,15 @@
|
|||
<el-form ref="pleromaAuthenticatorData" :model="pleromaAuthenticatorData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="pleromaAuthenticator" :data="pleromaAuthenticatorData"/>
|
||||
</el-form>
|
||||
<el-divider class="divider thick-line"/>
|
||||
<el-divider v-if="pleromaAuthenticator" class="divider thick-line"/>
|
||||
<el-form ref="authData" :model="authData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="auth" :data="authData"/>
|
||||
</el-form>
|
||||
<el-divider class="divider thick-line"/>
|
||||
<el-divider v-if="auth" class="divider thick-line"/>
|
||||
<el-form ref="ldapData" :model="ldapData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="ldap" :data="ldapData"/>
|
||||
</el-form>
|
||||
<el-divider class="divider thick-line"/>
|
||||
<el-divider v-if="oauth2" class="divider thick-line"/>
|
||||
<el-form ref="oauth2" :model="oauth2Data" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="oauth2" :data="oauth2Data"/>
|
||||
</el-form>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<el-form ref="captchaData" :model="captchaData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="captcha" :data="captchaData"/>
|
||||
</el-form>
|
||||
<el-divider class="divider thick-line"/>
|
||||
<el-divider v-if="captcha" class="divider thick-line"/>
|
||||
<el-form ref="kocaptchaData" :model="kocaptchaData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="kocaptcha" :data="kocaptchaData"/>
|
||||
</el-form>
|
||||
|
|
|
@ -6,27 +6,27 @@
|
|||
<el-form ref="staticFeData" :model="staticFeData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="staticFe" :data="staticFeData"/>
|
||||
</el-form>
|
||||
<el-divider class="divider thick-line"/>
|
||||
<el-divider v-if="staticFe" class="divider thick-line"/>
|
||||
<el-form ref="assetsData" :model="assetsData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<el-form-item class="grouped-settings-header">
|
||||
<el-form-item v-if="assets" class="grouped-settings-header">
|
||||
<span class="label-font label-with-margin">{{ $t('settings.assets') }}</span>
|
||||
</el-form-item>
|
||||
<setting :setting-group="assets" :data="assetsData"/>
|
||||
</el-form>
|
||||
<el-divider class="divider thick-line"/>
|
||||
<el-divider v-if="assets" class="divider thick-line"/>
|
||||
<el-form ref="emojiData" :model="emojiData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<el-form-item data-search=":emoji" class="grouped-settings-header">
|
||||
<el-form-item v-if="emoji" data-search=":emoji" class="grouped-settings-header">
|
||||
<span class="label-font label-with-margin">{{ $t('settings.emoji') }}</span>
|
||||
</el-form-item>
|
||||
<setting :setting-group="emoji" :data="emojiData"/>
|
||||
</el-form>
|
||||
<el-divider class="divider thick-line"/>
|
||||
<el-divider v-if="emoji" class="divider thick-line"/>
|
||||
<el-form ref="chatData" :model="chatData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="chat" :data="chatData"/>
|
||||
</el-form>
|
||||
<el-divider class="divider thick-line"/>
|
||||
<el-divider v-if="chat" class="divider thick-line"/>
|
||||
<el-form ref="markupData" :model="markupData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<el-form-item data-search=":markup" class="grouped-settings-header">
|
||||
<el-form-item v-if="markup" data-search=":markup" class="grouped-settings-header">
|
||||
<span class="label-font label-with-margin">{{ $t('settings.markup') }}</span>
|
||||
</el-form-item>
|
||||
<setting :setting-group="markup" :data="markupData"/>
|
||||
|
|
|
@ -4,20 +4,20 @@
|
|||
<setting :setting-group="http" :data="httpData"/>
|
||||
</el-form>
|
||||
<el-form ref="corsPlugData" :model="corsPlugData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<el-form-item data-search=":cors_plug" class="grouped-settings-header">
|
||||
<el-form-item v-if="corsPlug" data-search=":cors_plug" class="grouped-settings-header">
|
||||
<span class="label-font label-with-margin">{{ $t('settings.corsPlug') }}</span>
|
||||
</el-form-item>
|
||||
<setting :setting-group="corsPlug" :data="corsPlugData"/>
|
||||
</el-form>
|
||||
<el-divider class="divider thick-line"/>
|
||||
<el-divider v-if="corsPlug" class="divider thick-line"/>
|
||||
<el-form ref="httpSignatures" :model="httpSignaturesData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="httpSignatures" :data="httpSignaturesData"/>
|
||||
</el-form>
|
||||
<el-divider class="divider thick-line"/>
|
||||
<el-divider v-if="httpSignatures" class="divider thick-line"/>
|
||||
<el-form ref="httpSecurityData" :model="httpSecurityData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="httpSecurity" :data="httpSecurityData"/>
|
||||
</el-form>
|
||||
<el-divider class="divider thick-line"/>
|
||||
<el-divider v-if="httpSecurity" class="divider thick-line"/>
|
||||
<el-form ref="webCacheTtl" :model="webCacheTtlData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="webCacheTtl" :data="webCacheTtlData"/>
|
||||
</el-form>
|
||||
|
|
|
@ -3,27 +3,27 @@
|
|||
<el-form ref="instanceData" :model="instanceData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="instance" :data="instanceData"/>
|
||||
</el-form>
|
||||
<el-divider class="divider thick-line"/>
|
||||
<el-divider v-if="instance" class="divider thick-line"/>
|
||||
<el-form ref="adminToken" :model="adminTokenData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="adminToken" :data="adminTokenData"/>
|
||||
</el-form>
|
||||
<el-divider class="divider thick-line"/>
|
||||
<el-divider v-if="adminToken" class="divider thick-line"/>
|
||||
<el-form ref="scheduledActivity" :model="scheduledActivityData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="scheduledActivity" :data="scheduledActivityData"/>
|
||||
</el-form>
|
||||
<el-divider class="divider thick-line"/>
|
||||
<el-divider v-if="scheduledActivity" class="divider thick-line"/>
|
||||
<el-form ref="manifest" :model="manifestData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="manifest" :data="manifestData"/>
|
||||
</el-form>
|
||||
<el-divider class="divider thick-line"/>
|
||||
<el-divider v-if="manifest" class="divider thick-line"/>
|
||||
<el-form ref="pleromaUser" :model="pleromaUserData" :label-position="labelPosition" :label-width="labelWidth" data-search="Pleroma.User">
|
||||
<setting :setting-group="pleromaUser" :data="pleromaUserData"/>
|
||||
</el-form>
|
||||
<el-divider class="divider thick-line"/>
|
||||
<el-divider v-if="pleromaUser" class="divider thick-line"/>
|
||||
<el-form ref="uriSchemes" :model="uriSchemesData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="uriSchemes" :data="uriSchemesData"/>
|
||||
</el-form>
|
||||
<el-divider class="divider thick-line"/>
|
||||
<el-divider v-if="uriSchemes" class="divider thick-line"/>
|
||||
<el-form ref="feed" :model="feedData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="feed" :data="feedData"/>
|
||||
</el-form>
|
||||
|
|
|
@ -3,15 +3,15 @@
|
|||
<el-form ref="loggerData" :model="loggerData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="logger" :data="loggerData"/>
|
||||
</el-form>
|
||||
<el-divider class="divider thick-line"/>
|
||||
<el-divider v-if="logger" class="divider thick-line"/>
|
||||
<el-form ref="consoleData" :model="consoleData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="console" :data="consoleData"/>
|
||||
</el-form>
|
||||
<el-divider class="divider thick-line"/>
|
||||
<el-divider v-if="console" class="divider thick-line"/>
|
||||
<el-form ref="exsysloggerData" :model="exsysloggerData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="exsyslogger" :data="exsysloggerData"/>
|
||||
</el-form>
|
||||
<el-divider class="divider thick-line"/>
|
||||
<el-divider v-if="exsyslogger" class="divider thick-line"/>
|
||||
<el-form ref="quackData" :model="quackData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="quack" :data="quackData"/>
|
||||
</el-form>
|
||||
|
|
|
@ -3,15 +3,15 @@
|
|||
<el-form ref="mrfSimple" :model="mrfSimpleData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="mrfSimple" :data="mrfSimpleData"/>
|
||||
</el-form>
|
||||
<el-divider class="divider thick-line"/>
|
||||
<el-divider v-if="mrfSimple" class="divider thick-line"/>
|
||||
<el-form ref="mrfRejectnonpublic" :model="mrfRejectnonpublicData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="mrfRejectnonpublic" :data="mrfRejectnonpublicData"/>
|
||||
</el-form>
|
||||
<el-divider class="divider thick-line"/>
|
||||
<el-divider v-if="mrfRejectnonpublic" class="divider thick-line"/>
|
||||
<el-form ref="mrfHellthread" :model="mrfHellthreadData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="mrfHellthread" :data="mrfHellthreadData"/>
|
||||
</el-form>
|
||||
<el-divider class="divider thick-line"/>
|
||||
<el-divider v-if="mrfHellthread" class="divider thick-line"/>
|
||||
<el-form ref="mrfKeyword" :model="mrfKeywordData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="mrfKeyword" :data="mrfKeywordData"/>
|
||||
</el-form>
|
||||
|
@ -21,19 +21,19 @@
|
|||
<el-form ref="mrfMention" :model="mrfMentionData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="mrfMention" :data="mrfMentionData"/>
|
||||
</el-form>
|
||||
<el-divider class="divider thick-line"/>
|
||||
<el-divider v-if="mrfMention" class="divider thick-line"/>
|
||||
<el-form ref="mrfNormalizeMarkup" :model="mrfNormalizeMarkupData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="mrfNormalizeMarkup" :data="mrfNormalizeMarkupData"/>
|
||||
</el-form>
|
||||
<el-divider class="divider thick-line"/>
|
||||
<el-divider v-if="mrfNormalizeMarkup" class="divider thick-line"/>
|
||||
<el-form ref="mrfVocabulary" :model="mrfVocabularyData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="mrfVocabulary" :data="mrfVocabularyData"/>
|
||||
</el-form>
|
||||
<el-divider class="divider thick-line"/>
|
||||
<el-divider v-if="mrfVocabulary" class="divider thick-line"/>
|
||||
<el-form ref="mrfObjectAge" :model="mrfObjectAgeData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="mrfObjectAge" :data="mrfObjectAgeData"/>
|
||||
</el-form>
|
||||
<el-divider class="divider thick-line"/>
|
||||
<el-divider v-if="mrfObjectAge" class="divider thick-line"/>
|
||||
<el-form ref="modules" :model="modulesData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="modules" :data="modulesData"/>
|
||||
</el-form>
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
<el-form ref="mailer" :model="mailerData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="mailer" :data="mailerData"/>
|
||||
</el-form>
|
||||
<el-divider class="divider thick-line"/>
|
||||
<el-divider v-if="mailer" class="divider thick-line"/>
|
||||
<el-form ref="swoosh" :model="swooshData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="swoosh" :data="swooshData"/>
|
||||
</el-form>
|
||||
<el-divider class="divider thick-line"/>
|
||||
<el-divider v-if="swoosh" class="divider thick-line"/>
|
||||
<el-form ref="emailNotifications" :model="emailNotificationsData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="emailNotifications" :data="emailNotificationsData"/>
|
||||
</el-form>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<el-form ref="metadata" :model="metadataData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="metadata" :data="metadataData"/>
|
||||
</el-form>
|
||||
<el-divider class="divider thick-line"/>
|
||||
<el-divider v-if="metadata" class="divider thick-line"/>
|
||||
<el-form ref="richMedia" :model="richMediaData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="richMedia" :data="richMediaData"/>
|
||||
</el-form>
|
||||
|
|
|
@ -4,20 +4,20 @@
|
|||
<setting :setting-group="upload" :data="uploadData"/>
|
||||
</el-form>
|
||||
<el-form v-if="showUploadersLocal" ref="uploadersLocal" :model="uploadersLocalData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<el-form-item class="grouped-settings-header">
|
||||
<el-form-item v-if="uploadersLocal" class="grouped-settings-header">
|
||||
<span class="label-font label-with-margin">Pleroma.Uploaders.Local</span>
|
||||
</el-form-item>
|
||||
<setting :setting-group="uploadersLocal" :data="uploadersLocalData"/>
|
||||
<el-divider class="divider thick-line"/>
|
||||
<el-divider v-if="uploadersLocal" class="divider thick-line"/>
|
||||
</el-form>
|
||||
<el-form v-if="showUploadersS3" ref="uploadersS3" :model="uploadersS3Data" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="uploadersS3" :data="uploadersS3Data"/>
|
||||
<el-divider class="divider thick-line"/>
|
||||
<el-divider v-if="uploadersS3" class="divider thick-line"/>
|
||||
</el-form>
|
||||
<el-form ref="uploadFilterMogrify" :model="uploadFilterMogrifyData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="uploadFilterMogrify" :data="uploadFilterMogrifyData"/>
|
||||
</el-form>
|
||||
<el-divider class="divider thick-line"/>
|
||||
<el-divider v-if="uploadFilterMogrify" class="divider thick-line"/>
|
||||
<el-form ref="uploadAnonymizeFilename" :model="uploadAnonymizeFilenameData" :label-position="labelPosition" :label-width="labelWidth">
|
||||
<setting :setting-group="uploadAnonymizeFilename" :data="uploadAnonymizeFilenameData"/>
|
||||
</el-form>
|
||||
|
|
|
@ -65,7 +65,7 @@ export const tabs = {
|
|||
},
|
||||
'relays': {
|
||||
label: 'settings.relays',
|
||||
settings: []
|
||||
settings: ['relays']
|
||||
},
|
||||
'web-push': {
|
||||
label: 'settings.webPush',
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
<el-tab-pane
|
||||
v-for="(value, componentName) in tabs"
|
||||
:label="$t(value.label)"
|
||||
:disabled="configDisabled"
|
||||
:disabled="configDisabled || settingsCantBeChanged(value.settings)"
|
||||
:key="componentName"
|
||||
:name="componentName"
|
||||
lazy>
|
||||
|
@ -227,6 +227,20 @@ export default {
|
|||
: { value: `${searchObj.label} in ${searchObj.groupLabel}`, group: searchObj.groupKey, key: searchObj.key }
|
||||
})
|
||||
cb(results)
|
||||
},
|
||||
settingsCantBeChanged(settings) {
|
||||
const existingSettings = settings.filter(setting => {
|
||||
if ([':esshd', ':cors_plug', ':http_signatures', ':quack', ':logger', ':swoosh', ':mime'].includes(setting)) {
|
||||
return this.$store.state.settings.description.findIndex(el => el.group === setting) !== -1
|
||||
} else if (setting === 'Pleroma.Web.Auth.Authenticator' || setting === ':admin_token') {
|
||||
return this.$store.state.settings.description.findIndex(el => el.children[0].key === setting) !== -1
|
||||
} else if (setting === 'relays') {
|
||||
return [setting]
|
||||
} else {
|
||||
return this.$store.state.settings.description.findIndex(el => el.key === setting) !== -1
|
||||
}
|
||||
})
|
||||
return existingSettings.length === 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue