mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-18 07:38:29 +00:00
Update meta files.
This commit is contained in:
@@ -26,11 +26,7 @@
|
||||
<main-account />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
<main-account-list/>
|
||||
</div>
|
||||
</div>
|
||||
<main-account-list/>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
|
||||
|
||||
@@ -40,7 +40,6 @@
|
||||
this.chartData = DataConverter.methods.convertChart(response.data);
|
||||
this.chartData = DataConverter.methods.colorizeData(this.chartData);
|
||||
this.chartData = DataConverter.methods.convertLabelsToDate(this.chartData);
|
||||
console.log(this.chartData);
|
||||
this.loaded = true
|
||||
});
|
||||
},
|
||||
|
||||
@@ -1,19 +1,69 @@
|
||||
<template>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">I am a card</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p>
|
||||
I am card body
|
||||
</p>
|
||||
<div class="row">
|
||||
<div v-bind:class="{ 'col-lg-12': 1 === accounts.length, 'col-lg-6': 2 === accounts.length, 'col-lg-4': accounts.length > 2 }"
|
||||
v-for="account in accounts">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><a :href="account.uri">{{ account.title }}</a></h3>
|
||||
</div>
|
||||
<div class="card-body table-responsive p-0">
|
||||
<transaction-list-large :transactions="account.transactions" v-if="1===accounts.length" />
|
||||
<transaction-list-medium :transactions="account.transactions" v-if="2===accounts.length" />
|
||||
<transaction-list-small :transactions="account.transactions" v-if="accounts.length > 2" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "MainAccountList"
|
||||
name: "MainAccountList",
|
||||
data() {
|
||||
return {
|
||||
accounts: [],
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
axios.get('./api/v1/preferences/frontpageAccounts')
|
||||
.then(response => {
|
||||
this.loadAccounts(response);
|
||||
}
|
||||
);
|
||||
},
|
||||
methods:
|
||||
{
|
||||
loadAccounts(response) {
|
||||
let accountIds = response.data.data.attributes.data;
|
||||
for (let key in accountIds) {
|
||||
if (accountIds.hasOwnProperty(key) && /^0$|^[1-9]\d*$/.test(key) && key <= 4294967294) {
|
||||
this.accounts.push({
|
||||
id: accountIds[key],
|
||||
title: '',
|
||||
uri: '',
|
||||
transactions: []
|
||||
});
|
||||
this.loadSingleAccount(key, accountIds[key]);
|
||||
}
|
||||
}
|
||||
},
|
||||
loadSingleAccount(key, accountId) {
|
||||
axios.get('./api/v1/accounts/' + accountId)
|
||||
.then(response => {
|
||||
this.accounts[key].title = response.data.data.attributes.name;
|
||||
this.accounts[key].uri = './accounts/show/' + response.data.data.id;
|
||||
this.loadTransactions(key, accountId);
|
||||
}
|
||||
);
|
||||
},
|
||||
loadTransactions(key, accountId) {
|
||||
axios.get('./api/v1/accounts/' + accountId + '/transactions?page=1&limit=10')
|
||||
.then(response => {
|
||||
this.accounts[key].transactions = response.data.data;
|
||||
}
|
||||
);
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<template>
|
||||
<div>
|
||||
Hello
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "SingleTransactionRow"
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,13 @@
|
||||
<template>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "SmallTransactionList"
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,13 @@
|
||||
<template>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "TransactionListLarge"
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,13 @@
|
||||
<template>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "TransactionListMedium"
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,40 @@
|
||||
<template>
|
||||
<table class="table table-striped">
|
||||
<tr v-for="transaction in transactions">
|
||||
<td>
|
||||
<a href="#">
|
||||
<span v-if="transaction.attributes.transactions.length > 1">{{ transaction.attributes.group_title }}</span>
|
||||
<span v-if="1===transaction.attributes.transactions.length">{{ transaction.attributes.transactions[0].description }}</span>
|
||||
</a>
|
||||
</td>
|
||||
<td style="text-align:right;">
|
||||
<span v-for="tr in transaction.attributes.transactions">
|
||||
<span v-if="'withdrawal' === tr.type" class="text-danger">
|
||||
{{ Intl.NumberFormat('en-US', {style: 'currency', currency: tr.currency_code}).format(tr.amount * -1)}}<br>
|
||||
</span>
|
||||
<span v-if="'deposit' === tr.type" class="text-success">
|
||||
{{ Intl.NumberFormat('en-US', {style: 'currency', currency: tr.currency_code}).format(tr.amount)}}<br>
|
||||
</span>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "TransactionListSmall",
|
||||
props: {
|
||||
transactions: {
|
||||
type: Array,
|
||||
default: function () {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user