Add button for rebooting the instance in desktop, tablet and mobile interface

This commit is contained in:
Angelina Filippova 2020-02-18 22:20:11 +03:00
parent 2ef5198684
commit 610349f24b
4 changed files with 61 additions and 22 deletions

View file

@ -363,7 +363,8 @@ export default {
assets: 'Assets', assets: 'Assets',
emoji: 'Emoji', emoji: 'Emoji',
markup: 'Markup settings', markup: 'Markup settings',
corsPlug: 'CORS plug config' corsPlug: 'CORS plug config',
instanceReboot: 'Instance Reboot'
}, },
invites: { invites: {
inviteTokens: 'Invite tokens', inviteTokens: 'Invite tokens',

View file

@ -6,11 +6,13 @@ const settings = {
state: { state: {
activeTab: 'instance', activeTab: 'instance',
configDisabled: true, configDisabled: true,
description: [],
settings: {},
updatedSettings: {},
db: {}, db: {},
loading: true description: [],
loading: true,
needReboot: true,
settings: {},
updatedSettings: {}
}, },
mutations: { mutations: {
CLEAR_UPDATED_SETTINGS: (state) => { CLEAR_UPDATED_SETTINGS: (state) => {

View file

@ -3,17 +3,25 @@
<div v-if="isDesktop"> <div v-if="isDesktop">
<div class="settings-header-container"> <div class="settings-header-container">
<h1 class="settings-header">{{ $t('settings.settings') }}</h1> <h1 class="settings-header">{{ $t('settings.settings') }}</h1>
<el-link <div>
:underline="false" <el-button v-if="needReboot" class="settings-reboot-button">
href="https://docs-develop.pleroma.social/backend/administration/CLI_tasks/config/"
target="_blank">
<el-button class="settings-docs-button">
<span> <span>
<i class="el-icon-document"/> <i class="el-icon-refresh"/>
{{ $t('settings.seeDocs') }} {{ $t('settings.instanceReboot') }}
</span> </span>
</el-button> </el-button>
</el-link> <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>
</div> </div>
<el-tabs v-model="activeTab" tab-position="left"> <el-tabs v-model="activeTab" tab-position="left">
<el-tab-pane :label="$t('settings.activityPub')" :disabled="configDisabled" name="activityPub" lazy> <el-tab-pane :label="$t('settings.activityPub')" :disabled="configDisabled" name="activityPub" lazy>
@ -79,8 +87,16 @@
</el-tabs> </el-tabs>
</div> </div>
<div v-if="isMobile || isTablet"> <div v-if="isMobile || isTablet">
<h1 class="settings-header">{{ $t('settings.settings') }}</h1>
<div class="settings-header-container"> <div class="settings-header-container">
<h1 class="settings-header">{{ $t('settings.settings') }}</h1>
<el-button v-if="needReboot" class="settings-reboot-button">
<span>
<i class="el-icon-refresh"/>
{{ $t('settings.instanceReboot') }}
</span>
</el-button>
</div>
<div class="nav-container">
<el-select v-model="activeTab" class="settings-menu" placeholder="Select"> <el-select v-model="activeTab" class="settings-menu" placeholder="Select">
<el-option <el-option
v-for="item in options" v-for="item in options"
@ -219,6 +235,9 @@ export default {
}, },
isTablet() { isTablet() {
return this.$store.state.app.device === 'tablet' return this.$store.state.app.device === 'tablet'
},
needReboot() {
return this.$store.state.settings.needReboot
} }
}, },
mounted: function() { mounted: function() {

View file

@ -247,6 +247,8 @@
margin-bottom: 10px; margin-bottom: 10px;
} }
.settings-container { .settings-container {
max-width: 1824px;
margin: auto;
.el-tabs { .el-tabs {
margin-top: 20px margin-top: 20px
} }
@ -269,6 +271,11 @@
align-items: center; align-items: center;
margin: 22px 30px 15px 15px; margin: 22px 30px 15px 15px;
} }
.settings-reboot-button {
width: 145px;
text-align: left;
padding: 10px;
}
.single-input { .single-input {
margin-right: 10px margin-right: 10px
} }
@ -318,10 +325,6 @@
} }
@media only screen and (min-width: 1824px) { @media only screen and (min-width: 1824px) {
.settings-container {
max-width: 1824px;
margin: auto;
}
.submit-button-container { .submit-button-container {
max-width: 1637px; max-width: 1637px;
margin-left: auto; margin-left: auto;
@ -425,11 +428,20 @@
justify-content: space-between; justify-content: space-between;
} }
.settings-header { .settings-header {
margin: 7px 10px 15px 15px; width: fit-content;
display: inline-block;
margin: 0;
} }
.settings-header-container { .settings-header-container {
margin: 15px; margin: 15px;
} }
.nav-container {
display: flex;
height: 36px;
justify-content: space-between;
align-items: center;
margin: 15px;
}
.settings-menu { .settings-menu {
width: 163px; width: 163px;
} }
@ -508,6 +520,7 @@
} }
} }
@media only screen and (max-width:801px) and (min-width: 481px) { @media only screen and (max-width:801px) and (min-width: 481px) {
.delete-setting-button { .delete-setting-button {
margin: 4px 0 0 10px; margin: 4px 0 0 10px;
height: 28px; height: 28px;
@ -538,14 +551,18 @@
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
.nav-container {
display: flex;
height: 36px;
justify-content: space-between;
align-items: center;
margin: 15px 30px 15px 15px;
}
.rate-limit-label-container { .rate-limit-label-container {
width: 250px; width: 250px;
} }
.settings-delete-button { .settings-delete-button {
float: right; float: right;
} }
.settings-header {
margin: 5px 0 0 15px;
}
} }
} }