feat: apollo upgrade to 2.0 + dev improvements + localization
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
'use strict'
|
||||
|
||||
/* global siteConfig */
|
||||
|
||||
import Vue from 'vue'
|
||||
import VueRouter from 'vue-router'
|
||||
import VueClipboards from 'vue-clipboards'
|
||||
import VueSimpleBreakpoints from 'vue-simple-breakpoints'
|
||||
import VeeValidate from 'vee-validate'
|
||||
import { ApolloClient } from 'apollo-client'
|
||||
import { BatchHttpLink } from 'apollo-link-batch-http'
|
||||
import { createPersistedQueryLink } from 'apollo-link-persisted-queries'
|
||||
// import { BatchHttpLink } from 'apollo-link-batch-http'
|
||||
import { createHttpLink } from 'apollo-link-http'
|
||||
import { InMemoryCache } from 'apollo-cache-inmemory'
|
||||
import VueApollo from 'vue-apollo'
|
||||
import Vuetify from 'vuetify'
|
||||
@@ -37,17 +41,22 @@ window.WIKI = null
|
||||
window.boot = boot
|
||||
window.Hammer = Hammer
|
||||
|
||||
moment.locale(siteConfig.lang)
|
||||
|
||||
// ====================================
|
||||
// Initialize Apollo Client (GraphQL)
|
||||
// ====================================
|
||||
|
||||
const graphQLEndpoint = window.location.protocol + '//' + window.location.host + '/graphql'
|
||||
|
||||
const graphQLLink = createPersistedQueryLink().concat(createHttpLink({
|
||||
includeExtensions: true,
|
||||
uri: graphQLEndpoint,
|
||||
credentials: 'include'
|
||||
}))
|
||||
|
||||
window.graphQL = new ApolloClient({
|
||||
link: new BatchHttpLink({
|
||||
uri: graphQLEndpoint,
|
||||
credentials: 'include'
|
||||
}),
|
||||
link: graphQLLink,
|
||||
cache: new InMemoryCache(),
|
||||
connectToDevTools: (process.env.node_env === 'development')
|
||||
})
|
||||
|
@@ -189,6 +189,7 @@ export default {
|
||||
const resp = _.get(respRaw, 'data.localization.updateLocale.responseResult', {})
|
||||
if (resp.succeeded) {
|
||||
WIKI.$i18n.i18next.changeLanguage(this.selectedLocale)
|
||||
WIKI.$moment.locale(this.selectedLocale)
|
||||
this.$store.commit('showNotification', {
|
||||
message: 'Locale settings updated successfully.',
|
||||
style: 'success',
|
||||
@@ -207,6 +208,7 @@ export default {
|
||||
apollo: {
|
||||
locales: {
|
||||
query: localesQuery,
|
||||
fetchPolicy: 'network-only',
|
||||
update: (data) => data.localization.locales.map(lc => ({ ...lc, isDownloading: false })),
|
||||
watchLoading (isLoading) {
|
||||
this.$store.commit(`loading${isLoading ? 'Start' : 'Stop'}`, 'admin-locale-refresh')
|
||||
|
@@ -2,8 +2,8 @@
|
||||
v-container(fluid, fill-height, grid-list-lg)
|
||||
v-layout(row, wrap)
|
||||
v-flex(xs12)
|
||||
.headline.primary--text System Info
|
||||
.subheading.grey--text Information about your system
|
||||
.headline.primary--text {{ $t('admin:system.title') }}
|
||||
.subheading.grey--text {{ $t('admin:system.subtitle') }}
|
||||
v-layout.mt-3(row wrap)
|
||||
v-flex(lg6 xs12)
|
||||
v-card
|
||||
@@ -14,55 +14,55 @@
|
||||
v-list-tile-avatar
|
||||
v-icon.blue.white--text system_update_alt
|
||||
v-list-tile-content
|
||||
v-list-tile-title Current Version
|
||||
v-list-tile-title {{ $t('admin:system.currentVersion') }}
|
||||
v-list-tile-sub-title {{ info.currentVersion }}
|
||||
v-list-tile(avatar)
|
||||
v-list-tile-avatar
|
||||
v-icon.blue.white--text open_in_browser
|
||||
v-list-tile-content
|
||||
v-list-tile-title Latest Version
|
||||
v-list-tile-title {{ $t('admin:system.latestVersion') }}
|
||||
v-list-tile-sub-title {{ info.latestVersion }}
|
||||
v-list-tile-action
|
||||
v-list-tile-action-text Published X days ago
|
||||
v-list-tile-action-text {{ $t('admin:system.published') }} {{ info.latestVersionReleaseDate | moment('from') }}
|
||||
|
||||
v-divider
|
||||
|
||||
v-subheader Host Information
|
||||
v-subheader {{ $t('admin:system.hostInfo') }}
|
||||
v-list-tile(avatar)
|
||||
v-list-tile-avatar
|
||||
v-icon.blue-grey.white--text bubble_chart
|
||||
v-list-tile-content
|
||||
v-list-tile-title Operating System
|
||||
v-list-tile-title {{ $t('admin:system.os') }}
|
||||
v-list-tile-sub-title {{ info.operatingSystem }}
|
||||
v-list-tile(avatar)
|
||||
v-list-tile-avatar
|
||||
v-icon.blue-grey.white--text computer
|
||||
v-list-tile-content
|
||||
v-list-tile-title Hostname
|
||||
v-list-tile-title {{ $t('admin:system.hostname') }}
|
||||
v-list-tile-sub-title {{ info.hostname }}
|
||||
v-list-tile(avatar)
|
||||
v-list-tile-avatar
|
||||
v-icon.blue-grey.white--text nfc
|
||||
v-list-tile-content
|
||||
v-list-tile-title CPU Cores
|
||||
v-list-tile-title {{ $t('admin:system.cpuCores') }}
|
||||
v-list-tile-sub-title {{ info.cpuCores }}
|
||||
v-list-tile(avatar)
|
||||
v-list-tile-avatar
|
||||
v-icon.blue-grey.white--text memory
|
||||
v-list-tile-content
|
||||
v-list-tile-title Total RAM
|
||||
v-list-tile-title {{ $t('admin:system.totalRAM') }}
|
||||
v-list-tile-sub-title {{ info.ramTotal }}
|
||||
v-list-tile(avatar)
|
||||
v-list-tile-avatar
|
||||
v-icon.blue-grey.white--text last_page
|
||||
v-list-tile-content
|
||||
v-list-tile-title Working Directory
|
||||
v-list-tile-title {{ $t('admin:system.workingDirectory') }}
|
||||
v-list-tile-sub-title {{ info.workingDirectory }}
|
||||
v-list-tile(avatar)
|
||||
v-list-tile-avatar
|
||||
v-icon.blue-grey.white--text settings
|
||||
v-list-tile-content
|
||||
v-list-tile-title Configuration File
|
||||
v-list-tile-title {{ $t('admin:system.configFile') }}
|
||||
v-list-tile-sub-title {{ info.configFile }}
|
||||
|
||||
v-flex(lg6 xs12)
|
||||
@@ -87,7 +87,7 @@
|
||||
v-list-tile-title {{ info.redisVersion }}
|
||||
v-list-tile-sub-title {{ info.redisHost }}
|
||||
v-list-tile-action
|
||||
v-list-tile-action-text RAM Usage: {{ info.redisUsedRAM }} / {{ info.redisTotalRAM }}
|
||||
v-list-tile-action-text {{ $t('admin:system.ramUsage', { used: info.redisUsedRAM, total: info.redisTotalRAM }) }}
|
||||
|
||||
v-divider
|
||||
|
||||
|
@@ -35,7 +35,7 @@
|
||||
button.button.is-blue.is-fullwidth(@click='verifySecurityCode')
|
||||
span {{ $t('auth:tfa.verifyToken') }}
|
||||
.login-copyright
|
||||
span {{ $t('footer.poweredBy') }}
|
||||
span {{ $t('common:footer.poweredBy') }}
|
||||
a(href='https://wiki.js.org', rel='external', title='Wiki.js') Wiki.js
|
||||
|
||||
v-snackbar(
|
||||
|
13
client/graph/admin-users-query-list.gql
Normal file
13
client/graph/admin-users-query-list.gql
Normal file
@@ -0,0 +1,13 @@
|
||||
query {
|
||||
users {
|
||||
list {
|
||||
id
|
||||
name
|
||||
email
|
||||
provider
|
||||
role
|
||||
createdAt
|
||||
updatedAt
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user