Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/Dashboard.vue
Show All 36 Lines | <div class="container" dusk="dashboard-component"> | ||||
<span class="badge bg-primary">{{ $t('dashboard.beta') }}</span> | <span class="badge bg-primary">{{ $t('dashboard.beta') }}</span> | ||||
</router-link> | </router-link> | ||||
<router-link v-if="status.enableSettings" class="card link-settings" :to="{ name: 'settings' }"> | <router-link v-if="status.enableSettings" class="card link-settings" :to="{ name: 'settings' }"> | ||||
<svg-icon icon="sliders"></svg-icon><span>{{ $t('dashboard.settings') }}</span> | <svg-icon icon="sliders"></svg-icon><span>{{ $t('dashboard.settings') }}</span> | ||||
</router-link> | </router-link> | ||||
<a v-if="webmailURL" class="card link-webmail" :href="webmailURL"> | <a v-if="webmailURL" class="card link-webmail" :href="webmailURL"> | ||||
<svg-icon icon="envelope"></svg-icon><span>{{ $t('dashboard.webmail') }}</span> | <svg-icon icon="envelope"></svg-icon><span>{{ $t('dashboard.webmail') }}</span> | ||||
</a> | </a> | ||||
<router-link v-if="status.enableCompanionapps" class="card link-companionapp" :to="{ name: 'companion' }"> | <router-link v-if="status.enableCompanionapps" class="card link-companionapp" :to="{ name: 'companions' }"> | ||||
<svg-icon icon="mobile-screen"></svg-icon><span>{{ $t('dashboard.companion') }}</span> | <svg-icon icon="mobile-screen"></svg-icon><span>{{ $t('dashboard.companion') }}</span> | ||||
<span class="badge bg-primary">{{ $t('dashboard.beta') }}</span> | <span class="badge bg-primary">{{ $t('dashboard.beta') }}</span> | ||||
</router-link> | </router-link> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</template> | </template> | ||||
<script> | <script> | ||||
Show All 25 Lines | export default { | ||||
return { | return { | ||||
status: {}, | status: {}, | ||||
balance: 0, | balance: 0, | ||||
currency: '', | currency: '', | ||||
webmailURL: window.config['app.webmail_url'] | webmailURL: window.config['app.webmail_url'] | ||||
} | } | ||||
}, | }, | ||||
mounted() { | mounted() { | ||||
/* if (!this.$root.authInfo) { */ | |||||
/* //TODO redirect */ | |||||
/* /1* next({name: 'Login'}); *1/ */ | |||||
/* } else { */ | |||||
this.status = this.$root.authInfo.statusInfo | this.status = this.$root.authInfo.statusInfo | ||||
this.getBalance(this.$root.authInfo) | this.getBalance(this.$root.authInfo) | ||||
/* } */ | |||||
}, | }, | ||||
methods: { | methods: { | ||||
getBalance(authInfo) { | getBalance(authInfo) { | ||||
this.balance = 0; | this.balance = 0; | ||||
// TODO: currencies, multi-wallets, accounts | // TODO: currencies, multi-wallets, accounts | ||||
authInfo.wallets.forEach(wallet => { | authInfo.wallets.forEach(wallet => { | ||||
this.balance += wallet.balance | this.balance += wallet.balance | ||||
this.currency = wallet.currency | this.currency = wallet.currency | ||||
Show All 9 Lines |