@@ -54,6 +52,8 @@ export default {
this.$store.commit('setKoins', res.data.koins)
this.$store.commit('setID', res.data.id)
this.$store.commit('setBot', res.data.bot)
+ this.$store.commit('setDescription', res.data.description)
+ this.$store.commit('setExecutive', res.data.executive)
}).catch(() => {
this.$buefy.snackbar.open({message:this.$t('errors.down'), type: 'is-warning'})
})
diff --git a/src/components/Navbar.vue b/src/components/Navbar.vue
index d68a535..30bf446 100644
--- a/src/components/Navbar.vue
+++ b/src/components/Navbar.vue
@@ -96,7 +96,7 @@
{{$t('settings.general.saveDesc')}}
@@ -107,7 +107,7 @@
{{$t('settings.general.savePref')}}
@@ -447,6 +447,46 @@ export default {
},
},
methods: {
+ savePref() {
+ this.preferences.error = ''
+ this.preferences.loading = true
+
+ this.axios
+ .put(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'users/preferences', {
+ developerMode: this.preferences.developerMode
+ })
+ .then(() => {
+ this.preferences.loading = false
+ this.axios.get(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'userinfo')
+ .then(res => {
+ this.$store.commit('setUsername', res.data.username)
+ this.$store.commit('setEmail', res.data.email)
+ this.$store.commit('setEmailVerified', res.data.emailVerified)
+ this.$store.commit('setAdmin', res.data.admin)
+ this.$store.commit('setDevMode', res.data.developerMode)
+ })
+ })
+ .catch(e => {
+ this.preferences.loading = false
+ AjaxErrorHandler(this.$store)(e)
+ })
+ },
+ saveDesc() {
+ this.description.error = ''
+ this.description.loading = true
+
+ this.axios
+ .put(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'users/preferences', {
+ description: this.description.value
+ })
+ .then(() => {
+ this.description.loading = false
+ })
+ .catch(e => {
+ this.description.loading = false
+ AjaxErrorHandler(this.$store)(e)
+ })
+ },
getBannerId() {
if(localStorage.getItem(this.$store.state.client.bannerId)) {
this.showBanner = false
@@ -469,13 +509,10 @@ export default {
agree: this.register.agree
}).then((res) => {
this.register.loading = false
- this.$store.commit('setUsername', res.data.username)
- this.$store.commit('setAvatar', res.data.avatar)
- this.$store.commit('setID', res.data.id)
- this.$store.commit('setEmailVerified', res.data.emailVerified)
- this.$store.commit('setEmail', res.data.email)
- this.$store.commit('setAdmin', res.data.admin)
+ this.registerModal = false
this.$store.commit('setToken', res.data.token)
+ localStorage.setItem('token', JSON.stringify(res.data.token));
+ this.getInfo()
this.$buefy.snackbar.open({message:this.$t('errors.registered'), type: 'is-info'})
}).catch(e => {
this.register.loading = false
@@ -566,13 +603,43 @@ export default {
this.$store.commit('fakeUser')
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}})
+ },
+ getInfo() {
+ 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')
+ .then(res => {
+ this.$store.commit('setSettings', res.data)
+ this.$store.commit('setVersion', res.data.latestCanaryVersion)
+ this.$store.commit('setAPIVersion', res.data.latestAPIVersion)
+ }).catch(() => {
+ this.$buefy.snackbar.open({message:this.$t('errors.down'), type: 'is-info'})
+ })
+ this.axios.get(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'userinfo')
+ .then(res => {
+ this.$store.commit('setUsername', res.data.username)
+ this.$store.commit('setEmail', res.data.email)
+ this.$store.commit('setEmailVerified', res.data.emailVerified)
+ this.$store.commit('setAdmin', res.data.admin)
+ this.$store.commit('setKoins', res.data.koins)
+ this.$store.commit('setID', res.data.id)
+ this.$store.commit('setBot', res.data.bot)
+ this.$store.commit('setDescription', res.data.description)
+ this.$store.commit('setExecutive', res.data.executive)
+ this.settings.general.description.value = res.data.description
+ this.loading = false
+ }).catch(() => {
+ this.$buefy.snackbar.open({message:this.$t('errors.authFail'), type: 'is-warning'})
+ this.loading = false
+ })
}
},
mounted() {
+ 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')
.then(res => {
this.$store.commit('setSettings', res.data)
this.$store.commit('setVersion', res.data.latestCanaryVersion)
+ this.$store.commit('setAPIVersion', res.data.latestAPIVersion)
}).catch(() => {
this.$buefy.snackbar.open({message:this.$t('errors.down'), type: 'is-info'})
})
@@ -585,12 +652,9 @@ export default {
this.$store.commit('setKoins', res.data.koins)
this.$store.commit('setID', res.data.id)
this.$store.commit('setBot', res.data.bot)
- if(localStorage.getItem('usernameCache')) {
- localStorage.removeItem('usernameCache')
- localStorage.setItem('usernameCache', JSON.stringify(res.data.username));
- } else {
- localStorage.setItem('usernameCache', JSON.stringify(res.data.username));
- }
+ this.$store.commit('setDescription', res.data.description)
+ this.$store.commit('setExecutive', res.data.executive)
+ this.settings.general.description.value = res.data.description
this.loading = false
}).catch(() => {
this.$buefy.snackbar.open({message:this.$t('errors.authFail'), type: 'is-warning'})
diff --git a/src/components/NoItems.vue b/src/components/NoItems.vue
index 6cd6861..7ca570b 100644
--- a/src/components/NoItems.vue
+++ b/src/components/NoItems.vue
@@ -2,7 +2,7 @@
-
{{$t('generic.noItemsStart')}} {{type}} {{$t('generic.noItemsEnd')}}
+ {{$t('generic.noItemsStart')}} {{type}} {{$t('generic.noItemsEnd')}}
diff --git a/src/router/index.js b/src/router/index.js
index 57b8764..0582ba5 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -63,6 +63,12 @@ const routes = [
},
{
path: '/forums',
+ redirect: '/forums/ALL',
+ name: 'Forums',
+ component: route('Forums')
+ },
+ {
+ path: '/forums/:category',
name: 'Forums',
component: route('Forums')
},
diff --git a/src/store/index.js b/src/store/index.js
index ef066ea..00a8af1 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -31,6 +31,14 @@ export default new Vuex.Store({
errors: null,
modal: false
},
+ banned: {
+ banned: false,
+ message: "Not banned",
+ readOnlyMode: false,
+ ipBanned: false,
+ disableLogin: false,
+ expiry: "2020-01-01T00:00:00.000Z"
+ },
user: {
id: 0,
username: '',
@@ -44,7 +52,8 @@ export default new Vuex.Store({
emailVerified: false,
modeler: false,
developerMode: false,
- executive: false
+ executive: false,
+ description: ''
}
},
mutations: {
@@ -59,6 +68,9 @@ export default new Vuex.Store({
setVersion(state, value) {
state.client.latestClientVersion = value
},
+ setAPIVersion(state, value) {
+ state.client.latestAPIVersion = value
+ },
turnOffDebug(state) {
state.debug = false
},
@@ -86,6 +98,14 @@ export default new Vuex.Store({
setToken (state, value) {
state.user.token = value
},
+ setBanned (state, value) {
+ state.banned.message = value
+ state.banned.banned = value
+ state.banned.readOnlyMode = value
+ state.banned.disableLogin = value
+ state.banned.ipBanned = value
+ state.banned.expiry = value
+ },
setAvatar (state, value) {
state.user.avatar = value
},
@@ -109,6 +129,12 @@ export default new Vuex.Store({
},
setAdmin (state, value) {
state.user.admin = value
+ },
+ setExecutive (state, value) {
+ state.user.executive = value
+ },
+ setDescription (state, value) {
+ state.user.description = value
}
},
actions: {
diff --git a/src/views/AdminCreateItem.vue b/src/views/AdminCreateItem.vue
index d806867..e3632e8 100644
--- a/src/views/AdminCreateItem.vue
+++ b/src/views/AdminCreateItem.vue
@@ -1,6 +1,6 @@
-
-
+
+
Uploading a hat
@@ -52,10 +52,18 @@
-
Submit
-
Submit
-
Submit
-
Submit
+
+ Submit
+ Submit
+ Submit
+ Submit
+ Preview
+
+
+
+
Preview Image
+
+
Press preview to preview the hat as if it were uploaded on the Marketplace.
@@ -70,6 +78,8 @@ export default {
createType: 0,
stage: 1,
loading: false,
+ loadingPreview: false,
+ preview: '',
item: {
file: '',
fileObj: '',
@@ -86,6 +96,21 @@ export default {
}
},
methods: {
+ previewItem() {
+ this.loadingPreview = true
+ const data = new FormData();
+
+ data.append('image', this.item.file);
+ data.append('fileObj', this.item.fileObj);
+ this.axios.post(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'marketplace/preview/' + this.createType, data)
+ .then((res) => {
+ this.loadingPreview = false
+ this.preview = res.data.image
+ }).catch((e) => {
+ this.loadingPreview = false
+ AjaxErrorHandler(this.$store)(e)
+ })
+ },
submitItem() {
this.loading = true
const data = new FormData();
@@ -100,8 +125,9 @@ export default {
data.append('limited', this.item.limited);
data.append('quantityAllowed', this.item.quantity);
this.axios.post(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'marketplace/upload/' + this.createType, data)
- .then(() => {
+ .then((res) => {
this.loading = false
+ this.axios.put(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'marketplace/rerender/' + res.data.id)
}).catch((e) => {
this.loading = false
AjaxErrorHandler(this.$store)(e)
diff --git a/src/views/Forums.vue b/src/views/Forums.vue
index a333130..5a77f82 100644
--- a/src/views/Forums.vue
+++ b/src/views/Forums.vue
@@ -1,5 +1,153 @@
-
-
+
+
+
+
Create thread
+
+
+
+ All
+
+
+ {{category.name}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ By
+ {{thread.User.username}}
+
+
+
+
+ {{thread.name}}
+
+ {{thread.Posts[0].plainText}}
+
+
+
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
+
\ No newline at end of file
diff --git a/src/views/UserAwards.vue b/src/views/UserAwards.vue
index 33547a2..f0b02c2 100644
--- a/src/views/UserAwards.vue
+++ b/src/views/UserAwards.vue
@@ -1,8 +1,11 @@
+
+
+
-
+
{{award.Award.rarity}}
{{award.Award.rarity}}
{{award.Award.rarity}}
@@ -17,10 +20,13 @@