vue-i18n
en
This commit is contained in:
parent
769b039365
commit
5e268540a1
15 changed files with 364 additions and 72 deletions
10
.env
10
.env
|
@ -1,4 +1,6 @@
|
|||
VUE_APP_APIENDPOINT="/api/"
|
||||
VUE_APP_APIVERSION="v1"
|
||||
VUE_APP_GATEWAYENDPOINT="https://gateway.kaverti.com"
|
||||
VUE_APP_STAGING=false
|
||||
VUE_APP_APIENDPOINT=/api/
|
||||
VUE_APP_APIVERSION=v1
|
||||
VUE_APP_GATEWAYENDPOINT=https://gateway.kaverti.com
|
||||
VUE_APP_STAGING=false
|
||||
VUE_APP_I18N_LOCALE=en
|
||||
VUE_APP_I18N_FALLBACK_LOCALE=en
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build",
|
||||
"lint": "vue-cli-service lint"
|
||||
"lint": "vue-cli-service lint",
|
||||
"i18n:report": "vue-cli-service i18n:report --src './src/**/*.?(js|vue)' --locales './src/locales/**/*.json'"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vue/cli": "^4.5.10",
|
||||
|
@ -18,12 +19,14 @@
|
|||
"to-boolean": "^1.0.0",
|
||||
"vue": "^2.6.11",
|
||||
"vue-axios": "^3.2.2",
|
||||
"vue-i18n": "^8.17.3",
|
||||
"vue-keypress": "^2.1.1",
|
||||
"vue-router": "^3.2.0",
|
||||
"vue-socket.io": "^3.0.10",
|
||||
"vuex": "^3.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@intlify/vue-i18n-loader": "^1.0.0",
|
||||
"@vue/cli-plugin-babel": "~4.5.0",
|
||||
"@vue/cli-plugin-eslint": "~4.5.0",
|
||||
"@vue/cli-plugin-router": "~4.5.0",
|
||||
|
@ -34,6 +37,7 @@
|
|||
"eslint-plugin-vue": "^6.2.2",
|
||||
"node-sass": "4.14.1",
|
||||
"sass-loader": "^8.0.2",
|
||||
"vue-cli-plugin-i18n": "~1.0.1",
|
||||
"vue-template-compiler": "^2.6.11"
|
||||
},
|
||||
"eslintConfig": {
|
||||
|
|
|
@ -39,7 +39,7 @@ export default {
|
|||
this.$store.commit('setWind', wind)
|
||||
Object.assign(axios.defaults, {headers: {Authorization: this.$store.state.user.token}})
|
||||
if(this.$store.state.debug) {
|
||||
this.$buefy.snackbar.open({message:`Warning: You are using a development build of Kaverti, expect instabilities.`, type: 'is-warning'})
|
||||
this.$buefy.snackbar.open({message:this.$t('errors.devBuild'), type: 'is-warning'})
|
||||
}
|
||||
this.axios.get(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'userinfo')
|
||||
.then(res => {
|
||||
|
@ -51,7 +51,7 @@ export default {
|
|||
this.$store.commit('setID', res.data.id)
|
||||
this.$store.commit('setBot', res.data.bot)
|
||||
}).catch(() => {
|
||||
this.$buefy.snackbar.open({message:`Error occurred while fetching user information.`, type: 'is-warning'})
|
||||
this.$buefy.snackbar.open({message:this.$t('errors.authFail'), type: 'is-warning'})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,19 @@
|
|||
<template>
|
||||
<div class="footer">
|
||||
<h1>© 2021 Kaverti</h1>
|
||||
<div class="locale-changer">
|
||||
Lang:
|
||||
<select v-model="$i18n.locale">
|
||||
<option v-for="(lang, i) in langs" :key="`Lang${i}`" :value="lang">{{ lang }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'locale-changer',
|
||||
data () {
|
||||
return { langs: ['en', 'debug', 'wind'] }
|
||||
}
|
||||
}
|
||||
</script>
|
17
src/components/HelloI18n.vue
Normal file
17
src/components/HelloI18n.vue
Normal file
|
@ -0,0 +1,17 @@
|
|||
<template>
|
||||
<p>{{ $t('hello') }}</p>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'HelloI18n'
|
||||
}
|
||||
</script>
|
||||
|
||||
<i18n>
|
||||
{
|
||||
"en": {
|
||||
"hello": "Hello i18n in SFC!"
|
||||
}
|
||||
}
|
||||
</i18n>
|
|
@ -3,7 +3,7 @@
|
|||
<b-modal :active="ajaxErrorModal" @update:active="value => ajaxErrorModal = value" :width="640" scroll="keep" style="z-index: 200">
|
||||
<div class="modal-card" style="width: auto">
|
||||
<header class="modal-card-head">
|
||||
<p class="modal-card-title">Something went wrong...</p>
|
||||
<p class="modal-card-title">{{$t('errorModalTitle')}}</p>
|
||||
<button
|
||||
type="button"
|
||||
class="delete"
|
||||
|
@ -14,126 +14,126 @@
|
|||
</section>
|
||||
<footer class="modal-card-foot">
|
||||
<b-button
|
||||
label="Got it"
|
||||
:label="$t('gotIt')"
|
||||
@click="$emit('close')" />
|
||||
</footer>
|
||||
</div>
|
||||
</b-modal>
|
||||
<b-modal :active="loginModal" @update:active="value => loginModal = value" :width="640" scroll="keep">
|
||||
<b-form>
|
||||
<form>
|
||||
<div class="modal-card" style="width: auto">
|
||||
<header class="modal-card-head">
|
||||
<p class="modal-card-title">Login to Kaverti</p>
|
||||
<p class="modal-card-title">{{ $t('login.title') }}</p>
|
||||
<button
|
||||
type="button"
|
||||
class="delete"
|
||||
@click="$emit('close')"/>
|
||||
</header>
|
||||
<section class="modal-card-body">
|
||||
<b-field label="Username or Email">
|
||||
<b-field :label="$t('login.loginUsername')">
|
||||
<b-input
|
||||
:value="login.username"
|
||||
v-model="login.username"
|
||||
placeholder="Your username or email"
|
||||
:placeholder="$t('login.loginUsername')"
|
||||
required>
|
||||
</b-input>
|
||||
</b-field>
|
||||
|
||||
<b-field label="Password">
|
||||
<b-field :label="$t('login.loginPassword')">
|
||||
<b-input
|
||||
type="password"
|
||||
:value="login.password"
|
||||
v-model="login.password"
|
||||
password-reveal
|
||||
placeholder="Your password"
|
||||
:placeholder="$t('login.loginPassword')"
|
||||
required>
|
||||
</b-input>
|
||||
</b-field>
|
||||
<b-checkbox v-model="login.doNotSaveToken">Do not save authentication token in browser (Logout when refreshed)</b-checkbox>
|
||||
<b-checkbox v-model="login.doNotSaveToken">{{$t('login.doNotSaveAuth')}}</b-checkbox>
|
||||
</section>
|
||||
<footer class="modal-card-foot">
|
||||
<b-button
|
||||
@click="doLogin()"
|
||||
label="Login"
|
||||
:label="$t('login.login')"
|
||||
:loading="login.loading"
|
||||
type="is-primary" />
|
||||
<b-button
|
||||
label="Close"
|
||||
:label="$t('close')"
|
||||
@click="$emit('close')" />
|
||||
<b-button
|
||||
@click="registerModal = true; loginModal = false"
|
||||
label="Need an account?"
|
||||
:label="$t('login.register')"
|
||||
type="is-success" />
|
||||
</footer>
|
||||
</div>
|
||||
</b-form>
|
||||
</form>
|
||||
</b-modal>
|
||||
<b-modal :active="registerModal" @update:active="value => registerModal = value" :width="640" scroll="keep">
|
||||
<b-form>
|
||||
<form>
|
||||
<div class="modal-card" style="width: auto">
|
||||
<header class="modal-card-head">
|
||||
<p class="modal-card-title">Register to Kaverti</p>
|
||||
<p class="modal-card-title">{{$t('register.title')}}</p>
|
||||
<button
|
||||
type="button"
|
||||
class="delete"
|
||||
@click="$emit('close')"/>
|
||||
</header>
|
||||
<section class="modal-card-body">
|
||||
<b-field label="Username">
|
||||
<b-field :label="$t('register.username')">
|
||||
<b-input
|
||||
:value="register.username"
|
||||
v-model="register.username"
|
||||
placeholder="Your username or email"
|
||||
:placeholder="$t('register.username')"
|
||||
required>
|
||||
</b-input>
|
||||
</b-field>
|
||||
<b-field label="Email">
|
||||
<b-field :label="$t('register.email')">
|
||||
<b-input
|
||||
type="email"
|
||||
:value="register.email"
|
||||
v-model="register.email"
|
||||
placeholder="Your username or email"
|
||||
:placeholder="$t('register.email')"
|
||||
required>
|
||||
</b-input>
|
||||
</b-field>
|
||||
<b-field label="Password">
|
||||
<b-field :label="$t('register.password')">
|
||||
<b-input
|
||||
type="password"
|
||||
:value="register.password"
|
||||
v-model="register.password"
|
||||
password-reveal
|
||||
placeholder="Your password"
|
||||
:placeholder="$t('register.password')"
|
||||
required>
|
||||
</b-input>
|
||||
</b-field>
|
||||
<b-field label="Password Confirmation">
|
||||
<b-field :label="$t('register.confirm')">
|
||||
<b-input
|
||||
type="password"
|
||||
:value="register.confirm"
|
||||
v-model="register.confirm"
|
||||
password-reveal
|
||||
placeholder="Your password"
|
||||
:placeholder="$t('register.confirm')"
|
||||
required>
|
||||
</b-input>
|
||||
</b-field>
|
||||
<b-checkbox v-model="register.agree">I agree to the <router-link to="/legal/tos">Terms of Service</router-link></b-checkbox>
|
||||
<b-checkbox v-model="register.agree">{{$t('register.agree')}} <router-link to="/legal/tos">{{$t('tos')}}</router-link></b-checkbox>
|
||||
</section>
|
||||
<footer class="modal-card-foot">
|
||||
<b-button
|
||||
@click="doRegister()"
|
||||
label="Register"
|
||||
:label="$t('register.text')"
|
||||
:loading="register.loading"
|
||||
type="is-primary" />
|
||||
<b-button
|
||||
label="Close"
|
||||
:label="$t('close')"
|
||||
@click="$emit('close')" />
|
||||
<b-button
|
||||
@click="registerModal = false; loginModal = true"
|
||||
label="Have an account?"
|
||||
:label="$t('register.login')"
|
||||
type="is-success" />
|
||||
</footer>
|
||||
</div>
|
||||
</b-form>
|
||||
</form>
|
||||
</b-modal>
|
||||
<b-navbar>
|
||||
<template #brand>
|
||||
|
@ -146,18 +146,24 @@
|
|||
</template>
|
||||
<template #start>
|
||||
<b-navbar-item href="#">
|
||||
Home
|
||||
{{$t('navbar.home')}}
|
||||
</b-navbar-item>
|
||||
<b-navbar-item href="#">
|
||||
Documentation
|
||||
{{$t('navbar.marketplace')}}
|
||||
</b-navbar-item>
|
||||
<b-navbar-item href="#">
|
||||
{{$t('navbar.teams')}}
|
||||
</b-navbar-item>
|
||||
<b-navbar-item href="#">
|
||||
{{$t('navbar.games')}}
|
||||
</b-navbar-item>
|
||||
<div v-if="$store.state.debug" class="navbar-item has-dropdown is-hoverable is-info">
|
||||
<a class="navbar-link">
|
||||
<p>Developer Options</p>
|
||||
<p>{{$t('navbar.dev.title')}}</p>
|
||||
</a>
|
||||
<div class="navbar-dropdown">
|
||||
<b-navbar-item tag="router-link" to="/debug">Debug Page</b-navbar-item>
|
||||
<b-navbar-item @click="fakeUser()">Fake User</b-navbar-item>
|
||||
<b-navbar-item tag="router-link" to="/debug">{{$t('navbar.dev.debug')}}</b-navbar-item>
|
||||
<b-navbar-item @click="fakeUser()">{{$t('navbar.dev.fakeUser')}}</b-navbar-item>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -167,10 +173,10 @@
|
|||
<b-navbar-item v-if="!$store.state.user.username" tag="div">
|
||||
<div class="buttons">
|
||||
<b-button @click="registerModal = true" class="button is-primary">
|
||||
<strong>Register</strong>
|
||||
<strong>{{$t('navbar.register')}}</strong>
|
||||
</b-button>
|
||||
<b-button @click="loginModal = true" class="button is-light">
|
||||
Log in
|
||||
{{$t('navbar.login')}}
|
||||
</b-button>
|
||||
</div>
|
||||
</b-navbar-item>
|
||||
|
@ -180,12 +186,13 @@
|
|||
<p>{{$store.state.user.username}}</p>
|
||||
</a>
|
||||
<div class="navbar-dropdown">
|
||||
<b-navbar-item tag="router-link" :to="'/u/' + $store.state.user.username">My profile</b-navbar-item>
|
||||
<b-navbar-item tag="router-link" to="/settings">Settings</b-navbar-item>
|
||||
<b-navbar-item tag="router-link" to="/transactions">Transactions</b-navbar-item>
|
||||
<b-navbar-item tag="router-link" to="/character">My Avatar</b-navbar-item>
|
||||
<b-navbar-item tag="router-link" to="/downloads">Downloads</b-navbar-item>
|
||||
<b-navbar-item @click="fakeUser()">Logout</b-navbar-item>
|
||||
<b-navbar-item tag="router-link" :to="'/u/' + $store.state.user.username">{{$t('navbar.user.profile')}}</b-navbar-item>
|
||||
<b-navbar-item tag="router-link" to="/settings">{{$t('navbar.user.settings')}}</b-navbar-item>
|
||||
<b-navbar-item tag="router-link" to="/transactions">{{$t('navbar.user.transactions')}}</b-navbar-item>
|
||||
<b-navbar-item tag="router-link" to="/character">{{$t('navbar.user.avatar')}}</b-navbar-item>
|
||||
<b-navbar-item tag="router-link" to="/creations">{{$t('navbar.user.creations')}}</b-navbar-item>
|
||||
<b-navbar-item tag="router-link" to="/downloads">{{$t('navbar.user.downloads')}}</b-navbar-item>
|
||||
<b-navbar-item @click="logout()">{{$t('navbar.user.logout')}}</b-navbar-item>
|
||||
</div>
|
||||
</div>
|
||||
</b-navbar-item>
|
||||
|
|
22
src/i18n.js
Normal file
22
src/i18n.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
import Vue from 'vue'
|
||||
import VueI18n from 'vue-i18n'
|
||||
|
||||
Vue.use(VueI18n)
|
||||
|
||||
function loadLocaleMessages () {
|
||||
const locales = require.context('./locales', true, /[A-Za-z0-9-_,\s]+\.json$/i)
|
||||
const messages = {}
|
||||
locales.keys().forEach(key => {
|
||||
const matched = key.match(/([A-Za-z0-9-_]+)\./i)
|
||||
if (matched && matched.length > 1) {
|
||||
const locale = matched[1]
|
||||
messages[locale] = locales(key)
|
||||
}
|
||||
})
|
||||
return messages
|
||||
}
|
||||
|
||||
export default new VueI18n({
|
||||
locale: process.env.VUE_APP_I18N_LOCALE || 'en',
|
||||
messages: loadLocaleMessages()
|
||||
})
|
3
src/locales/debug.json
Normal file
3
src/locales/debug.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"message": "hello i18n !!"
|
||||
}
|
71
src/locales/en.json
Normal file
71
src/locales/en.json
Normal file
|
@ -0,0 +1,71 @@
|
|||
{
|
||||
"login": {
|
||||
"title": "Login to Kaverti",
|
||||
"login": "Login",
|
||||
"loginPassword": "Please enter your password",
|
||||
"loginUsername": "Please enter your username or email",
|
||||
"doNotSaveAuth": "Do not save token to browser (will be logged out when refreshed)",
|
||||
"register": "Don't have an account?"
|
||||
},
|
||||
"register": {
|
||||
"title": "Register to Kaverti",
|
||||
"text": "Register",
|
||||
"username": "Please enter your username",
|
||||
"email": "Please enter your valid email",
|
||||
"password": "Please enter a secure password",
|
||||
"confirm": "Please re-enter the secure password",
|
||||
"login": "Already have a Kaverti account?",
|
||||
"agree": "Do you agree to the "
|
||||
},
|
||||
"navbar": {
|
||||
"home": "Home",
|
||||
"forums": "Forums",
|
||||
"marketplace": "Marketplace",
|
||||
"downloads": "Downloads",
|
||||
"games": "Games",
|
||||
"users": "Users",
|
||||
"teams": "Teams",
|
||||
"dev": {
|
||||
"title": "Developer Options",
|
||||
"fakeUser": "Fake User Auth",
|
||||
"debug": "Debug Page"
|
||||
},
|
||||
"user": {
|
||||
"title": "Unknown",
|
||||
"profile": "My Profile",
|
||||
"creations": "My Creations",
|
||||
"downloads": "Downloads",
|
||||
"avatar": "My Avatar",
|
||||
"transactions": "Transactions",
|
||||
"settings": "Settings",
|
||||
"logout": "Logout"
|
||||
},
|
||||
"register": "Register",
|
||||
"login": "Login"
|
||||
},
|
||||
"404": {
|
||||
"title": "404 Not Found",
|
||||
"text": "Oh uh! You must've entered the address wrong!",
|
||||
"quoteText": "There is currently 2900 WIND quotes available",
|
||||
"windQuote": "WIND Quote",
|
||||
"home": "Go Home"
|
||||
},
|
||||
"debug": {
|
||||
"title": "Debug mode enabled",
|
||||
"authUser": "Authenticated user",
|
||||
"state": "State dump",
|
||||
"userState": "User state dump",
|
||||
"token": "Auth token in state",
|
||||
"disable": "Disable debug options",
|
||||
"auth": "Test authentication"
|
||||
},
|
||||
"errors": {
|
||||
"authFail": "Request failed, you are not authenticated.",
|
||||
"devBuild": "Warning: You are using a development build of Kaverti, expect instabilities.",
|
||||
"disableDebug": "Debug mode disabled, you will no longer have access to development features until you refresh.",
|
||||
"authSuccess": "Request successful, your token is valid, and the Kaverti server instance is running correctly."
|
||||
},
|
||||
"close": "Close",
|
||||
"tos": "Terms of Service",
|
||||
"errorModalTitle": "Something went wrong..."
|
||||
}
|
72
src/locales/wind.json
Normal file
72
src/locales/wind.json
Normal file
|
@ -0,0 +1,72 @@
|
|||
{
|
||||
"login": {
|
||||
"title": "dont tell anyone the new domain",
|
||||
"login": "im never firing you btw your my best friend xzd xd",
|
||||
"loginPassword": "I mean cyrex would still have the £75 but I'll give user it back bit by bit",
|
||||
"loginUsername": "u wanna help now?",
|
||||
"doNotSaveAuth": "yo yo",
|
||||
"register": "Don't have an account?"
|
||||
},
|
||||
"register": {
|
||||
"title": "no I am not, I am wlnd, aka Alex",
|
||||
"text": "i just need the phpmyadmin login details",
|
||||
"username": "honestly go fuck yourself",
|
||||
"email": "this is fucking dumb",
|
||||
"password": "would mind doing me a favour",
|
||||
"confirm": "dont tell anyone",
|
||||
"login": "can i get my twitter handle back lol",
|
||||
"agree": "Price has been reduced to £10 "
|
||||
},
|
||||
"navbar": {
|
||||
"home": "ok £50 extra",
|
||||
"forums": "can u fix that for £10 extra",
|
||||
"marketplace": "£30 Its the last thing im asking for troplo.",
|
||||
"downloads": "dont tell anyone who i am here",
|
||||
"games": "have u seen bloxtopia's games",
|
||||
"users": "Users",
|
||||
"teams": "gonna help kyle also bring tetrimus back",
|
||||
"dev": {
|
||||
"title": "i might come back to development",
|
||||
"fakeUser": "user : root",
|
||||
"debug": "fixed the hta"
|
||||
},
|
||||
"user": {
|
||||
"title": "Unknown",
|
||||
"profile": "",
|
||||
"creations": "My Creations",
|
||||
"downloads": "Downloads",
|
||||
"avatar": "My Avatar",
|
||||
"transactions": "Transactions",
|
||||
"settings": "Settings",
|
||||
"logout": "Logout"
|
||||
},
|
||||
"register": "u got the .net?",
|
||||
"login": "/phpmyadmin"
|
||||
},
|
||||
"404": {
|
||||
"title": "systemctl start httpd??",
|
||||
"text": "Error 521 Ray ID: 4f3226667865dc3b how to fix",
|
||||
"quoteText": "There is currently 2900 WIND quotes available",
|
||||
"windQuote": "without https works",
|
||||
"home": "£1m"
|
||||
},
|
||||
"debug": {
|
||||
"title": "Debug mode enabled",
|
||||
"authUser": "Authenticated user",
|
||||
"state": "State dump",
|
||||
"userState": "User state dump",
|
||||
"token": "Auth token in state",
|
||||
"disable": "Disable debug options",
|
||||
"auth": "Test authentication"
|
||||
},
|
||||
"errors": {
|
||||
"authFail": "i control the files",
|
||||
"devBuild": "ok so i put this and it instantly redirects to unbale",
|
||||
"disableDebug": "Debug mode disabled, you will no longer have access to development features until you refresh.",
|
||||
"authSuccess": "Request successful, your token is valid, and the Kaverti server instance is running correctly."
|
||||
},
|
||||
"close": "I've just told the full truth to logan",
|
||||
"tos": "get the fuck over it, it was never a scam",
|
||||
"gotIt": "that is wind for you",
|
||||
"errorModalTitle": "{INSERT PHP ERROR} We'll you are getting paid alot"
|
||||
}
|
|
@ -5,6 +5,7 @@ import store from './store'
|
|||
import Buefy from 'buefy'
|
||||
import axios from 'axios'
|
||||
import VueAxios from 'vue-axios'
|
||||
import i18n from './i18n'
|
||||
Vue.use(VueAxios, axios)
|
||||
Vue.use(Buefy)
|
||||
Vue.config.productionTip = false
|
||||
|
@ -12,5 +13,6 @@ Vue.config.productionTip = false
|
|||
new Vue({
|
||||
router,
|
||||
store,
|
||||
i18n,
|
||||
render: h => h(App)
|
||||
}).$mount('#app')
|
||||
|
|
|
@ -4,16 +4,16 @@
|
|||
<div class="hero-body">
|
||||
<div class="container">
|
||||
<h1 class="title">
|
||||
404 Not Found
|
||||
{{$t('404.title')}}
|
||||
</h1>
|
||||
<h2 class="subtitle" v-on:click.ctrl="saveWind" v-if="!$store.state.wind">
|
||||
Oh uh! You must've entered the address wrong!
|
||||
{{$t('404.text')}}
|
||||
</h2>
|
||||
<h2 v-on:click.ctrl="doQuote" v-if="$store.state.wind" class="subtitle">
|
||||
WIND Quote: {{ quote }}<br>
|
||||
There are currently <b>2900</b> quotes available
|
||||
{{$t('404.windQuote')}}: {{ quote }}<br>
|
||||
{{$t('404.quoteText')}}
|
||||
</h2>
|
||||
<b-button tag="router-link" to="/">Go Home</b-button>
|
||||
<b-button tag="router-link" to="/">{{$t('404.home')}}</b-button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
|
@ -2,15 +2,15 @@
|
|||
<main>
|
||||
<div class="column">
|
||||
<div class="box">
|
||||
Debug mode turned on: {{$store.state.debug}}
|
||||
{{$t('debug.title')}}: {{$store.state.debug}}
|
||||
<br>
|
||||
<div v-if="$store.state.debug"> Logged in as: {{$store.state.user.username}}<br>
|
||||
User info: {{$store.state.user}}<br>
|
||||
State dump: {{$store.state}}<br>
|
||||
Authentication Token: {{$store.state.user.token}}
|
||||
<div v-if="$store.state.debug"> {{$t('debug.authUser')}}: {{$store.state.user.username}}<br>
|
||||
{{$t('debug.userState')}}: {{$store.state.user}}<br>
|
||||
{{$t('debug.state')}}: {{$store.state}}<br>
|
||||
{{$t('debug.token')}}: {{$store.state.user.token}}
|
||||
</div>
|
||||
<b-button v-if="$store.state.debug" @click="authTest">Test authentication</b-button>
|
||||
<b-button v-if="$store.state.debug" @click="turnOffDebug">Turn off</b-button>
|
||||
<b-button v-if="$store.state.debug" @click="authTest">{{$t('debug.auth')}}</b-button>
|
||||
<b-button v-if="$store.state.debug" @click="turnOffDebug">{{$t('debug.disable')}}</b-button>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
@ -22,14 +22,14 @@ export default {
|
|||
methods: {
|
||||
turnOffDebug () {
|
||||
this.$store.commit('turnOffDebug')
|
||||
this.$buefy.snackbar.open(`Debug mode disabled, you will no longer have access to development features until you refresh.`)
|
||||
this.$buefy.snackbar.open({message:this.$t('errors.disableDebug'), type: 'is-warning'})
|
||||
},
|
||||
authTest () {
|
||||
this.axios.get('/api/v1/userinfo/auth'
|
||||
).then(() => {
|
||||
this.$buefy.snackbar.open(`You are authenticated correctly`)
|
||||
this.$buefy.snackbar.open({message:this.$t('errors.authSuccess'), type: 'is-warning'})
|
||||
}).catch(() => {
|
||||
this.$buefy.snackbar.open(`Request failed, you are not authenticated.`)
|
||||
this.$buefy.snackbar.open({message:this.$t('errors.authFail'), type: 'is-warning'})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +1,24 @@
|
|||
const Dotenv = require('dotenv-webpack');
|
||||
module.exports = {
|
||||
devServer: {
|
||||
proxy: 'http://localhost:23981'
|
||||
},
|
||||
publicPath: '/',
|
||||
devServer: {
|
||||
proxy: 'http://localhost:23981'
|
||||
},
|
||||
|
||||
publicPath: '/',
|
||||
productionSourceMap: false,
|
||||
|
||||
configureWebpack: {
|
||||
plugins: [
|
||||
new Dotenv()
|
||||
]
|
||||
},
|
||||
|
||||
pluginOptions: {
|
||||
i18n: {
|
||||
locale: 'en',
|
||||
fallbackLocale: 'debug',
|
||||
localeDir: 'locales',
|
||||
enableInSFC: false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
75
yarn.lock
75
yarn.lock
|
@ -1043,6 +1043,14 @@
|
|||
cssnano-preset-default "^4.0.0"
|
||||
postcss "^7.0.0"
|
||||
|
||||
"@intlify/vue-i18n-loader@^1.0.0":
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@intlify/vue-i18n-loader/-/vue-i18n-loader-1.0.0.tgz#4350a9b03fd62e7d7f44c7496d5509bff3229c79"
|
||||
integrity sha512-y7LlpKEQ01u7Yq14l4VNlbFYEHMmSEH1QXXASOMWspj9ZcIdCebhhvHCHqk5Oy5Epw3PtoxyRJNpb6Wle5udgA==
|
||||
dependencies:
|
||||
js-yaml "^3.13.1"
|
||||
json5 "^2.1.1"
|
||||
|
||||
"@mrmlnc/readdir-enhanced@^2.2.1":
|
||||
version "2.2.1"
|
||||
resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde"
|
||||
|
@ -3944,6 +3952,16 @@ cli-spinners@^2.0.0:
|
|||
resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.5.0.tgz#12763e47251bf951cb75c201dfa58ff1bcb2d047"
|
||||
integrity sha512-PC+AmIuK04E6aeSs/pUccSujsTzBhu4HzC2dL+CfJB/Jcc2qTRbEwZQDfIUpt2Xl8BodYBEq8w4fc0kU2I9DjQ==
|
||||
|
||||
cli-table3@^0.5.1:
|
||||
version "0.5.1"
|
||||
resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.5.1.tgz#0252372d94dfc40dbd8df06005f48f31f656f202"
|
||||
integrity sha512-7Qg2Jrep1S/+Q3EceiZtQcDPWxhAvBw+ERf1162v4sikJrvojMHFqXt8QIVha8UlH9rgU0BeWPytZ9/TzYqlUw==
|
||||
dependencies:
|
||||
object-assign "^4.1.0"
|
||||
string-width "^2.1.1"
|
||||
optionalDependencies:
|
||||
colors "^1.1.2"
|
||||
|
||||
cli-truncate@^0.2.1:
|
||||
version "0.2.1"
|
||||
resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-0.2.1.tgz#9f15cfbb0705005369216c626ac7d05ab90dd574"
|
||||
|
@ -4851,7 +4869,7 @@ deepmerge@^1.5.2:
|
|||
resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-1.5.2.tgz#10499d868844cdad4fee0842df8c7f6f0c95a753"
|
||||
integrity sha512-95k0GDqvBjZavkuvzx/YqVLv/6YYa17fz6ILMSf7neqQITCPbnfEnQvEgMPNjH4kgobe7+WIL0yJEHku+H3qtQ==
|
||||
|
||||
deepmerge@^4.1.1, deepmerge@^4.2.2:
|
||||
deepmerge@^4.1.1, deepmerge@^4.2.0, deepmerge@^4.2.2:
|
||||
version "4.2.2"
|
||||
resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955"
|
||||
integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==
|
||||
|
@ -5078,6 +5096,14 @@ dot-case@^3.0.4:
|
|||
no-case "^3.0.4"
|
||||
tslib "^2.0.3"
|
||||
|
||||
dot-object@^1.7.1:
|
||||
version "1.9.0"
|
||||
resolved "https://registry.yarnpkg.com/dot-object/-/dot-object-1.9.0.tgz#6e3d6d8379f794c5174599ddf05528f5990f076e"
|
||||
integrity sha512-7MPN6y7XhAO4vM4eguj5+5HNKLjJYfkVG1ZR1Aput4Q4TR6SYeSjhpVQ77IzJHoSHffKbDxBC+48aCiiRurDPw==
|
||||
dependencies:
|
||||
commander "^2.20.0"
|
||||
glob "^7.1.4"
|
||||
|
||||
dot-prop@^4.2.1:
|
||||
version "4.2.1"
|
||||
resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-4.2.1.tgz#45884194a71fc2cda71cbb4bceb3a4dd2f433ba4"
|
||||
|
@ -5502,7 +5528,7 @@ eslint@^6.7.2:
|
|||
text-table "^0.2.0"
|
||||
v8-compile-cache "^2.0.3"
|
||||
|
||||
esm@^3.2.25:
|
||||
esm@^3.2.13, esm@^3.2.25:
|
||||
version "3.2.25"
|
||||
resolved "https://registry.yarnpkg.com/esm/-/esm-3.2.25.tgz#342c18c29d56157688ba5ce31f8431fbb795cc10"
|
||||
integrity sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==
|
||||
|
@ -6066,6 +6092,11 @@ flat-cache@^2.0.1:
|
|||
rimraf "2.6.3"
|
||||
write "1.0.3"
|
||||
|
||||
flat@^5.0.0:
|
||||
version "5.0.2"
|
||||
resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241"
|
||||
integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==
|
||||
|
||||
flatted@^2.0.0:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138"
|
||||
|
@ -7675,6 +7706,11 @@ is-utf8@^0.2.0:
|
|||
resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72"
|
||||
integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=
|
||||
|
||||
is-valid-glob@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-valid-glob/-/is-valid-glob-1.0.0.tgz#29bf3eff701be2d4d315dbacc39bc39fe8f601aa"
|
||||
integrity sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao=
|
||||
|
||||
is-windows@^1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d"
|
||||
|
@ -7887,7 +7923,7 @@ json5@^1.0.1:
|
|||
dependencies:
|
||||
minimist "^1.2.0"
|
||||
|
||||
json5@^2.1.2:
|
||||
json5@^2.1.1, json5@^2.1.2:
|
||||
version "2.1.3"
|
||||
resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.3.tgz#c9b0f7fa9233bfe5807fe66fcf3a5617ed597d43"
|
||||
integrity sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==
|
||||
|
@ -12534,6 +12570,20 @@ vue-cli-plugin-apollo@^0.21.3:
|
|||
subscriptions-transport-ws "^0.9.16"
|
||||
ts-node "^8.4.1"
|
||||
|
||||
vue-cli-plugin-i18n@~1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/vue-cli-plugin-i18n/-/vue-cli-plugin-i18n-1.0.1.tgz#5a3077de5d62c9b4068e486db1fc97fce9fa0072"
|
||||
integrity sha512-sLo6YzudaWgn5dOMvrKixE5bb/onYGxcxm+0YexqoOx0QtR+7hZ/P5WPFBMM9v/2i1ec2YYe2PvKTBel7KE+tA==
|
||||
dependencies:
|
||||
debug "^4.1.0"
|
||||
deepmerge "^4.2.0"
|
||||
dotenv "^8.2.0"
|
||||
flat "^5.0.0"
|
||||
rimraf "^3.0.0"
|
||||
vue "^2.6.11"
|
||||
vue-i18n "^8.17.0"
|
||||
vue-i18n-extract "1.0.2"
|
||||
|
||||
vue-codemod@^0.0.4:
|
||||
version "0.0.4"
|
||||
resolved "https://registry.yarnpkg.com/vue-codemod/-/vue-codemod-0.0.4.tgz#ebb23675e8f35dabaad028e1fe2dd4b5eb776c75"
|
||||
|
@ -12567,6 +12617,23 @@ vue-hot-reload-api@^2.3.0:
|
|||
resolved "https://registry.yarnpkg.com/vue-hot-reload-api/-/vue-hot-reload-api-2.3.4.tgz#532955cc1eb208a3d990b3a9f9a70574657e08f2"
|
||||
integrity sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==
|
||||
|
||||
vue-i18n-extract@1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/vue-i18n-extract/-/vue-i18n-extract-1.0.2.tgz#0a136e12d1634d6799e187aad81a7003d02f67a5"
|
||||
integrity sha512-+zwDKvle4KcfloXZnj5hF01ViKDiFr5RMx5507D7oyDXpSleRpekF5YHgZa/+Ra6Go68//z0Nya58J9tKFsCjw==
|
||||
dependencies:
|
||||
cli-table3 "^0.5.1"
|
||||
dot-object "^1.7.1"
|
||||
esm "^3.2.13"
|
||||
glob "^7.1.3"
|
||||
is-valid-glob "^1.0.0"
|
||||
yargs "^13.2.2"
|
||||
|
||||
vue-i18n@^8.17.0, vue-i18n@^8.17.3:
|
||||
version "8.22.3"
|
||||
resolved "https://registry.yarnpkg.com/vue-i18n/-/vue-i18n-8.22.3.tgz#4ac0fdc3e71d4fe188938c40a9ffca32cde60732"
|
||||
integrity sha512-Vhyx7sZEmmW/aZLkzSlXei08Rv3hTondx4J9wbOjnThocTIK1QiXV6QRdT4BTnhT24JixDSf6kGkxqCXSaJ3Jw==
|
||||
|
||||
vue-keypress@^2.1.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/vue-keypress/-/vue-keypress-2.1.1.tgz#b766ab52c052b28e9ea1a732a5fde0432c45c76c"
|
||||
|
@ -13053,7 +13120,7 @@ yargs-parser@^20.2.2:
|
|||
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54"
|
||||
integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==
|
||||
|
||||
yargs@^13.3.2:
|
||||
yargs@^13.2.2, yargs@^13.3.2:
|
||||
version "13.3.2"
|
||||
resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd"
|
||||
integrity sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==
|
||||
|
|
Loading…
Reference in a new issue