2019-08-09 16:45:25 +00:00
|
|
|
<template>
|
2020-04-17 22:27:00 +00:00
|
|
|
<div :class="rebootIsSidebarOpen" class="settings-container">
|
|
|
|
<div class="reboot-button-container">
|
|
|
|
<reboot-button/>
|
|
|
|
</div>
|
2020-02-14 15:52:33 +00:00
|
|
|
<div v-if="isDesktop">
|
2020-03-24 16:14:36 +00:00
|
|
|
<div :class="isSidebarOpen" class="settings-header-container">
|
2020-02-14 15:52:33 +00:00
|
|
|
<h1 class="settings-header">{{ $t('settings.settings') }}</h1>
|
2020-04-17 22:27:00 +00:00
|
|
|
<div class="docs-search-container">
|
2020-02-18 19:20:11 +00:00
|
|
|
<el-link
|
|
|
|
:underline="false"
|
|
|
|
href="https://docs-develop.pleroma.social/backend/administration/CLI_tasks/config/"
|
|
|
|
target="_blank">
|
|
|
|
<el-button class="settings-docs-button">
|
|
|
|
<span>
|
|
|
|
<i class="el-icon-document"/>
|
|
|
|
{{ $t('settings.seeDocs') }}
|
|
|
|
</span>
|
|
|
|
</el-button>
|
|
|
|
</el-link>
|
2020-02-23 21:17:24 +00:00
|
|
|
<el-autocomplete
|
2020-02-24 21:24:46 +00:00
|
|
|
v-model="searchQuery"
|
2020-02-23 21:17:24 +00:00
|
|
|
:fetch-suggestions="querySearch"
|
|
|
|
:trigger-on-focus="false"
|
2020-03-14 22:31:47 +00:00
|
|
|
clearable
|
2020-02-23 21:17:24 +00:00
|
|
|
placeholder="Search"
|
|
|
|
prefix-icon="el-icon-search"
|
2020-02-25 15:57:38 +00:00
|
|
|
class="settings-search-input"
|
|
|
|
@select="handleSearchSelect"/>
|
2020-02-18 19:20:11 +00:00
|
|
|
</div>
|
2020-02-14 15:52:33 +00:00
|
|
|
</div>
|
2021-01-29 23:38:39 +00:00
|
|
|
<component :is="componentName"/>
|
2020-02-05 17:30:19 +00:00
|
|
|
</div>
|
2020-02-17 14:27:07 +00:00
|
|
|
<div v-if="isMobile || isTablet">
|
2020-03-24 16:14:36 +00:00
|
|
|
<div :class="isSidebarOpen" class="settings-header-container">
|
2020-02-18 19:20:11 +00:00
|
|
|
<h1 class="settings-header">{{ $t('settings.settings') }}</h1>
|
|
|
|
</div>
|
|
|
|
<div class="nav-container">
|
2020-02-14 15:52:33 +00:00
|
|
|
<el-link
|
|
|
|
:underline="false"
|
|
|
|
href="https://docs-develop.pleroma.social/backend/administration/CLI_tasks/config/"
|
|
|
|
target="_blank">
|
|
|
|
<el-button class="settings-docs-button">
|
|
|
|
<span>
|
|
|
|
<i class="el-icon-document"/>
|
|
|
|
{{ $t('settings.seeDocs') }}
|
|
|
|
</span>
|
|
|
|
</el-button>
|
|
|
|
</el-link>
|
|
|
|
</div>
|
2021-01-29 23:38:39 +00:00
|
|
|
<!-- <div class="settings-search-input-container"/> -->
|
|
|
|
<component :is="componentName"/>
|
2020-02-06 18:01:54 +00:00
|
|
|
</div>
|
2019-08-09 16:45:25 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-02-25 16:59:47 +00:00
|
|
|
import { tabs } from './components/tabs'
|
2020-01-29 16:58:00 +00:00
|
|
|
import {
|
|
|
|
ActivityPub,
|
|
|
|
Authentication,
|
|
|
|
Captcha,
|
|
|
|
Esshd,
|
|
|
|
Frontend,
|
|
|
|
Gopher,
|
|
|
|
Http,
|
|
|
|
Instance,
|
|
|
|
JobQueue,
|
2020-07-24 20:29:12 +00:00
|
|
|
LinkFormatter,
|
2020-01-29 16:58:00 +00:00
|
|
|
Logger,
|
|
|
|
Mailer,
|
|
|
|
MediaProxy,
|
|
|
|
Metadata,
|
|
|
|
Mrf,
|
|
|
|
Other,
|
|
|
|
RateLimiters,
|
|
|
|
Relays,
|
|
|
|
Upload,
|
|
|
|
WebPush
|
|
|
|
} from './components'
|
2020-04-17 22:27:00 +00:00
|
|
|
import RebootButton from '@/components/RebootButton'
|
2019-08-09 16:45:25 +00:00
|
|
|
|
|
|
|
export default {
|
2020-01-29 16:58:00 +00:00
|
|
|
components: {
|
|
|
|
ActivityPub,
|
|
|
|
Authentication,
|
|
|
|
Captcha,
|
|
|
|
Esshd,
|
|
|
|
Frontend,
|
|
|
|
Gopher,
|
|
|
|
Http,
|
|
|
|
Instance,
|
|
|
|
JobQueue,
|
2020-07-24 20:29:12 +00:00
|
|
|
LinkFormatter,
|
2020-01-29 16:58:00 +00:00
|
|
|
Logger,
|
|
|
|
Mailer,
|
|
|
|
MediaProxy,
|
|
|
|
Metadata,
|
|
|
|
Mrf,
|
|
|
|
Other,
|
|
|
|
RateLimiters,
|
|
|
|
Relays,
|
2020-04-17 22:27:00 +00:00
|
|
|
RebootButton,
|
2020-01-29 16:58:00 +00:00
|
|
|
Upload,
|
|
|
|
WebPush
|
|
|
|
},
|
2020-02-06 16:53:30 +00:00
|
|
|
data() {
|
|
|
|
return {
|
2020-02-24 21:24:46 +00:00
|
|
|
searchQuery: ''
|
2020-02-06 16:53:30 +00:00
|
|
|
}
|
|
|
|
},
|
2019-08-09 16:45:25 +00:00
|
|
|
computed: {
|
2021-01-29 23:38:39 +00:00
|
|
|
componentName() {
|
|
|
|
return this.$route.path.split('/settings/').pop()
|
2020-01-30 12:40:39 +00:00
|
|
|
},
|
2020-02-01 13:08:10 +00:00
|
|
|
configDisabled() {
|
2020-01-30 12:40:39 +00:00
|
|
|
return this.$store.state.settings.configDisabled
|
|
|
|
},
|
2020-02-06 16:53:30 +00:00
|
|
|
isDesktop() {
|
|
|
|
return this.$store.state.app.device === 'desktop'
|
|
|
|
},
|
2019-08-09 16:45:25 +00:00
|
|
|
isMobile() {
|
|
|
|
return this.$store.state.app.device === 'mobile'
|
2020-02-17 14:27:07 +00:00
|
|
|
},
|
2020-03-24 16:14:36 +00:00
|
|
|
isSidebarOpen() {
|
|
|
|
return this.$store.state.app.sidebar.opened ? 'header-sidebar-opened' : 'header-sidebar-closed'
|
|
|
|
},
|
2020-02-17 14:27:07 +00:00
|
|
|
isTablet() {
|
|
|
|
return this.$store.state.app.device === 'tablet'
|
2020-02-18 19:20:11 +00:00
|
|
|
},
|
2020-04-17 22:27:00 +00:00
|
|
|
rebootIsSidebarOpen() {
|
|
|
|
return this.$store.state.app.sidebar.opened ? 'reboot-sidebar-opened' : 'reboot-sidebar-closed'
|
2020-02-24 21:24:46 +00:00
|
|
|
},
|
|
|
|
searchData() {
|
|
|
|
return this.$store.state.settings.searchData
|
2020-02-25 16:59:47 +00:00
|
|
|
},
|
|
|
|
tabs() {
|
2020-07-11 18:53:23 +00:00
|
|
|
return tabs(this.$store.state.settings.description)
|
2019-08-09 16:45:25 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted: function() {
|
2020-04-17 22:27:00 +00:00
|
|
|
this.$store.dispatch('GetNodeInfo')
|
|
|
|
this.$store.dispatch('NeedReboot')
|
2019-08-09 16:45:25 +00:00
|
|
|
this.$store.dispatch('FetchSettings')
|
2020-02-18 20:08:07 +00:00
|
|
|
},
|
|
|
|
methods: {
|
2020-03-12 20:48:50 +00:00
|
|
|
async handleSearchSelect(selectedValue) {
|
2020-03-09 21:43:32 +00:00
|
|
|
const tab = Object.keys(this.tabs).find(tab => {
|
2020-03-15 19:44:36 +00:00
|
|
|
return this.tabs[tab].settings.includes(selectedValue.group === ':pleroma' ? selectedValue.key : selectedValue.group)
|
2020-03-09 21:43:32 +00:00
|
|
|
})
|
2020-03-12 20:48:50 +00:00
|
|
|
await this.$store.dispatch('SetActiveTab', tab)
|
|
|
|
const selectedSetting = document.querySelector(`[data-search="${selectedValue.key}"]`)
|
2020-03-14 22:31:47 +00:00
|
|
|
if (selectedSetting) {
|
|
|
|
selectedSetting.scrollIntoView({ block: 'start', behavior: 'smooth' })
|
|
|
|
}
|
2020-02-25 15:57:38 +00:00
|
|
|
},
|
2020-02-24 21:24:46 +00:00
|
|
|
querySearch(queryString, cb) {
|
2020-03-09 19:09:32 +00:00
|
|
|
const results = this.searchData.filter(searchObj => searchObj.search.find(el => el.includes(queryString.toLowerCase())))
|
|
|
|
.map(searchObj => {
|
2020-07-27 16:35:21 +00:00
|
|
|
return { value: `${searchObj.label} in ${searchObj.groupLabel}`, group: searchObj.groupKey, key: searchObj.key }
|
2020-03-09 19:09:32 +00:00
|
|
|
})
|
2020-02-24 21:24:46 +00:00
|
|
|
cb(results)
|
2020-05-14 22:24:12 +00:00
|
|
|
},
|
|
|
|
settingsCantBeChanged(settings) {
|
2020-05-14 23:48:46 +00:00
|
|
|
const existingSettings = settings.filter(setting => {
|
2020-05-16 17:42:50 +00:00
|
|
|
if ([':esshd', ':cors_plug', ':quack', ':logger', ':swoosh', ':mime'].includes(setting)) {
|
2020-05-14 23:48:46 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
})
|
2020-05-14 22:24:12 +00:00
|
|
|
return existingSettings.length === 0
|
2020-02-18 20:08:07 +00:00
|
|
|
}
|
2019-08-09 16:45:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2020-04-17 22:27:00 +00:00
|
|
|
<style rel='stylesheet/scss' lang='scss' scoped>
|
2020-02-17 22:18:43 +00:00
|
|
|
@import './styles/main';
|
|
|
|
@include settings
|
2019-08-09 16:45:25 +00:00
|
|
|
</style>
|