feat: locales remote fetch+ deps update + fixes

This commit is contained in:
NGPixel
2018-04-29 17:55:36 -04:00
parent 3752cf7415
commit 7786f9042f
30 changed files with 1374 additions and 1106 deletions

View File

@@ -34,12 +34,8 @@
</template>
<script>
import IconHomeAlert from 'mdi/home-alert'
export default {
components: {
IconHomeAlert
},
data() {
return {
siteTitle: 'Wiki.js',

View File

@@ -8,19 +8,35 @@
v-layout(row wrap)
v-flex(lg6 xs12)
v-card
v-toolbar(color='primary', dark, dense, flat)
v-toolbar(color='grey darken-3', dark, dense, flat)
v-toolbar-title
.subheading Locale Settings
v-card-text
v-select(:items='locales', prepend-icon='public', v-model='selectedLocale', label='Site Locale', persistent-hint, hint='All UI text elements will be displayed in selected language.')
v-select(:items='installedLocales'
prepend-icon='public'
v-model='selectedLocale'
item-text='name'
label='Site Locale'
persistent-hint
hint='All UI text elements will be displayed in selected language.'
)
template(slot='item', slot-scope='data')
v-list-tile-avatar
v-avatar.blue.white--text(tile, size='40', v-html='data.item.value.toUpperCase()')
v-list-tile-content
v-list-tile-title(v-html='data.item.text')
v-list-tile-sub-title(v-html='data.item.original')
template(v-if='typeof data.item !== "object"')
v-list-tile-content(v-text='data.item')
template(v-else)
v-list-tile-avatar
v-avatar.blue.white--text(tile, size='40', v-html='data.item.code.toUpperCase()')
v-list-tile-content
v-list-tile-title(v-html='data.item.name')
v-list-tile-sub-title(v-html='data.item.nativeName')
v-divider
v-switch(v-model='rtlEnabled', label='RTL Display Mode', color='primary', persistent-hint, hint='For Right-to-Left languages, e.g. Arabic')
v-switch(
v-model='autoUpdate'
label='Update Automatically'
color='primary'
persistent-hint
hint='Automatically download updates to this locale as they become available.'
)
v-divider
.px-3.pb-3
v-btn(color='primary') Save
@@ -30,52 +46,46 @@
v-toolbar-title
.subheading Download Locale
v-list
v-list-tile(@click='')
v-list-tile(v-for='lc in locales')
v-list-tile-avatar
v-avatar.teal.white--text(tile, size='40') ZH
v-avatar.teal.white--text(tile, size='40') {{lc.code.toUpperCase()}}
v-list-tile-content
v-list-tile-title Chinese
v-list-tile-sub-title 中文
v-list-tile-action
v-btn(icon)
v-list-tile-title(v-html='lc.name')
v-list-tile-sub-title(v-html='lc.nativeName')
v-list-tile-action(v-if='lc.isInstalled && lc.installDate < lc.updatedAt')
v-icon.blue--text cached
v-list-tile-action(v-else-if='lc.isInstalled')
v-icon.green--text check
v-list-tile-action(v-else)
v-btn(icon, @click='')
v-icon.grey--text cloud_download
v-list-tile(@click='')
v-list-tile-avatar
v-avatar.teal.white--text(tile, size='40') EN
v-list-tile-content
v-list-tile-title English
v-list-tile-sub-title English
v-list-tile-action
v-icon.green--text check
v-list-tile(@click='')
v-list-tile-avatar
v-avatar.teal.white--text(tile, size='40') FR
v-list-tile-content
v-list-tile-title French
v-list-tile-sub-title Français
v-list-tile-action
v-icon.green--text check
v-list-tile(@click='')
v-list-tile-avatar
v-avatar.teal.white--text(tile, size='40') RU
v-list-tile-content
v-list-tile-title Russian
v-list-tile-sub-title Русский
v-list-tile-action
v-btn(icon)
v-icon.blue--text update
</template>
<script>
import _ from 'lodash'
import localesQuery from 'gql/admin-locale-query-list.gql'
export default {
data() {
return {
locales: [
{ text: 'English', original: 'English', value: 'en' },
{ text: 'French', original: 'Français', value: 'fr' }
],
locales: [],
selectedLocale: 'en',
rtlEnabled: false
autoUpdate: true
}
},
computed: {
installedLocales() {
return _.filter(this.locales, ['isInstalled', true])
}
},
apollo: {
locales: {
query: localesQuery,
update: (data) => data.localization.locales,
watchLoading (isLoading) {
this.$store.commit(`loading${isLoading ? 'Start' : 'Stop'}`, 'admin-locale-refresh')
}
}
}
}

View File

@@ -8,7 +8,7 @@
v-layout(row wrap)
v-flex(lg6 xs12)
v-card
v-toolbar(color='primary', dark, dense, flat)
v-toolbar(color='grey darken-3', dark, dense, flat)
v-toolbar-title
.subheading Theme
v-card-text
@@ -20,16 +20,16 @@
v-list-tile-title(v-html='data.item.text')
v-list-tile-sub-title(v-html='data.item.author')
v-divider
v-switch(v-model='darkMode', label='Dark Mode', color='primary', persistent-hint, hint='Not recommended for accessibility')
v-switch(v-model='darkMode', label='Dark Mode', color='primary', persistent-hint, hint='Not recommended for accessibility.')
v-divider
.px-3.pb-3
v-btn(color='primary') Save
v-flex(lg6 xs12)
v-card
v-toolbar(color='primary', dark, dense, flat)
v-toolbar(color='teal', dark, dense, flat)
v-toolbar-title
.subheading ---
v-card-text ---
.subheading Download Themes
v-card-text.caption -- Coming soon --
</template>
<script>

View File

@@ -14,7 +14,7 @@
v-layout(row, wrap)
v-flex(xs12, sm6)
v-card
v-toolbar(color='primary', dark, dense, flat)
v-toolbar(color='grey darken-3', dark, dense, flat)
v-toolbar-title
.subheading Authentication
v-subheader Flush User Sessions
@@ -31,14 +31,25 @@
span Proceed
v-flex(xs12, sm6)
v-card
v-toolbar(color='primary', dark, dense, flat)
v-toolbar(color='grey darken-3', dark, dense, flat)
v-toolbar-title
.subheading Maintenance Mode
v-card-text
.body-1 Maintenance mode restrict access to the site to administrators only, regarless of current permissions.
v-btn.mt-3(color='orange darken-2', dark)
v-btn.mt-3.ml-0(color='orange darken-2', depressed, dark)
icon-home-alert.mr-2(fillColor='#FFFFFF')
| Turn On Maintenance Mode
v-card.mt-3
v-toolbar(color='grey darken-3', dark, dense, flat)
v-toolbar-title
.subheading Graph Endpoint
v-card-text
.body-1 The Graph API Endpoint from which remote resources like locales, themes and plugins are fetched.
.caption Do not change unless you know what you're doing!
v-text-field.my-2.grey.lighten-3(solo, flat, label='Graph Endpoint', value='https://graph.requarks.io')
v-btn.ml-0(color='primary', depressed, dark)
v-icon(left) chevron_right
span Save
v-tab-item(key='telemetry', :transition='false', :reverse-transition='false')
v-card.pa-3
@@ -110,10 +121,12 @@
<script>
import IconGithubCircle from 'mdi/github-circle'
import IconHomeAlert from 'mdi/home-alert'
export default {
components: {
IconGithubCircle
IconGithubCircle,
IconHomeAlert
},
data() {
return {