2021-01-15 23:24:15 +11:00
|
|
|
<template>
|
|
|
|
<nav>
|
2021-01-16 03:57:00 +11:00
|
|
|
<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">
|
2021-01-16 17:06:35 +11:00
|
|
|
<p class="modal-card-title">{{$t('errorModalTitle')}}</p>
|
2021-01-16 03:57:00 +11:00
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
class="delete"
|
|
|
|
@click="$emit('close')"/>
|
|
|
|
</header>
|
|
|
|
<section class="modal-card-body media">
|
|
|
|
<p :key='error' v-for='error in this.$store.state.errors.errors' style='margin: 1rem;'>{{error}}</p>
|
|
|
|
</section>
|
|
|
|
<footer class="modal-card-foot">
|
|
|
|
<b-button
|
2021-01-16 17:06:35 +11:00
|
|
|
:label="$t('gotIt')"
|
2021-01-16 18:11:42 +11:00
|
|
|
@click="ajaxErrorModal = false" />
|
2021-01-16 03:57:00 +11:00
|
|
|
</footer>
|
|
|
|
</div>
|
|
|
|
</b-modal>
|
2021-01-15 23:24:15 +11:00
|
|
|
<b-modal :active="loginModal" @update:active="value => loginModal = value" :width="640" scroll="keep">
|
2021-01-16 17:06:35 +11:00
|
|
|
<form>
|
2021-01-15 23:24:15 +11:00
|
|
|
<div class="modal-card" style="width: auto">
|
|
|
|
<header class="modal-card-head">
|
2021-01-16 17:06:35 +11:00
|
|
|
<p class="modal-card-title">{{ $t('login.title') }}</p>
|
2021-01-15 23:24:15 +11:00
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
class="delete"
|
2021-01-16 18:11:42 +11:00
|
|
|
@click="loginModal = false"/>
|
2021-01-15 23:24:15 +11:00
|
|
|
</header>
|
|
|
|
<section class="modal-card-body">
|
2021-01-16 17:06:35 +11:00
|
|
|
<b-field :label="$t('login.loginUsername')">
|
2021-01-15 23:24:15 +11:00
|
|
|
<b-input
|
|
|
|
:value="login.username"
|
|
|
|
v-model="login.username"
|
2021-01-16 17:06:35 +11:00
|
|
|
:placeholder="$t('login.loginUsername')"
|
2021-01-15 23:24:15 +11:00
|
|
|
required>
|
|
|
|
</b-input>
|
|
|
|
</b-field>
|
|
|
|
|
2021-01-16 17:06:35 +11:00
|
|
|
<b-field :label="$t('login.loginPassword')">
|
2021-01-15 23:24:15 +11:00
|
|
|
<b-input
|
|
|
|
type="password"
|
|
|
|
:value="login.password"
|
|
|
|
v-model="login.password"
|
|
|
|
password-reveal
|
2021-01-16 17:06:35 +11:00
|
|
|
:placeholder="$t('login.loginPassword')"
|
2021-01-15 23:24:15 +11:00
|
|
|
required>
|
|
|
|
</b-input>
|
|
|
|
</b-field>
|
2021-01-16 17:06:35 +11:00
|
|
|
<b-checkbox v-model="login.doNotSaveToken">{{$t('login.doNotSaveAuth')}}</b-checkbox>
|
2021-01-15 23:24:15 +11:00
|
|
|
</section>
|
|
|
|
<footer class="modal-card-foot">
|
|
|
|
<b-button
|
|
|
|
@click="doLogin()"
|
2021-01-16 17:06:35 +11:00
|
|
|
:label="$t('login.login')"
|
2021-01-15 23:24:15 +11:00
|
|
|
:loading="login.loading"
|
|
|
|
type="is-primary" />
|
2021-01-16 15:33:33 +11:00
|
|
|
<b-button
|
2021-01-16 17:06:35 +11:00
|
|
|
:label="$t('close')"
|
2021-01-16 18:11:42 +11:00
|
|
|
@click="loginModal = false" />
|
2021-01-16 03:57:00 +11:00
|
|
|
<b-button
|
|
|
|
@click="registerModal = true; loginModal = false"
|
2021-01-16 17:06:35 +11:00
|
|
|
:label="$t('login.register')"
|
2021-01-16 03:57:00 +11:00
|
|
|
type="is-success" />
|
2021-01-15 23:24:15 +11:00
|
|
|
</footer>
|
|
|
|
</div>
|
2021-01-16 17:06:35 +11:00
|
|
|
</form>
|
2021-01-15 23:24:15 +11:00
|
|
|
</b-modal>
|
2021-01-17 00:20:05 +11:00
|
|
|
<b-modal :active="settingsModal" @update:active="value => settingsModal = value" :width="640" scroll="keep">
|
|
|
|
<form>
|
|
|
|
<div class="modal-card" style="width: auto">
|
|
|
|
<header class="modal-card-head">
|
|
|
|
<p class="modal-card-title">{{ $t('settings.title') }}</p>
|
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
class="delete"
|
|
|
|
@click="loginModal = false"/>
|
|
|
|
</header>
|
|
|
|
<section class="modal-card-body">
|
|
|
|
<b-tabs position="is-centered" class="block">
|
|
|
|
<b-tab-item :label="$t('settings.general.title')">
|
|
|
|
<h1 class="title">{{$t('settings.general.title')}}</h1>
|
|
|
|
<div>
|
|
|
|
<h1 class="subtitle">{{$t('settings.general.about')}}</h1>
|
|
|
|
<h4>
|
|
|
|
{{ $t('settings.general.description') }}
|
|
|
|
</h4>
|
|
|
|
<b-input type="textarea"
|
|
|
|
:placeholder="$t('settings.general.hi') + ' ' + $store.state.user.username"
|
|
|
|
maxlength="256"
|
|
|
|
v-model='settings.general.description.value'
|
|
|
|
:error='settings.general.description.error'
|
|
|
|
></b-input>
|
|
|
|
<b-button
|
|
|
|
class='button is-info'
|
|
|
|
:loading='settings.general.description.loading'
|
2021-01-21 00:08:04 +11:00
|
|
|
@click='saveDesc()'
|
2021-01-17 00:20:05 +11:00
|
|
|
>
|
|
|
|
{{$t('settings.general.saveDesc')}}
|
|
|
|
</b-button>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<h2>{{$t('settings.general.preferences')}}</h2>
|
|
|
|
<b-switch class="is-info" v-model="settings.general.preferences.developerMode">{{$t('settings.general.devMode')}}</b-switch><br>
|
|
|
|
<b-button
|
|
|
|
class='button is-info'
|
|
|
|
:loading='settings.general.preferences.loading'
|
2021-01-21 00:08:04 +11:00
|
|
|
@click='savePref()'
|
2021-01-17 00:20:05 +11:00
|
|
|
>
|
|
|
|
{{$t('settings.general.savePref')}}
|
|
|
|
</b-button>
|
|
|
|
</div>
|
|
|
|
</b-tab-item>
|
|
|
|
<b-tab-item :label="$t('settings.security.title')">
|
|
|
|
Debug
|
|
|
|
</b-tab-item>
|
|
|
|
<b-tab-item :label="$t('settings.privacy.title')">
|
|
|
|
Debug
|
|
|
|
</b-tab-item>
|
|
|
|
<b-tab-item :label="$t('settings.experiments.title')">
|
|
|
|
Debug
|
|
|
|
</b-tab-item>
|
|
|
|
<b-tab-item :label="$t('settings.about.title')">
|
|
|
|
<div>
|
|
|
|
<center>
|
|
|
|
<img src="https://cdn.kaverti.com/icon.png" width="10%">
|
|
|
|
<h1>Kaverti v{{this.$store.state.client.clientVersion}}</h1>
|
|
|
|
<p>Latest client version: v{{this.$store.state.client.latestClientVersion}}</p>
|
|
|
|
<p>API version: v{{this.$store.state.client.latestAPIVersion}}</p>
|
|
|
|
</center>
|
|
|
|
</div>
|
|
|
|
</b-tab-item>
|
|
|
|
</b-tabs>
|
|
|
|
</section>
|
2021-01-20 00:03:47 +11:00
|
|
|
<footer class="modal-card-foot">
|
|
|
|
<b-button
|
|
|
|
:label="$t('close')"
|
|
|
|
@click="settingsModal = false" />
|
|
|
|
</footer>
|
2021-01-17 00:20:05 +11:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</b-modal>
|
2021-01-21 19:02:20 +11:00
|
|
|
<b-modal :active="updateModal" @update:active="value => updateModal = value" :width="640" scroll="keep">
|
|
|
|
<form>
|
|
|
|
<div class="modal-card" style="width: auto">
|
|
|
|
<header class="modal-card-head">
|
|
|
|
<p class="modal-card-title">{{$t('update.title')}}</p>
|
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
class="delete"
|
2021-01-28 20:35:42 +11:00
|
|
|
@click="updateDismissed"/>
|
2021-01-21 19:02:20 +11:00
|
|
|
</header>
|
|
|
|
<section class="modal-card-body has-text-centered">
|
|
|
|
<h1 class="subtitle">What's new in {{$store.state.client.clientVersion}}?</h1>
|
|
|
|
<ul>
|
2021-01-28 19:25:45 +11:00
|
|
|
<li>Improved pagination</li>
|
|
|
|
<li>Add friend page</li>
|
|
|
|
<li>Remove koin icon in buttons</li>
|
|
|
|
<li>Add global wall</li>
|
|
|
|
<li>Add blog</li>
|
|
|
|
<li>Add new friend count in Navbar User Menu</li>
|
|
|
|
<li>Add developmental forum</li>
|
2021-01-28 20:35:42 +11:00
|
|
|
<hr>
|
|
|
|
<li>{{$store.state.client.clientVersion}}-patch fixes:</li>
|
|
|
|
<li>Patch pagination page crash bug with 'wait' prop to not attempt to load more when its loading</li>
|
|
|
|
<li>Improve forum thread page</li>
|
2021-01-21 19:02:20 +11:00
|
|
|
</ul>
|
|
|
|
</section>
|
|
|
|
<footer class="modal-card-foot">
|
|
|
|
<b-button
|
|
|
|
:label="$t('close')"
|
|
|
|
@click="updateDismissed" />
|
|
|
|
</footer>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</b-modal>
|
2021-01-15 23:24:15 +11:00
|
|
|
<b-modal :active="registerModal" @update:active="value => registerModal = value" :width="640" scroll="keep">
|
2021-01-16 17:06:35 +11:00
|
|
|
<form>
|
2021-01-15 23:24:15 +11:00
|
|
|
<div class="modal-card" style="width: auto">
|
|
|
|
<header class="modal-card-head">
|
2021-01-16 17:06:35 +11:00
|
|
|
<p class="modal-card-title">{{$t('register.title')}}</p>
|
2021-01-15 23:24:15 +11:00
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
class="delete"
|
2021-01-16 18:11:42 +11:00
|
|
|
@click="registerModal = false"/>
|
2021-01-15 23:24:15 +11:00
|
|
|
</header>
|
|
|
|
<section class="modal-card-body">
|
2021-01-16 17:06:35 +11:00
|
|
|
<b-field :label="$t('register.username')">
|
2021-01-15 23:24:15 +11:00
|
|
|
<b-input
|
|
|
|
:value="register.username"
|
|
|
|
v-model="register.username"
|
2021-01-16 17:06:35 +11:00
|
|
|
:placeholder="$t('register.username')"
|
2021-01-15 23:24:15 +11:00
|
|
|
required>
|
|
|
|
</b-input>
|
|
|
|
</b-field>
|
2021-01-16 17:06:35 +11:00
|
|
|
<b-field :label="$t('register.email')">
|
2021-01-15 23:24:15 +11:00
|
|
|
<b-input
|
|
|
|
type="email"
|
|
|
|
:value="register.email"
|
|
|
|
v-model="register.email"
|
2021-01-16 17:06:35 +11:00
|
|
|
:placeholder="$t('register.email')"
|
2021-01-15 23:24:15 +11:00
|
|
|
required>
|
|
|
|
</b-input>
|
|
|
|
</b-field>
|
2021-01-16 17:06:35 +11:00
|
|
|
<b-field :label="$t('register.password')">
|
2021-01-15 23:24:15 +11:00
|
|
|
<b-input
|
|
|
|
type="password"
|
|
|
|
:value="register.password"
|
|
|
|
v-model="register.password"
|
|
|
|
password-reveal
|
2021-01-16 17:06:35 +11:00
|
|
|
:placeholder="$t('register.password')"
|
2021-01-15 23:24:15 +11:00
|
|
|
required>
|
|
|
|
</b-input>
|
|
|
|
</b-field>
|
2021-01-16 17:06:35 +11:00
|
|
|
<b-field :label="$t('register.confirm')">
|
2021-01-15 23:24:15 +11:00
|
|
|
<b-input
|
|
|
|
type="password"
|
|
|
|
:value="register.confirm"
|
|
|
|
v-model="register.confirm"
|
|
|
|
password-reveal
|
2021-01-16 17:06:35 +11:00
|
|
|
:placeholder="$t('register.confirm')"
|
2021-01-15 23:24:15 +11:00
|
|
|
required>
|
|
|
|
</b-input>
|
|
|
|
</b-field>
|
2021-02-02 23:44:45 +11:00
|
|
|
<b-checkbox v-model="register.agree">{{$t('register.agree')}} <router-link @click="registerModal = false " to="/legal/tos">{{$t('tos')}}</router-link></b-checkbox>
|
2021-01-15 23:24:15 +11:00
|
|
|
</section>
|
|
|
|
<footer class="modal-card-foot">
|
|
|
|
<b-button
|
|
|
|
@click="doRegister()"
|
2021-01-16 17:06:35 +11:00
|
|
|
:label="$t('register.text')"
|
2021-01-15 23:24:15 +11:00
|
|
|
:loading="register.loading"
|
|
|
|
type="is-primary" />
|
2021-01-16 15:33:33 +11:00
|
|
|
<b-button
|
2021-01-16 17:06:35 +11:00
|
|
|
:label="$t('close')"
|
2021-01-16 18:11:42 +11:00
|
|
|
@click="registerModal = false" />
|
2021-01-16 03:57:00 +11:00
|
|
|
<b-button
|
|
|
|
@click="registerModal = false; loginModal = true"
|
2021-01-16 17:06:35 +11:00
|
|
|
:label="$t('register.login')"
|
2021-01-16 03:57:00 +11:00
|
|
|
type="is-success" />
|
2021-01-15 23:24:15 +11:00
|
|
|
</footer>
|
|
|
|
</div>
|
2021-01-16 17:06:35 +11:00
|
|
|
</form>
|
2021-01-15 23:24:15 +11:00
|
|
|
</b-modal>
|
2021-01-18 00:05:28 +11:00
|
|
|
<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>
|
2021-01-21 02:39:07 +11:00
|
|
|
<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>
|
2021-01-15 23:24:15 +11:00
|
|
|
<b-navbar>
|
|
|
|
<template #brand>
|
|
|
|
<b-navbar-item tag="router-link" :to="{ path: '/' }">
|
|
|
|
<img
|
|
|
|
src="https://cdn.kaverti.com/logo.png"
|
|
|
|
alt="Kaverti Logo"
|
|
|
|
>
|
|
|
|
</b-navbar-item>
|
|
|
|
</template>
|
|
|
|
<template #start>
|
2021-01-17 00:20:05 +11:00
|
|
|
<b-navbar-item tag="router-link" to="/">
|
2021-01-16 17:06:35 +11:00
|
|
|
{{$t('navbar.home')}}
|
2021-01-15 23:24:15 +11:00
|
|
|
</b-navbar-item>
|
2021-01-20 00:03:47 +11:00
|
|
|
<b-navbar-item tag="router-link" to="/forums">
|
|
|
|
{{$t('navbar.forums')}}
|
|
|
|
</b-navbar-item>
|
2021-01-17 00:20:05 +11:00
|
|
|
<b-navbar-item tag="router-link" to="/marketplace">
|
2021-01-16 17:06:35 +11:00
|
|
|
{{$t('navbar.marketplace')}}
|
|
|
|
</b-navbar-item>
|
2021-01-17 00:20:05 +11:00
|
|
|
<b-navbar-item tag="router-link" to="/users">
|
|
|
|
{{$t('navbar.users')}}
|
|
|
|
</b-navbar-item>
|
|
|
|
<b-navbar-item tag="router-link" to="/teams">
|
2021-01-16 17:06:35 +11:00
|
|
|
{{$t('navbar.teams')}}
|
|
|
|
</b-navbar-item>
|
2021-01-17 00:20:05 +11:00
|
|
|
<b-navbar-item tag="router-link" to="/games">
|
2021-01-16 17:06:35 +11:00
|
|
|
{{$t('navbar.games')}}
|
2021-01-15 23:24:15 +11:00
|
|
|
</b-navbar-item>
|
|
|
|
<div v-if="$store.state.debug" class="navbar-item has-dropdown is-hoverable is-info">
|
|
|
|
<a class="navbar-link">
|
2021-01-16 17:06:35 +11:00
|
|
|
<p>{{$t('navbar.dev.title')}}</p>
|
2021-01-15 23:24:15 +11:00
|
|
|
</a>
|
2021-01-16 03:57:00 +11:00
|
|
|
<div class="navbar-dropdown">
|
2021-01-16 17:06:35 +11:00
|
|
|
<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>
|
2021-01-21 02:39:07 +11:00
|
|
|
<b-navbar-item @click="toggleBrokenRoute(true)">{{$t('navbar.dev.brokenRoute')}}</b-navbar-item>
|
2021-01-15 23:24:15 +11:00
|
|
|
</div>
|
|
|
|
</div>
|
2021-01-17 00:20:05 +11:00
|
|
|
<div v-if="$store.state.debug" class="navbar-item has-dropdown is-hoverable is-info">
|
|
|
|
<a class="navbar-link">
|
|
|
|
<p>{{$t('navbar.more.title')}}</p>
|
|
|
|
</a>
|
|
|
|
<div class="navbar-dropdown">
|
|
|
|
<b-navbar-item tag="a" href="https://twitter.com/Kaverti">{{$t('navbar.more.twitter')}}</b-navbar-item>
|
|
|
|
<b-navbar-item tag="a" href="https://discord.gg/Q3HAWFdBPK">{{$t('navbar.more.discord')}}</b-navbar-item>
|
|
|
|
<b-navbar-item tag="router-link" to="/roadmap">{{$t('navbar.more.roadmap')}}</b-navbar-item>
|
|
|
|
<b-navbar-item tag="a" href="soon">{{$t('navbar.more.documentation')}}</b-navbar-item>
|
|
|
|
<b-navbar-item tag="router-link" to="/downloads">{{$t('navbar.downloads')}}</b-navbar-item>
|
|
|
|
<b-navbar-item tag="router-link" to="/stats">{{$t('navbar.more.stats')}}</b-navbar-item>
|
2021-01-28 00:04:22 +11:00
|
|
|
<b-navbar-item tag="router-link" to="/blog">{{$t('navbar.more.blog')}}</b-navbar-item>
|
2021-01-17 00:20:05 +11:00
|
|
|
</div>
|
|
|
|
</div>
|
2021-01-15 23:24:15 +11:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<template #end>
|
2021-01-28 19:25:45 +11:00
|
|
|
<b-navbar-item v-if="$store.state.user.username && !loading" @click="dailyReward(true)">
|
2021-01-19 01:57:19 +11:00
|
|
|
<img src="https://cdn.kaverti.com/icons/koins.svg">{{$store.state.user.koins}}
|
2021-01-17 00:20:05 +11:00
|
|
|
</b-navbar-item>
|
2021-01-16 15:33:33 +11:00
|
|
|
<div v-if="!loading">
|
2021-01-28 00:04:22 +11:00
|
|
|
<b-navbar-item v-if="!$store.state.user.username" tag="div">
|
|
|
|
<div class="buttons">
|
|
|
|
<b-button @click="registerModal = true" class="button is-primary">
|
|
|
|
<strong>{{$t('navbar.register')}}</strong>
|
|
|
|
</b-button>
|
|
|
|
<b-button @click="loginModal = true" class="button is-light">
|
|
|
|
{{$t('navbar.login')}}
|
|
|
|
</b-button>
|
|
|
|
</div>
|
|
|
|
</b-navbar-item>
|
2021-01-16 15:33:33 +11:00
|
|
|
</div>
|
2021-01-28 00:04:22 +11:00
|
|
|
<b-navbar-dropdown class="is-hoverable" style="padding-right:15px" :label="$store.state.user.username" v-if="$store.state.user.username && !loading">
|
|
|
|
<b-navbar-item tag="router-link" :to="'/u/' + $store.state.user.username">{{$t('navbar.user.profile')}}</b-navbar-item>
|
|
|
|
<b-navbar-item @click="settingsModal = true">{{$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 tag="router-link" to="/admin" v-if="$store.state.user.admin">{{$t('navbar.user.admin')}}</b-navbar-item>
|
2021-01-28 19:25:45 +11:00
|
|
|
<b-navbar-item tag="router-link" to="/friends"><b-tag class="is-info" rounded v-if="friendCount > 0"> {{ friendCount }}</b-tag> <p>{{$t('navbar.user.friends')}}</p></b-navbar-item>
|
2021-01-28 00:04:22 +11:00
|
|
|
<b-navbar-item @click="logout()">{{$t('navbar.user.logout')}}</b-navbar-item>
|
|
|
|
</b-navbar-dropdown>
|
2021-01-19 01:57:19 +11:00
|
|
|
<b-navbar-item v-if="loading">
|
|
|
|
<div class="fa-1x">
|
|
|
|
<i class="fas fa-circle-notch fa-spin"></i>
|
|
|
|
{{ $t('generic.loading') }}
|
|
|
|
</div>
|
|
|
|
</b-navbar-item>
|
2021-01-15 23:24:15 +11:00
|
|
|
</template>
|
|
|
|
</b-navbar>
|
2021-01-18 00:05:28 +11:00
|
|
|
<section v-if='$store.state.client.bannerText && $store.state.client.bannerEnabled && showBanner' class="hero is-info">
|
|
|
|
<div class="hero-body" style="padding: 1rem 1rem !important;">
|
|
|
|
<div class="mobile-container">
|
|
|
|
<div class="container">
|
|
|
|
<p style="text-align: center;">{{$store.state.client.bannerText}} <button
|
|
|
|
type="button"
|
|
|
|
class="delete"
|
|
|
|
style="float: right;"
|
|
|
|
@click="removeBannerId"/></p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</section>
|
2021-01-15 23:24:15 +11:00
|
|
|
</nav>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
import AjaxErrorHandler from '../../assets/js/errorHandler'
|
2021-01-16 03:57:00 +11:00
|
|
|
import axios from "axios";
|
2021-01-15 23:24:15 +11:00
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
loginModal: false,
|
|
|
|
registerModal: false,
|
2021-01-16 15:33:33 +11:00
|
|
|
loading: true,
|
2021-01-17 00:20:05 +11:00
|
|
|
settingsModal: false,
|
2021-01-18 00:05:28 +11:00
|
|
|
showBanner: true,
|
2021-01-21 02:39:07 +11:00
|
|
|
showOutdatedBanner: true,
|
2021-01-19 03:00:49 +11:00
|
|
|
friendCount: 0,
|
2021-01-21 19:02:20 +11:00
|
|
|
updateModal: false,
|
2021-01-17 00:20:05 +11:00
|
|
|
settings: {
|
|
|
|
tab: 0,
|
|
|
|
general: {
|
|
|
|
description: {
|
|
|
|
value: '',
|
|
|
|
loading: false,
|
|
|
|
error: ''
|
|
|
|
},
|
|
|
|
preferences: {
|
|
|
|
theme: '',
|
|
|
|
developerMode: '',
|
|
|
|
loading: false,
|
|
|
|
error: ''
|
|
|
|
},
|
|
|
|
},
|
|
|
|
privacy: {
|
|
|
|
wall: false,
|
|
|
|
loading: false
|
|
|
|
},
|
|
|
|
experiments: {
|
|
|
|
theme: 'light',
|
|
|
|
loading: false,
|
|
|
|
error: '',
|
|
|
|
relationships: false,
|
|
|
|
wall: false,
|
|
|
|
marketplace: false,
|
|
|
|
teams: false,
|
|
|
|
newsettings: true,
|
|
|
|
corrupt: false,
|
|
|
|
local: []
|
|
|
|
},
|
|
|
|
account: {
|
|
|
|
showLogoutModal: false,
|
|
|
|
password: {
|
|
|
|
loading: false,
|
|
|
|
|
|
|
|
current: '',
|
|
|
|
new: '',
|
|
|
|
|
|
|
|
errors: {
|
|
|
|
'new password': '',
|
|
|
|
'current password': ''
|
|
|
|
}
|
|
|
|
},
|
|
|
|
email: {
|
|
|
|
loading: false,
|
|
|
|
loadingChange: false,
|
|
|
|
|
|
|
|
currentPassword: '',
|
|
|
|
new: '',
|
|
|
|
|
|
|
|
errors: {
|
|
|
|
'new password': '',
|
|
|
|
'email current password': ''
|
|
|
|
}
|
|
|
|
},
|
|
|
|
username: {username: '',
|
|
|
|
password: '',
|
|
|
|
errors: {
|
|
|
|
'username': '',
|
|
|
|
'password': '',
|
|
|
|
},
|
|
|
|
loading: false,
|
|
|
|
},
|
|
|
|
deleteAcc: {
|
|
|
|
loading: false,
|
|
|
|
|
|
|
|
password: '',
|
|
|
|
|
|
|
|
errors: {
|
|
|
|
'current password': ''
|
|
|
|
}
|
|
|
|
},
|
|
|
|
totp: {loading: false
|
|
|
|
},
|
|
|
|
|
|
|
|
deleteAccountLoading: false,
|
|
|
|
invalidateSessionLoading: false,
|
|
|
|
emailCheckDelete: false,
|
|
|
|
showLoginModal: false
|
|
|
|
}
|
|
|
|
},
|
2021-01-15 23:24:15 +11:00
|
|
|
login: {
|
|
|
|
username: '',
|
|
|
|
password: '',
|
2021-01-16 15:33:33 +11:00
|
|
|
loading: false,
|
|
|
|
doNotSaveToken: false,
|
2021-01-15 23:24:15 +11:00
|
|
|
},
|
|
|
|
register: {
|
|
|
|
username: '',
|
|
|
|
email: '',
|
|
|
|
password: '',
|
|
|
|
confirm: '',
|
|
|
|
agree: false,
|
|
|
|
loading: false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2021-01-16 03:57:00 +11:00
|
|
|
computed: {
|
|
|
|
ajaxErrorModal: {
|
|
|
|
get() {
|
|
|
|
return this.$store.state.errors.modal
|
|
|
|
},
|
|
|
|
set(val) {
|
|
|
|
this.$store.commit('setAjaxErrorsModalState', val)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
2021-01-15 23:24:15 +11:00
|
|
|
methods: {
|
2021-01-21 02:39:07 +11:00
|
|
|
toggleBrokenRoute (val) {
|
|
|
|
this.$store.commit('brokenRoute', val)
|
|
|
|
},
|
2021-01-21 00:08:04 +11:00
|
|
|
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)
|
|
|
|
})
|
|
|
|
},
|
2021-01-18 00:05:28 +11:00
|
|
|
getBannerId() {
|
|
|
|
if(localStorage.getItem(this.$store.state.client.bannerId)) {
|
|
|
|
this.showBanner = false
|
|
|
|
} else {
|
|
|
|
this.showBanner = true
|
|
|
|
}
|
|
|
|
},
|
2021-01-21 19:02:20 +11:00
|
|
|
updateDismissed() {
|
|
|
|
localStorage.setItem("update-" + this.$store.state.client.clientVersion, true)
|
|
|
|
this.updateModal = false
|
|
|
|
},
|
|
|
|
showUpdate() {
|
|
|
|
if(!localStorage.getItem("update-" + this.$store.state.client.clientVersion)) {
|
|
|
|
this.updateModal = true
|
|
|
|
} else {
|
|
|
|
this.updateModal = false
|
|
|
|
}
|
|
|
|
},
|
2021-01-18 00:05:28 +11:00
|
|
|
removeBannerId() {
|
|
|
|
localStorage.setItem(this.$store.state.client.bannerId, true)
|
|
|
|
this.$store.state.client.bannerEnabled = false
|
|
|
|
console.log(localStorage.getItem(this.$store.state.client.bannerId))
|
|
|
|
},
|
2021-01-15 23:24:15 +11:00
|
|
|
doRegister() {
|
|
|
|
this.register.loading = true
|
2021-01-18 00:05:28 +11:00
|
|
|
this.axios.post('/api/v1/passkey/register', {
|
2021-01-15 23:24:15 +11:00
|
|
|
username: this.register.username,
|
|
|
|
password: this.register.password,
|
|
|
|
email: this.register.email,
|
|
|
|
confirm: this.register.confirm,
|
|
|
|
agree: this.register.agree
|
|
|
|
}).then((res) => {
|
|
|
|
this.register.loading = false
|
2021-01-21 00:08:04 +11:00
|
|
|
this.registerModal = false
|
2021-01-15 23:24:15 +11:00
|
|
|
this.$store.commit('setToken', res.data.token)
|
2021-01-21 00:08:04 +11:00
|
|
|
localStorage.setItem('token', JSON.stringify(res.data.token));
|
|
|
|
this.getInfo()
|
2021-01-18 00:05:28 +11:00
|
|
|
this.$buefy.snackbar.open({message:this.$t('errors.registered'), type: 'is-info'})
|
2021-01-15 23:24:15 +11:00
|
|
|
}).catch(e => {
|
|
|
|
this.register.loading = false
|
|
|
|
|
|
|
|
AjaxErrorHandler(this.$store)(e, (error, errors) => {
|
|
|
|
let path = error.path
|
|
|
|
|
|
|
|
if (this.errors[path] !== undefined) {
|
|
|
|
this.errors[path] = error.message
|
|
|
|
} else {
|
|
|
|
errors.push(error.message)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
doLogin() {
|
|
|
|
this.login.loading = true
|
|
|
|
this.axios.post('/api/v1/users/login', {
|
2021-01-16 03:57:00 +11:00
|
|
|
username: this.login.username,
|
|
|
|
password: this.login.password
|
2021-01-15 23:24:15 +11:00
|
|
|
}).then((res) => {
|
2021-01-16 03:57:00 +11:00
|
|
|
this.login.loading = false
|
2021-01-15 23:24:15 +11:00
|
|
|
this.$store.commit('setToken', res.data.token)
|
2021-01-16 15:33:33 +11:00
|
|
|
if (!this.login.doNotSaveToken) {
|
|
|
|
localStorage.setItem('token', JSON.stringify(res.data.token));
|
|
|
|
}
|
2021-01-16 03:57:00 +11:00
|
|
|
Object.assign(axios.defaults, {headers: {Authorization: this.$store.state.user.token}})
|
2021-01-16 15:33:33 +11:00
|
|
|
this.loginModal = 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('setKoins', res.data.koins)
|
|
|
|
this.$store.commit('setID', res.data.id)
|
|
|
|
this.$store.commit('setBot', res.data.bot)
|
2021-01-18 00:05:28 +11:00
|
|
|
this.$buefy.snackbar.open({message:this.$t('errors.login'), type: 'is-info'})
|
2021-01-16 15:33:33 +11:00
|
|
|
}).catch(() => {
|
2021-01-16 18:11:42 +11:00
|
|
|
this.$buefy.snackbar.open({message:this.$t('errors.authFail'), type: 'is-warning'})
|
2021-01-16 15:33:33 +11:00
|
|
|
})
|
2021-01-15 23:24:15 +11:00
|
|
|
}).catch(e => {
|
2021-01-16 03:57:00 +11:00
|
|
|
this.login.loading = false
|
2021-01-16 15:33:33 +11:00
|
|
|
AjaxErrorHandler(this.$store)(e)
|
|
|
|
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)
|
|
|
|
}).catch(() => {
|
2021-01-16 18:11:42 +11:00
|
|
|
this.$buefy.snackbar.open({message:this.$t('errors.authFail'), type: 'is-warning'})
|
2021-01-16 15:33:33 +11:00
|
|
|
})
|
2021-01-15 23:24:15 +11:00
|
|
|
|
|
|
|
AjaxErrorHandler(this.$store)(e, (error, errors) => {
|
|
|
|
let path = error.path
|
|
|
|
|
|
|
|
if (this.errors[path] !== undefined) {
|
|
|
|
this.errors[path] = error.message
|
|
|
|
} else {
|
|
|
|
errors.push(error.message)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
2021-01-16 03:57:00 +11:00
|
|
|
},
|
2021-01-18 00:05:28 +11:00
|
|
|
logout() {
|
|
|
|
localStorage.removeItem('token');
|
|
|
|
this.$store.commit('setToken', '')
|
|
|
|
Object.assign(axios.defaults, {headers: {Authorization: this.$store.state.user.token}})
|
|
|
|
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.$buefy.snackbar.open({message:this.$t('errors.logout'), type: 'is-info'})
|
|
|
|
}).catch(() => {
|
|
|
|
this.$buefy.snackbar.open({message:this.$t('errors.logout'), type: 'is-info'})
|
|
|
|
})
|
|
|
|
},
|
2021-01-16 03:57:00 +11:00
|
|
|
fakeUser () {
|
|
|
|
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}})
|
2021-01-21 00:08:04 +11:00
|
|
|
},
|
2021-01-28 19:25:45 +11:00
|
|
|
dailyReward(notify) {
|
2021-01-21 02:39:07 +11:00
|
|
|
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 => {
|
2021-01-28 19:25:45 +11:00
|
|
|
if(notify) {
|
|
|
|
AjaxErrorHandler(this.$store)(e)
|
|
|
|
}
|
2021-01-21 02:39:07 +11:00
|
|
|
})
|
|
|
|
},
|
2021-01-21 00:08:04 +11:00
|
|
|
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 => {
|
2021-01-21 02:39:07 +11:00
|
|
|
this.$store.commit('setSettings', res.data.state)
|
|
|
|
this.$store.commit('setVersion', res.data.state.latestCanaryVersion)
|
|
|
|
this.$store.commit('setAPIVersion', res.data.apiVersion)
|
2021-01-21 00:08:04 +11:00
|
|
|
}).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
|
|
|
|
})
|
2021-01-15 23:24:15 +11:00
|
|
|
}
|
2021-01-16 15:33:33 +11:00
|
|
|
},
|
|
|
|
mounted() {
|
2021-01-21 00:08:04 +11:00
|
|
|
Object.assign(axios.defaults, {headers: {Authorization: this.$store.state.user.token}})
|
2021-01-18 00:05:28 +11:00
|
|
|
this.axios.get(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'kaverti/state')
|
|
|
|
.then(res => {
|
2021-01-21 02:39:07 +11:00
|
|
|
this.$store.commit('setSettings', res.data.state)
|
|
|
|
this.$store.commit('setVersion', res.data.state.latestCanaryVersion)
|
|
|
|
this.$store.commit('setAPIVersion', res.data.apiVersion)
|
2021-01-18 00:05:28 +11:00
|
|
|
}).catch(() => {
|
|
|
|
this.$buefy.snackbar.open({message:this.$t('errors.down'), type: 'is-info'})
|
|
|
|
})
|
2021-01-16 15:33:33 +11:00
|
|
|
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)
|
2021-01-21 00:08:04 +11:00
|
|
|
this.$store.commit('setDescription', res.data.description)
|
|
|
|
this.$store.commit('setExecutive', res.data.executive)
|
|
|
|
this.settings.general.description.value = res.data.description
|
2021-01-16 15:33:33 +11:00
|
|
|
this.loading = false
|
|
|
|
}).catch(() => {
|
2021-01-16 18:11:42 +11:00
|
|
|
this.$buefy.snackbar.open({message:this.$t('errors.authFail'), type: 'is-warning'})
|
2021-01-16 15:33:33 +11:00
|
|
|
this.loading = false
|
2021-01-18 00:05:28 +11:00
|
|
|
console.log(this.getBannerId())
|
2021-01-16 15:33:33 +11:00
|
|
|
})
|
2021-01-28 19:25:45 +11:00
|
|
|
this.$nextTick(() => {
|
|
|
|
this.dailyReward(false)
|
|
|
|
this.showUpdate()
|
2021-01-19 03:00:49 +11:00
|
|
|
this.axios.get(process.env.VUE_APP_APIENDPOINT + process.env.VUE_APP_APIVERSION + '/' + 'relationships/getAllPendingCanAccept')
|
|
|
|
.then(res => {
|
|
|
|
this.friendCount = res.data.count
|
2021-01-28 19:25:45 +11:00
|
|
|
})
|
|
|
|
})
|
2021-01-15 23:24:15 +11:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|