Improvements

This commit is contained in:
Troplo 2021-04-10 18:10:14 +10:00
parent 122183496e
commit 2b93390b32
35 changed files with 304 additions and 171 deletions

8
.env
View file

@ -1,7 +1,9 @@
VUE_APP_APIENDPOINT=/api/ VUE_APP_API_ENDPOINT=/api/
VUE_APP_APIVERSION=v2 VUE_APP_API_VERSION=v2
VUE_APP_GATEWAYENDPOINT=/socket.io/ VUE_APP_GATEWAY_ENDPOINT=/socket.io/
VUE_APP_STAGING=true 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"
VUE_APP_VERSION=[AIV]{version}[/AIV]
VUE_APP_BUILD_DATE=[AIV]{date}[/AIV]

View file

@ -1,5 +1,5 @@
VUE_APP_APIENDPOINT="/api/" VUE_APP_API_ENDPOINT="/api/"
VUE_APP_APIVERSION="v2" VUE_APP_API_VERSION="v2"
VUE_APP_GATEWAYENDPOINT="/socket.io/" VUE_APP_GATEWAY_ENDPOINT="/socket.io/"
VUE_APP_STAGING=true VUE_APP_STAGING=true
VUE_APP_RELEASE="Canary" VUE_APP_RELEASE="Canary"

3
.gitignore vendored
View file

@ -28,3 +28,6 @@ pnpm-debug.log*
# Yarn and NPM # Yarn and NPM
.yarn .yarn
# Vue
vue.config.js

View file

@ -1,6 +1,6 @@
{ {
"name": "kaverti-frontend", "name": "kaverti-frontend",
"version": "", "version": "1.0.0",
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",

View file

@ -38,8 +38,8 @@ export default {
} }
this.axios this.axios
.get( .get(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
"/" + "/" +
"userinfo" "userinfo"
) )
@ -56,8 +56,8 @@ export default {
}) })
if (this.$store.state.user.username) { if (this.$store.state.user.username) {
this.axios.get( this.axios.get(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
"/" + "/" +
"awards/eligibility" "awards/eligibility"
) )

View file

@ -49,7 +49,7 @@ export default {
replaceLink(cached, link); replaceLink(cached, link);
} else { } else {
Vue.axios Vue.axios
.get(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'forums/link_preview?url=' + link.href) .get(process.env.VUE_APP_API_ENDPOINT + process.env.VUE_APP_API_VERSION + '/' + 'forums/link_preview?url=' + link.href)
.then(res => { .then(res => {
cache[link.href] = res.data; cache[link.href] = res.data;
replaceLink(res.data, link); replaceLink(res.data, link);

View file

@ -72,7 +72,7 @@ export default {
}, },
modifyUser() { modifyUser() {
this.axios this.axios
.put(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'admin/user/modify', { .put(process.env.VUE_APP_API_ENDPOINT + process.env.VUE_APP_API_VERSION + '/' + 'admin/user/modify', {
username: this.username, username: this.username,
bot: this.bot, bot: this.bot,
system: this.system, system: this.system,

View file

@ -0,0 +1,83 @@
<template>
<div class="banners">
<section
v-if="!$store.state.user.emailVerified && $store.state.user.username"
class="hero is-danger"
>
<div class="hero-body" style="padding: 1rem 1rem !important">
<div class="mobile-container">
<div class="container">
<p style="text-align: center">{{ $t("errors.emailVerify") }}</p>
</div>
</div>
</div>
</section>
<section
v-if="!$store.state.client.secure && !$store.state.client.development"
class="hero is-danger"
>
<div class="hero-body" style="padding: 1rem 1rem !important">
<div class="mobile-container">
<div class="container">
<p style="text-align: center">Kaverti is being accessed insecurely, Authentication will be disabled.</p>
</div>
</div>
</div>
</section>
<section
v-if="
$store.state.client.clientVersion !==
$store.state.client.latestClientVersion && showOutdatedBanner && $store.state.client.latestClientVersion
"
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>
</div>
</template>
<script>
export default {
name: "Banners",
data() {
return {
showOutdatedBanner: true,
showBanner: true
}
},
methods: {
toggleBrokenRoute(val) {
this.$store.commit("brokenRoute", val);
},
getBannerId() {
this.showBanner = !localStorage.getItem(this.$store.state.client.bannerId);
},
updateDismissed() {
localStorage.setItem(
"update-" + this.$store.state.client.clientVersion,
true
);
this.updateModal = false;
},
removeBannerId() {
localStorage.setItem(this.$store.state.client.bannerId, true);
this.$store.state.client.bannerEnabled = false;
console.log(localStorage.getItem(this.$store.state.client.bannerId));
},
}
}
</script>

View file

@ -102,6 +102,9 @@
</div> </div>
</b-modal> </b-modal>
<h1>&copy; 2021 Kaverti</h1> <h1>&copy; 2021 Kaverti</h1>
<p>Version: {{$store.state.client.clientVersion}}</p>
<p>Build Date: {{$store.state.client.buildDate}}</p>
<p v-if="$store.state.client.development">!! DEVELOPMENT MODE !! {{$store.state.client.domain}}</p>
<div class="buttons"> <div class="buttons">
<b-button type="is-info" @click="langModal = true">{{ $t("languages.title") }}</b-button> <b-button type="is-info" @click="langModal = true">{{ $t("languages.title") }}</b-button>
<b-button type="is-info" @click="feedbackModal = true">Provide Feedback</b-button> <b-button type="is-info" @click="feedbackModal = true">Provide Feedback</b-button>
@ -132,8 +135,8 @@ export default {
this.feedback.loading = true; this.feedback.loading = true;
this.axios this.axios
.post( .post(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
"/" + "/" +
"feedback", "feedback",
{ {
@ -145,8 +148,8 @@ export default {
) )
.then(() => { .then(() => {
this.axios.get( this.axios.get(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
"/" + "/" +
"userinfo" "userinfo"
); );
@ -178,8 +181,8 @@ export default {
localStorage.setItem("lang", this.$i18n.locale); localStorage.setItem("lang", this.$i18n.locale);
this.axios this.axios
.put( .put(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
"/" + "/" +
"users/preferences", "users/preferences",
{ {
@ -189,8 +192,8 @@ export default {
.then(() => { .then(() => {
this.axios this.axios
.get( .get(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
"/" + "/" +
"userinfo" "userinfo"
) )

View file

@ -187,41 +187,9 @@
</div> </div>
</form> </form>
</b-modal> </b-modal>
<section <Banners> </Banners>
v-if="!$store.state.user.emailVerified && $store.state.user.username" {{version}}
class="hero is-danger"
>
<div class="hero-body" style="padding: 1rem 1rem !important">
<div class="mobile-container">
<div class="container">
<p style="text-align: center">{{ $t("errors.emailVerify") }}</p>
</div>
</div>
</div>
</section>
<section
v-if="
$store.state.client.clientVersion !==
$store.state.client.latestClientVersion && showOutdatedBanner && $store.state.client.latestClientVersion
"
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: '/' }">
@ -385,7 +353,11 @@
<script> <script>
import AjaxErrorHandler from ".././assets/js/errorHandler"; import AjaxErrorHandler from ".././assets/js/errorHandler";
import axios from "axios"; import axios from "axios";
import Banners from "./Banners"
export default { export default {
components: {
Banners
},
data() { data() {
return { return {
loginModal: false, loginModal: false,
@ -459,8 +431,8 @@ export default {
doRegister() { doRegister() {
this.register.loading = true; this.register.loading = true;
this.axios this.axios
.post(process.env.VUE_APP_APIENDPOINT + .post(process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + "/passkey/register", { process.env.VUE_APP_API_VERSION + "/passkey/register", {
username: this.register.username, username: this.register.username,
password: this.register.password, password: this.register.password,
email: this.register.email, email: this.register.email,
@ -495,8 +467,8 @@ export default {
doLogin() { doLogin() {
this.login.loading = true; this.login.loading = true;
this.axios this.axios
.post(process.env.VUE_APP_APIENDPOINT + .post(process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + "/users/login", { process.env.VUE_APP_API_VERSION + "/users/login", {
username: this.login.username, username: this.login.username,
password: this.login.password, password: this.login.password,
}) })
@ -512,8 +484,8 @@ export default {
this.loginModal = false; this.loginModal = false;
this.axios this.axios
.get( .get(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
"/" + "/" +
"userinfo" "userinfo"
) )
@ -542,8 +514,8 @@ export default {
AjaxErrorHandler(this.$store)(e); AjaxErrorHandler(this.$store)(e);
this.axios this.axios
.get( .get(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
"/" + "/" +
"userinfo" "userinfo"
) )
@ -582,8 +554,8 @@ export default {
}); });
this.axios this.axios
.get( .get(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
"/" + "/" +
"userinfo" "userinfo"
) )
@ -619,8 +591,8 @@ export default {
dailyReward(notify) { dailyReward(notify) {
this.axios this.axios
.get( .get(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
"/" + "/" +
"users/reward" "users/reward"
) )
@ -634,8 +606,8 @@ export default {
}); });
this.axios this.axios
.get( .get(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
"/" + "/" +
"kaverti/state" "kaverti/state"
) )
@ -652,8 +624,8 @@ export default {
}); });
this.axios this.axios
.get( .get(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
"/" + "/" +
"userinfo" "userinfo"
) )
@ -685,8 +657,8 @@ export default {
}); });
this.axios this.axios
.get( .get(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
"/" + "/" +
"kaverti/state" "kaverti/state"
) )
@ -703,8 +675,8 @@ export default {
}); });
this.axios this.axios
.get( .get(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
"/" + "/" +
"userinfo" "userinfo"
) )
@ -734,8 +706,8 @@ export default {
this.showUpdate(); this.showUpdate();
this.axios this.axios
.get( .get(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
"/" + "/" +
"relationships/getAllPendingCanAccept" "relationships/getAllPendingCanAccept"
) )

View file

@ -113,7 +113,7 @@ export default {
this.loading = true; this.loading = true;
this.axios this.axios
.get(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + `/` + `users/conversations`, { params }) .get(process.env.VUE_APP_API_ENDPOINT + process.env.VUE_APP_API_VERSION + `/` + `users/conversations`, { params })
.then(res => { .then(res => {
this.loading = false; this.loading = false;
this.$store.commit('addConversations', res.data.Conversations); this.$store.commit('addConversations', res.data.Conversations);

View file

@ -22,7 +22,7 @@ const nprogress = new NProgress();
Vue.use( Vue.use(
new VueSocketIO({ new VueSocketIO({
debug: true, debug: true,
connection: io(process.env.VUE_APP_GATEWAYENDPOINT), // options object is Optional connection: io(process.env.VUE_APP_GATEWAY_ENDPOINT), // options object is Optional
}) })
); );
Vue.use(VMdEditor); Vue.use(VMdEditor);

View file

@ -10,7 +10,7 @@ export default new Vuex.Store({
wind: false, wind: false,
enableBrokenRoutes: false, enableBrokenRoutes: false,
client: { client: {
clientVersion: '1.0.0-prerelease4', clientVersion: process.env.VUE_APP_VERSION,
latestClientVersion: '', latestClientVersion: '',
latestAPIVersion: '', latestAPIVersion: '',
bannerText: '', bannerText: '',
@ -20,7 +20,11 @@ export default new Vuex.Store({
name: "Kaverti", name: "Kaverti",
logo: '', logo: '',
icon: '', icon: '',
release: process.env.VUE_APP_RELEASE release: process.env.VUE_APP_RELEASE,
development: window.location.hostname === 'dev.kaverti.flowinity' || window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1',
secure: window.location.protocol === "https:",
domain: window.location.hostname,
buildDate: process.env.VUE_APP_BUILD_DATE
}, },
errors: { errors: {
errors: null, errors: null,

View file

@ -103,7 +103,7 @@ export default {
data.append('image', this.item.file); data.append('image', this.item.file);
data.append('fileObj', this.item.fileObj); data.append('fileObj', this.item.fileObj);
this.axios.post(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'marketplace/preview/' + this.createType, data) this.axios.post(process.env.VUE_APP_API_ENDPOINT + process.env.VUE_APP_API_VERSION + '/' + 'marketplace/preview/' + this.createType, data)
.then((res) => { .then((res) => {
this.loadingPreview = false this.loadingPreview = false
this.preview = res.data.image this.preview = res.data.image
@ -125,10 +125,10 @@ export default {
data.append('onSalePrice', this.item.onSalePrice); data.append('onSalePrice', this.item.onSalePrice);
data.append('limited', this.item.limited); data.append('limited', this.item.limited);
data.append('quantityAllowed', this.item.quantity); data.append('quantityAllowed', this.item.quantity);
this.axios.post(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'marketplace/upload/' + this.createType, data) this.axios.post(process.env.VUE_APP_API_ENDPOINT + process.env.VUE_APP_API_VERSION + '/' + 'marketplace/upload/' + this.createType, data)
.then((res) => { .then((res) => {
this.loading = false this.loading = false
this.axios.put(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'marketplace/rerender/' + res.data.id) this.axios.put(process.env.VUE_APP_API_ENDPOINT + process.env.VUE_APP_API_VERSION + '/' + 'marketplace/rerender/' + res.data.id)
}).catch((e) => { }).catch((e) => {
this.loading = false this.loading = false
AjaxErrorHandler(this.$store)(e) AjaxErrorHandler(this.$store)(e)

View file

@ -61,7 +61,7 @@ export default {
refresh() { refresh() {
this.refreshAvatarLoading = true this.refreshAvatarLoading = true
this.axios this.axios
.post(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'users/render/refresh') .post(process.env.VUE_APP_API_ENDPOINT + process.env.VUE_APP_API_VERSION + '/' + 'users/render/refresh')
.then(() => { .then(() => {
this.refreshAvatarLoading = false this.refreshAvatarLoading = false
}) })
@ -76,7 +76,7 @@ export default {
getItems() { getItems() {
this.loading = true; this.loading = true;
this.axios this.axios
.get(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'inventory/' + this.category) .get(process.env.VUE_APP_API_ENDPOINT + process.env.VUE_APP_API_VERSION + '/' + 'inventory/' + this.category)
.then(res => { .then(res => {
this.items = res.data.rows; this.items = res.data.rows;
this.count = res.data.count this.count = res.data.count

View file

@ -147,7 +147,7 @@ export default {
if(name.length) { if(name.length) {
this.axios this.axios
.put(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + `/` + `chat/conversation/${this.$route.params.id}/name`, { name }) .put(process.env.VUE_APP_API_ENDPOINT + process.env.VUE_APP_API_VERSION + `/` + `chat/conversation/${this.$route.params.id}/name`, { name })
.then(res => { .then(res => {
this.name = name; this.name = name;
res res
@ -189,7 +189,7 @@ export default {
this.loading = true; this.loading = true;
this.axios this.axios
.get(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + `/` + `chat/conversation/${this.$route.params.id}?page=${this.page}`) .get(process.env.VUE_APP_API_ENDPOINT + process.env.VUE_APP_API_VERSION + `/` + `chat/conversation/${this.$route.params.id}?page=${this.page}`)
.then(res => { .then(res => {
this.loading = false; this.loading = false;
this.showModal = false; this.showModal = false;

View file

@ -53,8 +53,8 @@ export default {
}, },
authTest() { authTest() {
this.axios this.axios
.get(process.env.VUE_APP_APIENDPOINT + .get(process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + "/userinfo/auth") process.env.VUE_APP_API_VERSION + "/userinfo/auth")
.then(() => { .then(() => {
this.$buefy.snackbar.open({ this.$buefy.snackbar.open({
message: this.$t("errors.authSuccess"), message: this.$t("errors.authSuccess"),

View file

@ -238,7 +238,7 @@ export default {
this.thread = [] this.thread = []
} }
this.axios this.axios
.get(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'forums/thread/' + this.$route.params.id) .get(process.env.VUE_APP_API_ENDPOINT + process.env.VUE_APP_API_VERSION + '/' + 'forums/thread/' + this.$route.params.id)
.then((res) => { .then((res) => {
if(initial) { if(initial) {
this.thread = res.data this.thread = res.data

View file

@ -126,8 +126,8 @@ export default {
this.axios this.axios
.get( .get(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
"/" + "/" +
"forums/category/" + "forums/category/" +
this.selectedCategory this.selectedCategory
@ -163,8 +163,8 @@ export default {
mounted() { mounted() {
this.axios this.axios
.get( .get(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
`/` + `/` +
"forums/category" "forums/category"
) )

View file

@ -81,7 +81,7 @@ export default {
methods: { methods: {
removeFriend(user) { removeFriend(user) {
this.axios this.axios
.put(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'relationships/remove', { .put(process.env.VUE_APP_API_ENDPOINT + process.env.VUE_APP_API_VERSION + '/' + 'relationships/remove', {
friend: user.friend2.username friend: user.friend2.username
}) })
.then(() => { .then(() => {
@ -95,7 +95,7 @@ export default {
}, },
doRelationshipAccept(user) { doRelationshipAccept(user) {
this.axios this.axios
.put(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'relationships/accept', { .put(process.env.VUE_APP_API_ENDPOINT + process.env.VUE_APP_API_VERSION + '/' + 'relationships/accept', {
friend: user.friend2.username friend: user.friend2.username
}) })
.then(() => { .then(() => {
@ -110,7 +110,7 @@ export default {
getItems() { getItems() {
this.loading = true; this.loading = true;
this.axios this.axios
.get(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'relationships/getAll/' + this.category) .get(process.env.VUE_APP_API_ENDPOINT + process.env.VUE_APP_API_VERSION + '/' + 'relationships/getAll/' + this.category)
.then(res => { .then(res => {
this.friends = res.data.rows; this.friends = res.data.rows;
this.count = res.data.count; this.count = res.data.count;

View file

@ -147,8 +147,8 @@ export default {
this.axios this.axios
.post( .post(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
`/` + `/` +
`wall/post`, `wall/post`,
{ {
@ -172,8 +172,8 @@ export default {
} }
this.axios this.axios
.get( .get(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
`/` + `/` +
`user/GlobalWall?wall=true&offset=` + `user/GlobalWall?wall=true&offset=` +
this.wallOffset this.wallOffset
@ -193,8 +193,8 @@ export default {
if (this.$store.state.user.username) { if (this.$store.state.user.username) {
this.axios this.axios
.get( .get(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
`/` + `/` +
`blog/posts` `blog/posts`
) )

View file

@ -161,7 +161,7 @@ export default {
this.offset = 0 this.offset = 0
this.paginate = true this.paginate = true
this.axios this.axios
.get(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'marketplace/' + this.category + '?search=' + this.search + '&offset=' + this.offset) .get(process.env.VUE_APP_API_ENDPOINT + process.env.VUE_APP_API_VERSION + '/' + 'marketplace/' + this.category + '?search=' + this.search + '&offset=' + this.offset)
.then(res => { .then(res => {
this.items = res.data.Items this.items = res.data.Items
this.loading = false this.loading = false
@ -177,7 +177,7 @@ export default {
this.wait = true this.wait = true
} }
this.axios this.axios
.get(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'marketplace/' + this.category + '?offset=' + this.offset) .get(process.env.VUE_APP_API_ENDPOINT + process.env.VUE_APP_API_VERSION + '/' + 'marketplace/' + this.category + '?offset=' + this.offset)
.then(res => { .then(res => {
if(res.data.length < this.limit) { if(res.data.length < this.limit) {
this.offset = null; this.offset = null;

View file

@ -101,13 +101,13 @@ export default {
}, },
mounted() { mounted() {
this.axios this.axios
.get(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + `/` + `marketplace/view/${this.$route.params.id}`) .get(process.env.VUE_APP_API_ENDPOINT + process.env.VUE_APP_API_VERSION + `/` + `marketplace/view/${this.$route.params.id}`)
.then(res => this.item = res.data, this.loading = false) .then(res => this.item = res.data, this.loading = false)
.catch((e) => { .catch((e) => {
AjaxErrorHandler(this.$store)(e) AjaxErrorHandler(this.$store)(e)
}) })
this.axios this.axios
.get(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + `/` + `marketplace/check/${this.$route.params.id}`) .get(process.env.VUE_APP_API_ENDPOINT + process.env.VUE_APP_API_VERSION + `/` + `marketplace/check/${this.$route.params.id}`)
.then(res => this.purchased = res.data.purchased) .then(res => this.purchased = res.data.purchased)
} }
} }

View file

@ -154,13 +154,13 @@ export default {
methods: { methods: {
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_API_ENDPOINT + process.env.VUE_APP_API_VERSION + '/' + 'kaverti/state')
.then(res => { .then(res => {
this.$store.commit('setSettings', res.data.state) this.$store.commit('setSettings', res.data.state)
this.$store.commit('setVersion', res.data.state.latestCanaryVersion) this.$store.commit('setVersion', res.data.state.latestCanaryVersion)
this.$store.commit('setAPIVersion', res.data.apiVersion) this.$store.commit('setAPIVersion', res.data.apiVersion)
}) })
this.axios.get(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'userinfo') this.axios.get(process.env.VUE_APP_API_ENDPOINT + process.env.VUE_APP_API_VERSION + '/' + 'userinfo')
.then(res => { .then(res => {
this.$store.commit('setUsername', res.data.username) this.$store.commit('setUsername', res.data.username)
this.$store.commit('setEmail', res.data.email) this.$store.commit('setEmail', res.data.email)
@ -185,8 +185,8 @@ export default {
}, },
doInit() { doInit() {
this.register.init.loading = true this.register.init.loading = true
this.axios.post(process.env.VUE_APP_APIENDPOINT + this.axios.post(process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + '/passkey/register', { process.env.VUE_APP_API_VERSION + '/passkey/register', {
username: this.register.init.username, username: this.register.init.username,
password: this.register.init.password, password: this.register.init.password,
email: this.register.init.email, email: this.register.init.email,
@ -207,8 +207,8 @@ export default {
}, },
doInfo() { doInfo() {
this.register.personal.loading = true this.register.personal.loading = true
this.axios.put(process.env.VUE_APP_APIENDPOINT + this.axios.put(process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + '/users/preferences', { process.env.VUE_APP_API_VERSION + '/users/preferences', {
description: this.register.personal.description description: this.register.personal.description
}).then(() => { }).then(() => {
this.getInfo() this.getInfo()
@ -222,8 +222,8 @@ export default {
}, },
doTheme(theme) { doTheme(theme) {
this.register.customization.loading = true this.register.customization.loading = true
this.axios.put(process.env.VUE_APP_APIENDPOINT + this.axios.put(process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + '/users/preferences', { process.env.VUE_APP_API_VERSION + '/users/preferences', {
theme: theme theme: theme
}).then(() => { }).then(() => {
this.getInfo() this.getInfo()

View file

@ -84,8 +84,8 @@ export default {
this.settings.description.loading = true; this.settings.description.loading = true;
this.axios this.axios
.put( .put(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
"/users/preferences", "/users/preferences",
{ {
description: this.settings.description.value, description: this.settings.description.value,
@ -105,8 +105,8 @@ export default {
this.settings.preferences.loading = true; this.settings.preferences.loading = true;
this.axios this.axios
.put( .put(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
"/users/preferences", "/users/preferences",
{ {
developerMode: this.settings.preferences.developerMode, developerMode: this.settings.preferences.developerMode,
@ -115,8 +115,8 @@ export default {
.then(() => { .then(() => {
this.axios this.axios
.get( .get(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
"/userinfo" "/userinfo"
) )
.then((res) => { .then((res) => {

View file

@ -75,7 +75,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.axios.get(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'kaverti/stats') this.axios.get(process.env.VUE_APP_API_ENDPOINT + process.env.VUE_APP_API_VERSION + '/' + 'kaverti/stats')
.then(res => { .then(res => {
this.users = res.data.users this.users = res.data.users
this.posts = res.data.posts this.posts = res.data.posts

View file

@ -145,7 +145,7 @@ export default {
this.wait = true this.wait = true
} }
this.axios this.axios
.get(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'teams/' + '?offset=' + this.offset) .get(process.env.VUE_APP_API_ENDPOINT + process.env.VUE_APP_API_VERSION + '/' + 'teams/' + '?offset=' + this.offset)
.then(res => { .then(res => {
if(res.data < this.limit) { if(res.data < this.limit) {
this.offset = null; this.offset = null;

View file

@ -131,8 +131,8 @@ export default {
if (this.offset === null) return; if (this.offset === null) return;
let url = let url =
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
`/` + `/` +
`transactions? `transactions?
sort=${this.tableSort.column} sort=${this.tableSort.column}
@ -178,8 +178,8 @@ export default {
this.axios this.axios
.get( .get(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
"/" + "/" +
"transactions" + "transactions" +
"?limit=" + "?limit=" +

View file

@ -224,8 +224,8 @@ export default {
fetchData() { fetchData() {
this.axios this.axios
.get( .get(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
`/` + `/` +
`user/${this.$route.params.username}` `user/${this.$route.params.username}`
) )
@ -243,8 +243,8 @@ export default {
}); });
this.axios this.axios
.get( .get(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
`/` + `/` +
"relationships/get/" + "relationships/get/" +
this.$route.params.username this.$route.params.username
@ -254,8 +254,8 @@ export default {
scrubDesc() { scrubDesc() {
this.axios this.axios
.put( .put(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
"/" + "/" +
"admin/user/scrub", "admin/user/scrub",
{ {
@ -271,8 +271,8 @@ export default {
refreshAvatar() { refreshAvatar() {
this.axios this.axios
.put( .put(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
"/" + "/" +
"admin/user/avatar", "admin/user/avatar",
{ {
@ -287,8 +287,8 @@ export default {
scrubUsername() { scrubUsername() {
this.axios this.axios
.put( .put(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
"/" + "/" +
"admin/user/scrub", "admin/user/scrub",
{ {
@ -305,8 +305,8 @@ export default {
this.relationships.type === ""; this.relationships.type === "";
this.axios this.axios
.get( .get(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
`/` + `/` +
`relationships/get/${this.$route.params.username}` `relationships/get/${this.$route.params.username}`
) )
@ -315,8 +315,8 @@ export default {
removeFriend() { removeFriend() {
this.axios this.axios
.put( .put(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
"/" + "/" +
"relationships/remove", "relationships/remove",
{ {
@ -328,8 +328,8 @@ export default {
this.description.loading = false; this.description.loading = false;
this.axios this.axios
.get( .get(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
`/` + `/` +
`relationships/get/${this.$route.params.username}` `relationships/get/${this.$route.params.username}`
) )
@ -356,8 +356,8 @@ export default {
}); });
this.axios this.axios
.get( .get(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
`/` + `/` +
`relationships/get/${this.$route.params.username}` `relationships/get/${this.$route.params.username}`
) )
@ -379,8 +379,8 @@ export default {
doRelationship() { doRelationship() {
this.axios this.axios
.post( .post(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
"/" + "/" +
"relationships/send", "relationships/send",
{ {
@ -392,8 +392,8 @@ export default {
this.description.loading = false; this.description.loading = false;
this.axios this.axios
.get( .get(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
`/` + `/` +
`relationships/get/${this.$route.params.username}` `relationships/get/${this.$route.params.username}`
) )
@ -417,8 +417,8 @@ export default {
AjaxErrorHandler(this.$store)(e); AjaxErrorHandler(this.$store)(e);
this.axios this.axios
.get( .get(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
`/` + `/` +
`relationships/get/${this.$route.params.username}` `relationships/get/${this.$route.params.username}`
) )
@ -439,8 +439,8 @@ export default {
doRelationshipAccept() { doRelationshipAccept() {
this.axios this.axios
.put( .put(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
"/" + "/" +
"relationships/accept", "relationships/accept",
{ {
@ -452,8 +452,8 @@ export default {
this.description.loading = false; this.description.loading = false;
this.axios this.axios
.get( .get(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
`/` + `/` +
`relationships/get/${this.$route.params.username}` `relationships/get/${this.$route.params.username}`
) )
@ -479,8 +479,8 @@ export default {
}); });
this.axios this.axios
.get( .get(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
`/` + `/` +
`relationships/get/${this.$route.params.username}` `relationships/get/${this.$route.params.username}`
) )
@ -517,8 +517,8 @@ export default {
this.axios this.axios
.get( .get(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
`/` + `/` +
`user/${this.$route.params.username}` `user/${this.$route.params.username}`
) )
@ -526,8 +526,8 @@ export default {
this.axios this.axios
.get( .get(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
`/` + `/` +
`relationships/get/${this.$route.params.username}` `relationships/get/${this.$route.params.username}`
) )

View file

@ -34,7 +34,7 @@ export default {
}, },
mounted() { mounted() {
this.axios this.axios
.get(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + `/` + `user/${this.$route.params.username}?awards=true`) .get(process.env.VUE_APP_API_ENDPOINT + process.env.VUE_APP_API_VERSION + `/` + `user/${this.$route.params.username}?awards=true`)
.then(res => { .then(res => {
this.awards = res.data this.awards = res.data
}) })

View file

@ -27,7 +27,7 @@ export default {
}, },
mounted() { mounted() {
this.axios this.axios
.get(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + `/` + 'relationships/user/' + this.$route.params.username) .get(process.env.VUE_APP_API_ENDPOINT + process.env.VUE_APP_API_VERSION + `/` + 'relationships/user/' + this.$route.params.username)
.then(res => { .then(res => {
this.friends = res.data this.friends = res.data
}) })

View file

@ -33,7 +33,7 @@ export default {
}, },
mounted() { mounted() {
this.axios this.axios
.get(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + `/` + `user/${this.$route.params.username}?sort=username&order=desc&offset=234243&inventory=true`) .get(process.env.VUE_APP_API_ENDPOINT + process.env.VUE_APP_API_VERSION + `/` + `user/${this.$route.params.username}?sort=username&order=desc&offset=234243&inventory=true`)
.then(res => { .then(res => {
this.inventory = res.data.Inventories this.inventory = res.data.Inventories
}) })

View file

@ -80,7 +80,7 @@ export default {
this.$store.dispatch('setTitle', this.$route.params.username + ' - Posts') this.$store.dispatch('setTitle', this.$route.params.username + ' - Posts')
this.axios this.axios
.get(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + `/` + `user/${this.$route.params.username}?posts=true`) .get(process.env.VUE_APP_API_ENDPOINT + process.env.VUE_APP_API_VERSION + `/` + `user/${this.$route.params.username}?posts=true`)
.then(res => { .then(res => {
this.posts = res.data.Posts this.posts = res.data.Posts
this.nextURL = res.data.meta.nextURL this.nextURL = res.data.meta.nextURL

View file

@ -165,8 +165,8 @@ export default {
} }
this.axios this.axios
.get( .get(
process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_API_ENDPOINT +
process.env.VUE_APP_APIVERSION + process.env.VUE_APP_API_VERSION +
"/" + "/" +
"user/" + "user/" +
"?offset=" + "?offset=" +

66
vue.config.example.js Normal file
View file

@ -0,0 +1,66 @@
const Dotenv = require('dotenv-webpack');
var WebpackAutoInject = require('webpack-auto-inject-version');
const fs = require("fs");
module.exports = {
devServer: {
proxy: 'http://localhost:23981',
//disableHostCheck: true, // dev.kaverti.flowinity
//host: 'dev.kaverti.flowinity',
/*
https: {
cert: fs.readFileSync('C:/ssl/troplo/certificate.crt'),
key: fs.readFileSync('C:/ssl/troplo/private.key'),
}
*/
},
publicPath: '/',
productionSourceMap: false,
configureWebpack: {
plugins: [
new Dotenv(),
new WebpackAutoInject({
// specify the name of the tag in the outputed files eg
// bundle.js: [SHORT] Version: 0.13.36 ...
SHORT: 'Kaverti AIV',
SILENT: false,
PACKAGE_JSON_PATH: './package.json',
PACKAGE_JSON_INDENT: 4,
components: {
AutoIncreaseVersion: true,
InjectAsComment: true,
InjectByTag: true
},
componentsOptions: {
AutoIncreaseVersion: {
runInWatchMode: true // it will increase version with every single build!
},
InjectAsComment: {
tag: 'Kaverti Version: {version}, Build Date: {date}',
dateFormat: 'dd/mm/yyyy; hh:MM:ss TT', // change timezone: `UTC:h:MM:ss` or `GMT:h:MM:ss`
multiLineCommentType: false, // use `/** */` instead of `//` as comment block
},
InjectByTag: {
fileRegex: /\.+/,
AIVTagRegexp: /(\[AIV])(([a-zA-Z{} ,:;!()_@\-"'\\\/])+)(\[\/AIV])/g,
dateFormat: 'dd/mm/yyyy; hh:MM:ss TT'
}
},
LOGS_TEXT: {
AIS_START: 'Kaverti AIV started'
}
})
]
},
pluginOptions: {
i18n: {
locale: 'en',
fallbackLocale: 'debug',
localeDir: 'locales',
enableInSFC: false
}
}
}