forked from AkkomaGang/admin-fe
Add form for installing new frontend
This commit is contained in:
parent
4880e55552
commit
d7ef98e68b
3 changed files with 71 additions and 3 deletions
|
@ -469,7 +469,11 @@ export default {
|
||||||
setLimits: 'Set different limits for unauthenticated and authenticated users',
|
setLimits: 'Set different limits for unauthenticated and authenticated users',
|
||||||
unauthenticatedUsers: 'Unauthenticated users',
|
unauthenticatedUsers: 'Unauthenticated users',
|
||||||
authenticatedUsers: 'Authenticated users',
|
authenticatedUsers: 'Authenticated users',
|
||||||
setLimitsForAll: 'Set limit for all users'
|
setLimitsForAll: 'Set limit for all users',
|
||||||
|
ref: 'Ref',
|
||||||
|
file: 'File',
|
||||||
|
buildUrl: 'Build URL',
|
||||||
|
buildDir: 'Build Directory'
|
||||||
|
|
||||||
},
|
},
|
||||||
invites: {
|
invites: {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div v-if="!loading" :class="isSidebarOpen" class="form-container">
|
<div v-if="!loading" :class="isSidebarOpen" class="form-container">
|
||||||
<el-form :label-position="labelPosition" :label-width="labelWidth">
|
<el-form :label-position="labelPosition" :label-width="labelWidth" class="frontend-container">
|
||||||
<el-form-item class="description-container">
|
<el-form-item class="description-container">
|
||||||
<span class="setting-label">{{ $t('settings.availableFrontends') }}</span>
|
<span class="setting-label">{{ $t('settings.availableFrontends') }}</span>
|
||||||
<span class="expl no-top-margin"><p>{{ $t('settings.installFrontends') }}</p></span>
|
<span class="expl no-top-margin"><p>{{ $t('settings.installFrontends') }}</p></span>
|
||||||
|
@ -37,8 +37,37 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
<div class="frontends-button-container">
|
||||||
|
<el-button
|
||||||
|
:size="isDesktop ? 'medium' : 'mini'"
|
||||||
|
:icon="frontendInputOpen ? 'el-icon-minus' : 'el-icon-plus'"
|
||||||
|
circle
|
||||||
|
@click="toggleFrontendInput"/>
|
||||||
|
<span class="icons-button-desc">{{ $t('settings.installAnotherFrontend') }}</span>
|
||||||
|
</div>
|
||||||
|
<el-form v-if="frontendInputOpen" :model="frontendFormData" label-width="120px">
|
||||||
|
<el-form-item :label="$t('settings.name')" class="frontend-form-input">
|
||||||
|
<el-input v-model="frontendFormData.name"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('settings.ref')" class="frontend-form-input">
|
||||||
|
<el-input v-model="frontendFormData.ref"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('settings.file')" class="frontend-form-input">
|
||||||
|
<el-input v-model="frontendFormData.file"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('settings.buildUrl')" class="frontend-form-input">
|
||||||
|
<el-input v-model="frontendFormData.buildUrl"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('settings.buildDir')" class="frontend-form-input">
|
||||||
|
<el-input v-model="frontendFormData.buildDir"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item class="install-frontend-button">
|
||||||
|
<el-button type="primary" @click="installNewFrontend">{{ $t('settings.install') }}</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
<el-divider v-if="frontend" class="divider thick-line"/>
|
||||||
<el-form :model="frontendData" :label-position="labelPosition" :label-width="labelWidth">
|
<el-form :model="frontendData" :label-position="labelPosition" :label-width="labelWidth">
|
||||||
<setting :setting-group="frontend" :data="frontendData"/>
|
<setting :setting-group="frontend" :data="frontendData"/>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
@ -71,7 +100,7 @@
|
||||||
<setting :setting-group="preload" :data="preloadData"/>
|
<setting :setting-group="preload" :data="preloadData"/>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div class="submit-button-container">
|
<div class="submit-button-container">
|
||||||
<el-button class="submit-button" type="primary" @click="onSubmit">Submit</el-button>
|
<el-button class="submit-button" type="primary" @click="onSubmit">{{ $t('settings.submit') }}</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -85,6 +114,18 @@ import _ from 'lodash'
|
||||||
export default {
|
export default {
|
||||||
name: 'Frontend',
|
name: 'Frontend',
|
||||||
components: { Setting },
|
components: { Setting },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
frontendInputOpen: false,
|
||||||
|
frontendFormData: {
|
||||||
|
name: '',
|
||||||
|
ref: '',
|
||||||
|
file: '',
|
||||||
|
buildUrl: '',
|
||||||
|
buildDir: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters([
|
...mapGetters([
|
||||||
'settings'
|
'settings'
|
||||||
|
@ -122,6 +163,9 @@ export default {
|
||||||
frontendsData() {
|
frontendsData() {
|
||||||
return _.get(this.settings.settings, [':pleroma', ':frontends']) || {}
|
return _.get(this.settings.settings, [':pleroma', ':frontends']) || {}
|
||||||
},
|
},
|
||||||
|
isDesktop() {
|
||||||
|
return this.$store.state.app.device === 'desktop'
|
||||||
|
},
|
||||||
isMobile() {
|
isMobile() {
|
||||||
return this.$store.state.app.device === 'mobile'
|
return this.$store.state.app.device === 'mobile'
|
||||||
},
|
},
|
||||||
|
@ -171,6 +215,9 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
installFrontend({ name }) {
|
installFrontend({ name }) {
|
||||||
this.$store.dispatch('InstallFrontend', { name })
|
this.$store.dispatch('InstallFrontend', { name })
|
||||||
|
},
|
||||||
|
installNewFrontend() {
|
||||||
|
|
||||||
},
|
},
|
||||||
async onSubmit() {
|
async onSubmit() {
|
||||||
try {
|
try {
|
||||||
|
@ -182,6 +229,9 @@ export default {
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: i18n.t('settings.success')
|
message: i18n.t('settings.success')
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
toggleFrontendInput() {
|
||||||
|
this.frontendInputOpen = !this.frontendInputOpen
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,6 +75,16 @@
|
||||||
.form-container {
|
.form-container {
|
||||||
margin-bottom: 80px;
|
margin-bottom: 80px;
|
||||||
}
|
}
|
||||||
|
.frontend-container {
|
||||||
|
margin-right: 30px;
|
||||||
|
}
|
||||||
|
.frontend-form-input {
|
||||||
|
margin-top: 15px;
|
||||||
|
}
|
||||||
|
.frontends-button-container {
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 15px;
|
||||||
|
}
|
||||||
.frontends-table {
|
.frontends-table {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-right: 30px;
|
margin-right: 30px;
|
||||||
|
@ -130,6 +140,10 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.install-frontend-button {
|
||||||
|
margin-top: 15px;
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
.keyword-container {
|
.keyword-container {
|
||||||
width: 100%
|
width: 100%
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue