fix add axios and example json for useroverview

This commit is contained in:
ogerly 2021-02-12 14:35:18 +01:00
parent 775851ec48
commit f35b891758
5 changed files with 205 additions and 3 deletions

View File

View File

@ -0,0 +1,19 @@
{"state":"success", "userdata":
[
{
"created": 1578688666,
"disabled": false,
"email": "dervommond@gmail.com",
"email_checked": true,
"first_name": "Max",
"group_alias": "gdd1",
"ident_hash": 2928827813,
"last_name": "Miau",
"public_hex": "2ed28a1cf5e116d83615406bc577152221c2f774a5656f66a0e7540f7576d71b",
"role": "admin",
"username": "",
"balance": 174500,
"errorCount": 0
}
]
}

View File

@ -0,0 +1,45 @@
{"state":"success", "participation":
[
{
"type": "submitted",
"participation_id": 412,
"date_submitted": "9-12-2020",
"titel": "Lorem Ipsum panta lore es Tastina sero was. ",
"text": "Lorem Ipsum panta lore es Tastina sero was. Lorem Ipsum panta lore es Tastina sero was. Lorem Ipsum panta lore es Tastina sero was. ",
"date_participation": "8-12-2020",
"plz_participation": "01099",
"pubkey": "abcdefghi123456789"
},
{
"type": "in progress",
"participation_id": 312,
"date_submitted": "2-11-2020",
"titel": "Lorem Ipsum panta lore es Tastina sero was. ",
"text": "Lorem Ipsum panta lore es Tastina sero was. Lorem Ipsum panta lore es Tastina sero was. Lorem Ipsum panta lore es Tastina sero was. ",
"date_participation": "2-11-2020",
"plz_participation": "01099",
"pubkey": "abcdefghi123456789"
},
{
"type": "confirmed",
"participation_id": 212,
"date_submitted": "20-10-2020",
"titel": "Lorem Ipsum panta lore es Tastina sero was. ",
"text": "Lorem Ipsum panta lore es Tastina sero was. Lorem Ipsum panta lore es Tastina sero was. Lorem Ipsum panta lore es Tastina sero was. ",
"date_participation": "20-10-2020",
"plz_participation": "01099",
"pubkey": "abcdefghi123456789"
},
{
"type": "rejected",
"participation_id": 142,
"date_submitted": "17-9-2020",
"titel": "Lorem Ipsum panta lore es Tastina sero was. ",
"text": "Lorem Ipsum panta lore es Tastina sero was. Lorem Ipsum panta lore es Tastina sero was. Lorem Ipsum panta lore es Tastina sero was. ",
"date_participation": "17-9-2020",
"plz_participation": "01099",
"pubkey": "abcdefghi123456789"
}
],
"count": 4
}

View File

@ -0,0 +1,61 @@
{"state":"success", "transactions":
[
{
"name": "Jon Tester",
"email": "jon@example.de",
"type": "send",
"transaction_id": 12,
"date": "29-11-2020",
"balance": 7000,
"memo": "Reperatur Waschbecken",
"pubkey": "abcdefghi123456789"
},
{
"name": "Gradido Community",
"email": "gradido@example.de",
"type": "creation",
"transaction_id": 11,
"date": "1-11-2020",
"balance": 10000,
"memo": "Müll gesammelt im Wald",
"pubkey": "abcdefghi123456789"
},
{
"name": "Maria Tester",
"email": "maria@example.de",
"type": "receive",
"transaction_id": 7,
"date": "23-10-2020",
"balance": 5000,
"memo": "Spende an Alice ",
"pubkey": "abcdefghi123456789"
},
{
"name": "Alice Tester",
"email": "alice@example.de",
"type": "receive",
"transaction_id": 5,
"date": "2-8-2020",
"balance": 1000,
"memo": "Bob hat meinen Müll getrennt",
"pubkey": "abcdefghi123456789"
},
{
"name": "Gradido Community",
"email": "gradido@example.de",
"type": "creation",
"transaction_id": 1,
"date": "11-7-2020",
"balance": 10000,
"memo": "Bob hat meinen Müll getrennt",
"pubkey": "abcdefghi123456789"
}
],
"transactionExecutingCount": 8750,
"count": 5
}

View File

@ -3,7 +3,7 @@
<base-header class="pb-6 pb-8 pt-5 pt-md-8 bg-gradient-success">
<!-- Card stats GDD User Status -->
<gdd-status />
<br>
<!-- Card sent GDD-->
@ -30,6 +30,29 @@
</div>
</base-header>
<hr>
<h3>User Data</h3>
<small>/public/json-example/userdata.json</small>
<p>
{{userdata}}
</p>
<hr>
<h3>User Transactions List</h3>
<small>/public/json-example/usertransactions.json</small>
<p>
{{usertransactions}}
</p>
<hr>
<h3>User Participation List</h3>
<small>/public/json-example/userparticipation.json</small>
<p>
{{userparticipation}}
</p>
</div>
</template>
@ -40,15 +63,69 @@
import GddTable from './KontoOverview/GddTable.vue';
import GddAddWork from './KontoOverview/GddAddWork.vue';
import GddWorkTable from './KontoOverview/GddWorkTable.vue';
import axios from 'axios';
export default {
data(){
return {
usertransactions: {},
userdata: {},
userparticipation: {}
}
},
components: {
GddStatus,
GddSent,
GddTable,
GddAddWork,
GddWorkTable
}
GddWorkTable,
axios
},
methods: {
UserData() {
axios.get("/json-example/userdata.json").then((d) => {
console.log(d);
this.userdata = d.data;
}, (error) => {
console.log(error);
});
},
UserTransactions() {
axios.get("/json-example/usertransactions.json").then((transactions) => {
console.log(transactions);
this.usertransactions = transactions.data;
}, (error) => {
console.log(error);
});
},
UserParticitions() {
axios.get("/json-example/userparticipation.json").then((participation) => {
console.log(participation);
this.userparticipation = participation.data;
}, (error) => {
console.log(error);
});
}
},
created() {
// Simple GET request using axios
// axios.get("https://api.npms.io/v2/search?q=vue").then((response) => {
// console.log(response);
// this.totalVuePackages = response.data.total;
// this.dataVuePackages = response.data;
// }, (error) => {
// console.log(error);
// });
/////////////////////////
},
mounted() {
this.UserData();
this.UserTransactions();
this.UserParticitions();
},
};
</script>