feat: admin general + verify account
This commit is contained in:
@@ -22,11 +22,21 @@
|
||||
v-subheader General
|
||||
.px-3.pb-3
|
||||
v-text-field(
|
||||
outline
|
||||
label='Site URL'
|
||||
required
|
||||
:counter='255'
|
||||
v-model='config.host'
|
||||
prepend-icon='label_important'
|
||||
hint='Full URL to your wiki, without the trailing slash. (e.g. https://wiki.example.com)'
|
||||
persistent-hint
|
||||
)
|
||||
v-text-field.mt-2(
|
||||
outline
|
||||
label='Site Title'
|
||||
required
|
||||
:counter='50'
|
||||
v-model='siteTitle'
|
||||
v-model='config.title'
|
||||
prepend-icon='public'
|
||||
)
|
||||
v-divider
|
||||
@@ -36,22 +46,28 @@
|
||||
outline
|
||||
label='Site Description'
|
||||
:counter='255'
|
||||
prepend-icon='public'
|
||||
v-model='config.description'
|
||||
prepend-icon='explore'
|
||||
)
|
||||
v-text-field(
|
||||
outline
|
||||
label='Site Keywords'
|
||||
:counter='255'
|
||||
prepend-icon='public'
|
||||
v-model='config.keywords'
|
||||
prepend-icon='explore'
|
||||
hint='Comma-separated list of keywords.'
|
||||
persistent-hint
|
||||
)
|
||||
v-select(
|
||||
v-select.mt-2(
|
||||
outline
|
||||
label='Meta Robots'
|
||||
chips
|
||||
tags
|
||||
multiple
|
||||
:items='metaRobots'
|
||||
v-model='metaRobotsSelection'
|
||||
prepend-icon='public'
|
||||
v-model='config.robots'
|
||||
prepend-icon='explore'
|
||||
:return-object='false'
|
||||
hint='Default: Index, Follow'
|
||||
persistent-hint
|
||||
)
|
||||
v-divider
|
||||
v-subheader Analytics
|
||||
@@ -60,30 +76,20 @@
|
||||
outline
|
||||
label='Google Analytics ID'
|
||||
:counter='255'
|
||||
v-model='config.ga'
|
||||
prepend-icon='timeline'
|
||||
persistent-hint
|
||||
hint='Property tracking ID for Google Analytics.'
|
||||
)
|
||||
v-divider
|
||||
v-subheader Footer Copyright
|
||||
.px-3.pb-3
|
||||
v-text-field(
|
||||
outline
|
||||
label='Company / Organization Name'
|
||||
v-model='company'
|
||||
:counter='255'
|
||||
prepend-icon='business'
|
||||
persistent-hint
|
||||
hint='Name to use when displaying copyright notice in the footer. Leave empty to hide.'
|
||||
hint='Property tracking ID for Google Analytics. Leave empty to disable.'
|
||||
)
|
||||
v-flex(lg6 xs12)
|
||||
v-card.wiki-form
|
||||
v-toolbar(color='primary', dark, dense, flat)
|
||||
v-toolbar-title
|
||||
.subheading {{ $t('admin:general.siteBranding') }}
|
||||
v-subheader Logo
|
||||
v-card-text
|
||||
v-layout.pa-3(row, align-center)
|
||||
v-avatar(size='120', color='grey lighten-3', :tile='useSquareLogo')
|
||||
v-layout.px-3(row, align-center)
|
||||
v-avatar(size='120', color='grey lighten-3', :tile='config.logoIsSquare')
|
||||
.ml-4
|
||||
v-layout(row, align-center)
|
||||
v-btn(color='teal', depressed, dark)
|
||||
@@ -95,19 +101,23 @@
|
||||
.caption.grey--text An image of 120x120 pixels is recommended for best results.
|
||||
.caption.grey--text SVG, PNG or JPG files only.
|
||||
v-switch(
|
||||
v-model='useSquareLogo'
|
||||
v-model='config.logoIsSquare'
|
||||
label='Use Square Logo Frame'
|
||||
color='primary'
|
||||
persistent-hint
|
||||
hint='Check this option if a round logo frame doesn\'t work with your logo.'
|
||||
)
|
||||
v-divider.mt-3
|
||||
v-switch(
|
||||
v-model='displayMascot'
|
||||
label='Display Wiki.js Mascot'
|
||||
color='primary'
|
||||
v-divider
|
||||
v-subheader Footer Copyright
|
||||
.px-3.pb-3
|
||||
v-text-field(
|
||||
outline
|
||||
label='Company / Organization Name'
|
||||
v-model='config.company'
|
||||
:counter='255'
|
||||
prepend-icon='business'
|
||||
persistent-hint
|
||||
hint='Uncheck this box if you don\'t want Henry, Wiki.js mascot, to be displayed on client-facing pages.'
|
||||
hint='Name to use when displaying copyright notice in the footer. Leave empty to hide.'
|
||||
)
|
||||
|
||||
v-card.wiki-form.mt-3
|
||||
@@ -116,17 +126,25 @@
|
||||
.subheading Features
|
||||
v-card-text
|
||||
v-switch(
|
||||
v-model='featurePageRatings'
|
||||
label='Page Ratings'
|
||||
color='primary'
|
||||
v-model='config.featurePageRatings'
|
||||
persistent-hint
|
||||
hint='Allow users to rate pages.'
|
||||
)
|
||||
v-divider.mt-3
|
||||
v-switch(
|
||||
v-model='featurePersonalWiki'
|
||||
label='Page Comments'
|
||||
color='primary'
|
||||
v-model='config.featurePageComments'
|
||||
persistent-hint
|
||||
hint='Allow users to leave comments on pages.'
|
||||
)
|
||||
v-divider.mt-3
|
||||
v-switch(
|
||||
label='Personal Wikis'
|
||||
color='primary'
|
||||
v-model='config.featurePersonalWikis'
|
||||
persistent-hint
|
||||
hint='Allow users to have their own personal wiki.'
|
||||
)
|
||||
@@ -134,18 +152,34 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import _ from 'lodash'
|
||||
import { get, sync } from 'vuex-pathify'
|
||||
import siteConfigQuery from 'gql/admin/site/site-query-config.gql'
|
||||
import siteUpdateConfigMutation from 'gql/admin/site/site-mutation-save-config.gql'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
metaRobotsSelection: ['Index', 'Follow'],
|
||||
metaRobots: ['Index', 'Follow', 'No Index', 'No Follow'],
|
||||
useSquareLogo: false,
|
||||
displayMascot: true,
|
||||
featurePageRatings: true,
|
||||
featurePersonalWiki: true
|
||||
metaRobots: [
|
||||
{ text: 'Index', value: 'index' },
|
||||
{ text: 'Follow', value: 'follow' },
|
||||
{ text: 'No Index', value: 'noindex' },
|
||||
{ text: 'No Follow', value: 'nofollow' }
|
||||
],
|
||||
config: {
|
||||
host: '',
|
||||
title: '',
|
||||
description: '',
|
||||
keywords: '',
|
||||
robots: [],
|
||||
ga: '',
|
||||
company: '',
|
||||
hasLogo: false,
|
||||
logoIsSquare: false,
|
||||
featurePageRatings: false,
|
||||
featurePageComments: false,
|
||||
featurePersonalWikis: false
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -155,11 +189,51 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
async save () {
|
||||
this.$store.commit('showNotification', {
|
||||
message: 'Configuration saved successfully.',
|
||||
style: 'success',
|
||||
icon: 'check'
|
||||
})
|
||||
try {
|
||||
await this.$apollo.mutate({
|
||||
mutation: siteUpdateConfigMutation,
|
||||
variables: {
|
||||
host: this.config.host || '',
|
||||
title: this.config.title || '',
|
||||
description: this.config.description || '',
|
||||
keywords: this.config.keywords || '',
|
||||
robots: this.config.robots || [],
|
||||
ga: this.config.ga || '',
|
||||
company: this.config.company || '',
|
||||
hasLogo: this.config.hasLogo || false,
|
||||
logoIsSquare: this.config.logoIsSquare || false,
|
||||
featurePageRatings: this.config.featurePageRatings || false,
|
||||
featurePageComments: this.config.featurePageComments || false,
|
||||
featurePersonalWikis: this.config.featurePersonalWikis || false
|
||||
},
|
||||
watchLoading (isLoading) {
|
||||
this.$store.commit(`loading${isLoading ? 'Start' : 'Stop'}`, 'admin-site-update')
|
||||
}
|
||||
})
|
||||
this.$store.commit('showNotification', {
|
||||
style: 'success',
|
||||
message: 'Configuration saved successfully.',
|
||||
icon: 'check'
|
||||
})
|
||||
this.siteTitle = this.config.title
|
||||
this.company = this.config.company
|
||||
} catch (err) {
|
||||
this.$store.commit('showNotification', {
|
||||
style: 'red',
|
||||
message: err.message,
|
||||
icon: 'warning'
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
apollo: {
|
||||
config: {
|
||||
query: siteConfigQuery,
|
||||
fetchPolicy: 'network-only',
|
||||
update: (data) => _.cloneDeep(data.site.config),
|
||||
watchLoading (isLoading) {
|
||||
this.$store.commit(`loading${isLoading ? 'Start' : 'Stop'}`, 'admin-site-refresh')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -82,6 +82,7 @@
|
||||
item-text='name'
|
||||
:label='$t("admin:locale.activeNamespaces.label")'
|
||||
persistent-hint
|
||||
small-chips
|
||||
:hint='$t("admin:locale.activeNamespaces.hint")'
|
||||
)
|
||||
template(slot='item', slot-scope='data')
|
||||
|
@@ -3,10 +3,12 @@
|
||||
v-card.loader-dialog.radius-7(:color='color', dark)
|
||||
v-card-text.text-xs-center.py-4
|
||||
atom-spinner.is-inline(
|
||||
v-if='mode === `loading`'
|
||||
:animation-duration='1000'
|
||||
:size='60'
|
||||
color='#FFF'
|
||||
)
|
||||
img(v-else-if='mode === `icon`', :src='`/svg/icon-` + icon + `.svg`', :alt='icon')
|
||||
.subheading {{ title }}
|
||||
.caption {{ subtitle }}
|
||||
</template>
|
||||
@@ -34,6 +36,14 @@ export default {
|
||||
subtitle: {
|
||||
type: String,
|
||||
default: 'Please wait'
|
||||
},
|
||||
mode: {
|
||||
type: String,
|
||||
default: 'loading'
|
||||
},
|
||||
icon: {
|
||||
type: String,
|
||||
default: 'checkmark'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -47,5 +57,9 @@ export default {
|
||||
.caption {
|
||||
color: rgba(255,255,255,.7);
|
||||
}
|
||||
|
||||
img {
|
||||
width: 80px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@@ -90,7 +90,7 @@
|
||||
a.caption(href='/login', place='link') {{ $t('auth:switchToLogin.link') }}
|
||||
v-spacer
|
||||
|
||||
loader(v-model='isLoading', :color='loaderColor', :title='loaderTitle', :subtitle='$t(`auth:pleaseWait`)')
|
||||
loader(v-model='isLoading', :mode='loaderMode', :icon='loaderIcon', :color='loaderColor', :title='loaderTitle', :subtitle='loaderSubtitle')
|
||||
nav-footer(color='grey darken-4', dark-color='grey darken-4')
|
||||
</template>
|
||||
|
||||
@@ -119,7 +119,10 @@ export default {
|
||||
isLoading: false,
|
||||
isShown: false,
|
||||
loaderColor: 'grey darken-4',
|
||||
loaderTitle: 'Working...'
|
||||
loaderTitle: 'Working...',
|
||||
loaderSubtitle: 'Please wait',
|
||||
loaderMode: 'icon',
|
||||
loaderIcon: 'checkmark'
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -131,6 +134,7 @@ export default {
|
||||
this.isShown = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.iptEmail.focus()
|
||||
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
@@ -216,6 +220,8 @@ export default {
|
||||
} else {
|
||||
this.loaderColor = 'grey darken-4'
|
||||
this.loaderTitle = this.$t('auth:registering')
|
||||
this.loaderSubtitle = this.$t(`auth:pleaseWait`)
|
||||
this.loaderMode = 'loading'
|
||||
this.isLoading = true
|
||||
try {
|
||||
let resp = await this.$apollo.mutate({
|
||||
@@ -229,12 +235,11 @@ export default {
|
||||
if (_.has(resp, 'data.authentication.register')) {
|
||||
let respObj = _.get(resp, 'data.authentication.register', {})
|
||||
if (respObj.responseResult.succeeded === true) {
|
||||
this.loaderColor = 'green'
|
||||
this.loaderColor = 'grey darken-4'
|
||||
this.loaderTitle = this.$t('auth:registerSuccess')
|
||||
Cookies.set('jwt', respObj.jwt, { expires: 365 })
|
||||
_.delay(() => {
|
||||
window.location.replace('/')
|
||||
}, 1000)
|
||||
this.loaderSubtitle = this.$t(`auth:registerCheckEmail`)
|
||||
this.loaderMode = 'icon'
|
||||
this.isShown = false
|
||||
} else {
|
||||
throw new Error(respObj.responseResult.message)
|
||||
}
|
||||
|
Reference in New Issue
Block a user