This commit is contained in:
Troplo 2021-01-21 02:39:07 +11:00
parent e1369dfab5
commit 4d414d28dd
7 changed files with 62 additions and 21 deletions

4
.env
View file

@ -1,7 +1,7 @@
VUE_APP_APIENDPOINT=/api/ VUE_APP_APIENDPOINT=/api/
VUE_APP_APIVERSION=v1 VUE_APP_APIVERSION=v1
VUE_APP_GATEWAYENDPOINT=https://gateway.kaverti.com VUE_APP_GATEWAYENDPOINT=/socket.io/
VUE_APP_STAGING=false VUE_APP_STAGING=true
VUE_APP_I18N_LOCALE=en VUE_APP_I18N_LOCALE=en
VUE_APP_I18N_FALLBACK_LOCALE=en VUE_APP_I18N_FALLBACK_LOCALE=en
VUE_APP_RELEASE="Canary" VUE_APP_RELEASE="Canary"

View file

@ -218,6 +218,19 @@
</div> </div>
</div> </div>
</section> </section>
<section v-if='$store.state.client.clientVersion !== $store.state.client.latestClientVersion && showOutdatedBanner' class="hero is-warning">
<div class="hero-body" style="padding: 1rem 1rem !important;">
<div class="mobile-container">
<div class="container">
<p style="text-align: center;">You are using an outdated version of Kaverti, please refresh.<button
type="button"
class="delete"
style="float: right;"
@click="showOutdatedBanner = false"/></p>
</div>
</div>
</div>
</section>
<b-navbar> <b-navbar>
<template #brand> <template #brand>
<b-navbar-item tag="router-link" :to="{ path: '/' }"> <b-navbar-item tag="router-link" :to="{ path: '/' }">
@ -253,6 +266,7 @@
<div class="navbar-dropdown"> <div class="navbar-dropdown">
<b-navbar-item tag="router-link" to="/debug">{{$t('navbar.dev.debug')}}</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> <b-navbar-item @click="fakeUser()">{{$t('navbar.dev.fakeUser')}}</b-navbar-item>
<b-navbar-item @click="toggleBrokenRoute(true)">{{$t('navbar.dev.brokenRoute')}}</b-navbar-item>
</div> </div>
</div> </div>
<div v-if="$store.state.debug" class="navbar-item has-dropdown is-hoverable is-info"> <div v-if="$store.state.debug" class="navbar-item has-dropdown is-hoverable is-info">
@ -271,7 +285,7 @@
</template> </template>
<template #end> <template #end>
<b-navbar-item v-if="$store.state.user.username && !loading"> <b-navbar-item v-if="$store.state.user.username && !loading" @click="dailyReward">
<img src="https://cdn.kaverti.com/icons/koins.svg">{{$store.state.user.koins}} <img src="https://cdn.kaverti.com/icons/koins.svg">{{$store.state.user.koins}}
</b-navbar-item> </b-navbar-item>
<div v-if="!loading"> <div v-if="!loading">
@ -297,6 +311,7 @@
<b-navbar-item tag="router-link" to="/character">{{$t('navbar.user.avatar')}}</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="/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 tag="router-link" to="/downloads">{{$t('navbar.user.downloads')}}</b-navbar-item>
<b-navbar-item tag="router-link" to="/admin" v-if="$store.state.user.admin">{{$t('navbar.user.admin')}}</b-navbar-item>
<b-navbar-item tag="router-link" to="/friends"><b-tag class="is-info" rounded> 1</b-tag>&nbsp; {{$t('navbar.user.friends')}}</b-navbar-item> <b-navbar-item tag="router-link" to="/friends"><b-tag class="is-info" rounded> 1</b-tag>&nbsp; {{$t('navbar.user.friends')}}</b-navbar-item>
<b-navbar-item @click="logout()">{{$t('navbar.user.logout')}}</b-navbar-item> <b-navbar-item @click="logout()">{{$t('navbar.user.logout')}}</b-navbar-item>
</div> </div>
@ -337,6 +352,7 @@ export default {
loading: true, loading: true,
settingsModal: false, settingsModal: false,
showBanner: true, showBanner: true,
showOutdatedBanner: true,
friendCount: 0, friendCount: 0,
settings: { settings: {
tab: 0, tab: 0,
@ -447,6 +463,9 @@ export default {
}, },
}, },
methods: { methods: {
toggleBrokenRoute (val) {
this.$store.commit('brokenRoute', val)
},
savePref() { savePref() {
this.preferences.error = '' this.preferences.error = ''
this.preferences.loading = true this.preferences.loading = true
@ -604,13 +623,22 @@ export default {
this.$buefy.snackbar.open(`WARNING: You have fake authenticated, you do not have authenticated API access. Use for debug purposes only.`) this.$buefy.snackbar.open(`WARNING: You have fake authenticated, you do not have authenticated API access. Use for debug purposes only.`)
Object.assign(axios.defaults, {headers: {Authorization: this.$store.state.user.token}}) Object.assign(axios.defaults, {headers: {Authorization: this.$store.state.user.token}})
}, },
dailyReward() {
this.axios.get(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'users/reward'
).then(res => {
this.$store.commit('setKoins', res.data.koins)
}).catch(e => {
AjaxErrorHandler(this.$store)(e)
})
},
getInfo() { getInfo() {
Object.assign(axios.defaults, {headers: {Authorization: this.$store.state.user.token}}) Object.assign(axios.defaults, {headers: {Authorization: this.$store.state.user.token}})
this.axios.get(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'kaverti/state') this.axios.get(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'kaverti/state')
.then(res => { .then(res => {
this.$store.commit('setSettings', res.data) this.$store.commit('setSettings', res.data.state)
this.$store.commit('setVersion', res.data.latestCanaryVersion) this.$store.commit('setVersion', res.data.state.latestCanaryVersion)
this.$store.commit('setAPIVersion', res.data.latestAPIVersion) this.$store.commit('setAPIVersion', res.data.apiVersion)
}).catch(() => { }).catch(() => {
this.$buefy.snackbar.open({message:this.$t('errors.down'), type: 'is-info'}) this.$buefy.snackbar.open({message:this.$t('errors.down'), type: 'is-info'})
}) })
@ -637,9 +665,9 @@ export default {
Object.assign(axios.defaults, {headers: {Authorization: this.$store.state.user.token}}) Object.assign(axios.defaults, {headers: {Authorization: this.$store.state.user.token}})
this.axios.get(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'kaverti/state') this.axios.get(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'kaverti/state')
.then(res => { .then(res => {
this.$store.commit('setSettings', res.data) this.$store.commit('setSettings', res.data.state)
this.$store.commit('setVersion', res.data.latestCanaryVersion) this.$store.commit('setVersion', res.data.state.latestCanaryVersion)
this.$store.commit('setAPIVersion', res.data.latestAPIVersion) this.$store.commit('setAPIVersion', res.data.apiVersion)
}).catch(() => { }).catch(() => {
this.$buefy.snackbar.open({message:this.$t('errors.down'), type: 'is-info'}) this.$buefy.snackbar.open({message:this.$t('errors.down'), type: 'is-info'})
}) })
@ -662,6 +690,7 @@ export default {
console.log(this.getBannerId()) console.log(this.getBannerId())
}) })
if(this.$store.state.username) { if(this.$store.state.username) {
this.dailyReward()
this.axios.get(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'relationships/getAllPendingCanAccept') this.axios.get(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'relationships/getAllPendingCanAccept')
.then(res => { .then(res => {
this.friendCount = res.data.count this.friendCount = res.data.count

View file

@ -124,6 +124,7 @@
"transactions": "Transactions", "transactions": "Transactions",
"settings": "Settings", "settings": "Settings",
"logout": "Logout", "logout": "Logout",
"admin": "Admin",
"friends": "Friends" "friends": "Friends"
}, },
"more": { "more": {
@ -256,6 +257,15 @@
"wind": "Windspeak", "wind": "Windspeak",
"debug": "Debug" "debug": "Debug"
}, },
"admin": {
"title": "Kaverti Admin",
"dashboard": "Dashboard (SOON)",
"uploadItem": "Create Hat",
"executive": {
"title": "Executive Staff",
"soon": "(SOON)"
}
},
"currency": "Koins", "currency": "Koins",
"close": "Close", "close": "Close",
"tos": "Terms of Service", "tos": "Terms of Service",

View file

@ -14,6 +14,7 @@ export default new Vuex.Store({
state: { state: {
debug: tb(process.env.VUE_APP_STAGING), debug: tb(process.env.VUE_APP_STAGING),
wind: false, wind: false,
enableBrokenRoutes: false,
client: { client: {
clientVersion: '1.0.0-prerelease', clientVersion: '1.0.0-prerelease',
latestClientVersion: '', latestClientVersion: '',
@ -135,6 +136,9 @@ export default new Vuex.Store({
}, },
setDescription (state, value) { setDescription (state, value) {
state.user.description = value state.user.description = value
},
brokenRoute(state, value) {
state.enableBrokenRoutes = value
} }
}, },
actions: { actions: {

View file

@ -62,8 +62,9 @@
</div> </div>
<div class="column is-5"> <div class="column is-5">
<h1 class="title">Preview Image</h1> <h1 class="title">Preview Image</h1>
<img :src="'https://cdn.kaverti.com/marketplace/previews/' + preview" v-if="preview"> <img :src="'https://cdn.kaverti.com/marketplace/previews/' + preview + '.png'" v-if="preview">
<h1 class="subtitle" v-if="!preview">Press preview to preview the hat as if it were uploaded on the Marketplace.</h1> <h1 class="subtitle" v-if="!preview">Press preview to preview the hat as if it were uploaded on the Marketplace.</h1>
<h1 class="subtitle">Please validate to make sure all information is correct, your item will automatically be approved.</h1>
</div> </div>
</main> </main>
</template> </template>

View file

@ -1,5 +1,5 @@
<template> <template>
<main class="section"> <main class="section" v-if="$store.state.enableBrokenRoutes">
<div class="columns is-multiline has-text-centered"> <div class="columns is-multiline has-text-centered">
<div class="column is-2" v-if="!loadingCategory && categories.length"> <div class="column is-2" v-if="!loadingCategory && categories.length">
<b-button class="is-info">Create thread</b-button> <b-button class="is-info">Create thread</b-button>
@ -53,19 +53,15 @@
{{thread.Posts[0].plainText}} {{thread.Posts[0].plainText}}
</p> </p>
</div> </div>
<nav class="level is-mobile"> <div class="media-left">
<div class="level-left"> Created At: {{thread.createdAt}}
<p>Created at:</p>
</div> </div>
</nav>
</div>
<div class="media-right">
<button class="delete"></button>
</div> </div>
</article> </article>
</div> </div>
</div> </div>
</div> </div>
<div class="section" v-if="!$store.state.enableBrokenRoutes">This route has been disabled, enable Broken Routes in Developer Options</div>
</main> </main>
</template> </template>
<script> <script>

View file

@ -1,5 +1,5 @@
<template> <template>
<main> <main class="section">
<div class="columns is-multiline" v-if="!loading"> <div class="columns is-multiline" v-if="!loading">
<div v-if="!users.length" class="column"> <div v-if="!users.length" class="column">
<br> <br>
@ -9,7 +9,8 @@
<div class="column is-3" v-for='(user) in users' :key='"user-" + user.id'> <div class="column is-3" v-for='(user) in users' :key='"user-" + user.id'>
<div class="box"> <div class="box">
<h1 class="title">{{user.username}}&nbsp;<Badges :username="user.username" :system="user.system" :hidden="user.hidden" :admin="user.admin" :booster="user.booster" :bot="user.bot"></Badges></h1> <h1 class="title">{{user.username}}&nbsp;<Badges :username="user.username" :system="user.system" :hidden="user.hidden" :admin="user.admin" :booster="user.booster" :bot="user.bot"></Badges></h1>
<img :src="'https://cdn.kaverti.com/user/avatars/full/' + user.picture + '.png'"> <img :src="'https://cdn.kaverti.com/user/avatars/full/' + user.picture + '.png'"><br>
<b-button tag="router-link" :to='"/u/" + user.username' class="is-centered is-info">View Profile</b-button>
</div> </div>
</div> </div>
</div> </div>