2019-08-09 16:45:25 +00:00
|
|
|
<template>
|
|
|
|
<div class="settings-container">
|
2020-02-14 15:52:33 +00:00
|
|
|
<div v-if="isDesktop">
|
|
|
|
<div class="settings-header-container">
|
|
|
|
<h1 class="settings-header">{{ $t('settings.settings') }}</h1>
|
2020-02-18 19:20:11 +00:00
|
|
|
<div>
|
2020-02-18 23:29:34 +00:00
|
|
|
<el-tooltip v-if="needReboot" :content="$t('settings.restartApp')" placement="bottom-end">
|
|
|
|
<el-button type="warning" class="settings-reboot-button" @click="restartApp">
|
|
|
|
<span>
|
|
|
|
<i class="el-icon-refresh"/>
|
|
|
|
{{ $t('settings.instanceReboot') }}
|
|
|
|
</span>
|
|
|
|
</el-button>
|
|
|
|
</el-tooltip>
|
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>
|
|
|
|
</div>
|
2020-02-14 15:52:33 +00:00
|
|
|
</div>
|
|
|
|
<el-tabs v-model="activeTab" tab-position="left">
|
|
|
|
<el-tab-pane :label="$t('settings.activityPub')" :disabled="configDisabled" name="activityPub" lazy>
|
|
|
|
<activity-pub/>
|
|
|
|
</el-tab-pane>
|
|
|
|
<el-tab-pane :label="$t('settings.auth')" :disabled="configDisabled" name="auth" lazy>
|
|
|
|
<authentication/>
|
|
|
|
</el-tab-pane>
|
|
|
|
<el-tab-pane :label="$t('settings.autoLinker')" :disabled="configDisabled" name="autoLinker" lazy>
|
|
|
|
<auto-linker/>
|
|
|
|
</el-tab-pane>
|
|
|
|
<el-tab-pane :label="$t('settings.esshd')" :disabled="configDisabled" name="esshd" lazy>
|
|
|
|
<esshd/>
|
|
|
|
</el-tab-pane>
|
|
|
|
<el-tab-pane :label="$t('settings.captcha')" :disabled="configDisabled" name="captcha" lazy>
|
|
|
|
<captcha/>
|
|
|
|
</el-tab-pane>
|
|
|
|
<el-tab-pane :label="$t('settings.frontend')" :disabled="configDisabled" name="frontend" lazy>
|
|
|
|
<frontend/>
|
|
|
|
</el-tab-pane>
|
|
|
|
<el-tab-pane :label="$t('settings.gopher')" :disabled="configDisabled" name="gopher" lazy>
|
|
|
|
<gopher/>
|
|
|
|
</el-tab-pane>
|
|
|
|
<el-tab-pane :label="$t('settings.http')" :disabled="configDisabled" name="http" lazy>
|
|
|
|
<http/>
|
|
|
|
</el-tab-pane>
|
|
|
|
<el-tab-pane :label="$t('settings.instance')" :disabled="configDisabled" name="instance">
|
|
|
|
<instance/>
|
|
|
|
</el-tab-pane>
|
|
|
|
<el-tab-pane :label="$t('settings.jobQueue')" :disabled="configDisabled" name="jobQueue" lazy>
|
|
|
|
<job-queue/>
|
|
|
|
</el-tab-pane>
|
|
|
|
<el-tab-pane :label="$t('settings.logger')" :disabled="configDisabled" name="logger" lazy>
|
|
|
|
<logger/>
|
|
|
|
</el-tab-pane>
|
|
|
|
<el-tab-pane :label="$t('settings.mailer')" :disabled="configDisabled" name="mailer" lazy>
|
|
|
|
<mailer/>
|
|
|
|
</el-tab-pane>
|
|
|
|
<el-tab-pane :label="$t('settings.mediaProxy')" :disabled="configDisabled" name="mediaProxy" lazy>
|
|
|
|
<media-proxy/>
|
|
|
|
</el-tab-pane>
|
|
|
|
<el-tab-pane :label="$t('settings.metadata')" :disabled="configDisabled" name="metadata" lazy>
|
|
|
|
<metadata/>
|
|
|
|
</el-tab-pane>
|
|
|
|
<el-tab-pane :label="$t('settings.mrf')" :disabled="configDisabled" name="mrf" lazy>
|
|
|
|
<mrf/>
|
|
|
|
</el-tab-pane>
|
|
|
|
<el-tab-pane :label="$t('settings.rateLimiters')" :disabled="configDisabled" name="rateLimiters" lazy>
|
|
|
|
<rate-limiters/>
|
|
|
|
</el-tab-pane>
|
|
|
|
<el-tab-pane :label="$t('settings.relays')" lazy name="relays">
|
|
|
|
<relays/>
|
|
|
|
</el-tab-pane>
|
|
|
|
<el-tab-pane :label="$t('settings.webPush')" :disabled="configDisabled" name="webPush" lazy>
|
|
|
|
<web-push/>
|
|
|
|
</el-tab-pane>
|
|
|
|
<el-tab-pane :label="$t('settings.upload')" :disabled="configDisabled" name="upload" lazy>
|
|
|
|
<upload/>
|
|
|
|
</el-tab-pane>
|
|
|
|
<el-tab-pane :label="$t('settings.other')" :disabled="configDisabled" name="other" lazy>
|
|
|
|
<other/>
|
|
|
|
</el-tab-pane>
|
|
|
|
</el-tabs>
|
2020-02-05 17:30:19 +00:00
|
|
|
</div>
|
2020-02-17 14:27:07 +00:00
|
|
|
<div v-if="isMobile || isTablet">
|
2020-02-14 15:52:33 +00:00
|
|
|
<div class="settings-header-container">
|
2020-02-18 19:20:11 +00:00
|
|
|
<h1 class="settings-header">{{ $t('settings.settings') }}</h1>
|
2020-02-18 20:08:07 +00:00
|
|
|
<el-button v-if="needReboot" class="settings-reboot-button" @click="restartApp">
|
2020-02-18 19:20:11 +00:00
|
|
|
<span>
|
|
|
|
<i class="el-icon-refresh"/>
|
|
|
|
{{ $t('settings.instanceReboot') }}
|
|
|
|
</span>
|
|
|
|
</el-button>
|
|
|
|
</div>
|
|
|
|
<div class="nav-container">
|
2020-02-14 15:52:33 +00:00
|
|
|
<el-select v-model="activeTab" class="settings-menu" placeholder="Select">
|
|
|
|
<el-option
|
|
|
|
v-for="item in options"
|
|
|
|
:key="item.value"
|
|
|
|
:label="item.label"
|
|
|
|
:value="item.value"
|
|
|
|
:disabled="configDisabled"/>
|
|
|
|
</el-select>
|
|
|
|
<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>
|
2020-02-06 18:01:54 +00:00
|
|
|
<activity-pub v-if="activeTab === 'activityPub'"/>
|
|
|
|
<authentication v-if="activeTab === 'auth'"/>
|
|
|
|
<auto-linker v-if="activeTab === 'autoLinker'"/>
|
|
|
|
<esshd v-if="activeTab === 'esshd'"/>
|
|
|
|
<captcha v-if="activeTab === 'captcha'"/>
|
|
|
|
<frontend v-if="activeTab === 'frontend'"/>
|
|
|
|
<gopher v-if="activeTab === 'gopher'"/>
|
|
|
|
<http v-if="activeTab === 'http'"/>
|
|
|
|
<instance v-if="activeTab === 'instance'"/>
|
|
|
|
<job-queue v-if="activeTab === 'jobQueue'"/>
|
|
|
|
<logger v-if="activeTab === 'logger'"/>
|
|
|
|
<mailer v-if="activeTab === 'mailer'"/>
|
|
|
|
<media-proxy v-if="activeTab === 'mediaProxy'"/>
|
|
|
|
<metadata v-if="activeTab === 'metadata'"/>
|
|
|
|
<mrf v-if="activeTab === 'mrf'"/>
|
|
|
|
<rate-limiters v-if="activeTab === 'rateLimiters'"/>
|
|
|
|
<relays v-if="activeTab === 'relays'"/>
|
|
|
|
<web-push v-if="activeTab === 'webPush'"/>
|
|
|
|
<upload v-if="activeTab === 'upload'"/>
|
|
|
|
<other v-if="activeTab === 'other'"/>
|
|
|
|
</div>
|
2019-08-09 16:45:25 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-02-06 16:53:30 +00:00
|
|
|
import i18n from '@/lang'
|
2020-01-29 16:58:00 +00:00
|
|
|
import {
|
|
|
|
ActivityPub,
|
|
|
|
Authentication,
|
|
|
|
AutoLinker,
|
|
|
|
Captcha,
|
|
|
|
Esshd,
|
|
|
|
Frontend,
|
|
|
|
Gopher,
|
|
|
|
Http,
|
|
|
|
Instance,
|
|
|
|
JobQueue,
|
|
|
|
Logger,
|
|
|
|
Mailer,
|
|
|
|
MediaProxy,
|
|
|
|
Metadata,
|
|
|
|
Mrf,
|
|
|
|
Other,
|
|
|
|
RateLimiters,
|
|
|
|
Relays,
|
|
|
|
Upload,
|
|
|
|
WebPush
|
|
|
|
} from './components'
|
2019-08-09 16:45:25 +00:00
|
|
|
|
|
|
|
export default {
|
2020-01-29 16:58:00 +00:00
|
|
|
components: {
|
|
|
|
ActivityPub,
|
|
|
|
Authentication,
|
|
|
|
AutoLinker,
|
|
|
|
Captcha,
|
|
|
|
Esshd,
|
|
|
|
Frontend,
|
|
|
|
Gopher,
|
|
|
|
Http,
|
|
|
|
Instance,
|
|
|
|
JobQueue,
|
|
|
|
Logger,
|
|
|
|
Mailer,
|
|
|
|
MediaProxy,
|
|
|
|
Metadata,
|
|
|
|
Mrf,
|
|
|
|
Other,
|
|
|
|
RateLimiters,
|
|
|
|
Relays,
|
|
|
|
Upload,
|
|
|
|
WebPush
|
|
|
|
},
|
2020-02-06 16:53:30 +00:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
options: [
|
|
|
|
{ value: 'activityPub', label: i18n.t('settings.activityPub') },
|
|
|
|
{ value: 'auth', label: i18n.t('settings.auth') },
|
|
|
|
{ value: 'autoLinker', label: i18n.t('settings.autoLinker') },
|
|
|
|
{ value: 'esshd', label: i18n.t('settings.esshd') },
|
|
|
|
{ value: 'captcha', label: i18n.t('settings.captcha') },
|
|
|
|
{ value: 'frontend', label: i18n.t('settings.frontend') },
|
|
|
|
{ value: 'gopher', label: i18n.t('settings.gopher') },
|
|
|
|
{ value: 'http', label: i18n.t('settings.http') },
|
|
|
|
{ value: 'instance', label: i18n.t('settings.instance') },
|
|
|
|
{ value: 'jobQueue', label: i18n.t('settings.jobQueue') },
|
|
|
|
{ value: 'logger', label: i18n.t('settings.logger') },
|
|
|
|
{ value: 'mailer', label: i18n.t('settings.mailer') },
|
|
|
|
{ value: 'mediaProxy', label: i18n.t('settings.mediaProxy') },
|
|
|
|
{ value: 'metadata', label: i18n.t('settings.metadata') },
|
|
|
|
{ value: 'mrf', label: i18n.t('settings.mrf') },
|
|
|
|
{ value: 'rateLimiters', label: i18n.t('settings.rateLimiters') },
|
|
|
|
{ value: 'relays', label: i18n.t('settings.relays') },
|
|
|
|
{ value: 'webPush', label: i18n.t('settings.webPush') },
|
|
|
|
{ value: 'upload', label: i18n.t('settings.upload') },
|
|
|
|
{ value: 'other', label: i18n.t('settings.other') }
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2019-08-09 16:45:25 +00:00
|
|
|
computed: {
|
2020-01-30 12:40:39 +00:00
|
|
|
activeTab: {
|
|
|
|
get() {
|
|
|
|
return this.$store.state.settings.activeTab
|
|
|
|
},
|
|
|
|
set(tab) {
|
|
|
|
this.$store.dispatch('SetActiveTab', tab)
|
|
|
|
}
|
|
|
|
},
|
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
|
|
|
},
|
|
|
|
isTablet() {
|
|
|
|
return this.$store.state.app.device === 'tablet'
|
2020-02-18 19:20:11 +00:00
|
|
|
},
|
|
|
|
needReboot() {
|
|
|
|
return this.$store.state.settings.needReboot
|
2019-08-09 16:45:25 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted: function() {
|
|
|
|
this.$store.dispatch('FetchSettings')
|
2020-02-18 20:08:07 +00:00
|
|
|
},
|
|
|
|
methods: {
|
2020-02-18 23:29:34 +00:00
|
|
|
async restartApp() {
|
|
|
|
try {
|
|
|
|
await this.$store.dispatch('RestartApplication')
|
|
|
|
} catch (e) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
this.$message({
|
|
|
|
type: 'success',
|
|
|
|
message: i18n.t('settings.restartSuccess')
|
|
|
|
})
|
2020-02-18 20:08:07 +00:00
|
|
|
}
|
2019-08-09 16:45:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2020-02-17 22:18:43 +00:00
|
|
|
<style rel='stylesheet/scss' lang='scss'>
|
|
|
|
@import './styles/main';
|
|
|
|
@include settings
|
2019-08-09 16:45:25 +00:00
|
|
|
</style>
|