Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/Dashboard.vue
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 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() { | ||||
const authInfo = this.$store.state.authInfo | this.status = this.$root.authInfo.statusInfo | ||||
this.status = authInfo.statusInfo | this.getBalance(this.$root.authInfo) | ||||
this.getBalance(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 | ||||
}) | }) | ||||
}, | }, | ||||
statusUpdate(user) { | statusUpdate(user) { | ||||
this.status = Object.assign({}, this.status, user) | this.status = Object.assign({}, this.status, user) | ||||
this.$store.state.authInfo.statusInfo = this.status | this.$root.authInfo.statusInfo = this.status | ||||
} | } | ||||
} | } | ||||
} | } | ||||
</script> | </script> |