mirror of
https://github.com/Expand-sys/ccashfrontend
synced 2025-12-18 23:52:14 +11:00
patch for users with no logs
This commit is contained in:
parent
80c487ba39
commit
6d2559d2e4
2 changed files with 48 additions and 39 deletions
28
index.js
28
index.js
|
|
@ -155,13 +155,15 @@ fastify.get(
|
||||||
Accept: "application/json",
|
Accept: "application/json",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
console.log(log.body)
|
|
||||||
let transactionlog = []
|
let transactionlog = []
|
||||||
let currentbal = balance;
|
let currentbal = balance;
|
||||||
log = JSON.parse(log.body);
|
log = JSON.parse(log.body);
|
||||||
let graphlog = log.reverse();
|
|
||||||
let graphdata = []
|
|
||||||
let final = []
|
let final = []
|
||||||
|
let final2 = [];
|
||||||
|
|
||||||
|
if(log != null){
|
||||||
|
let graphlog = log.reverse();
|
||||||
|
|
||||||
|
|
||||||
console.log(graphlog)
|
console.log(graphlog)
|
||||||
console.log(`the previous thing should be a array`)
|
console.log(`the previous thing should be a array`)
|
||||||
|
|
@ -170,22 +172,27 @@ fastify.get(
|
||||||
for(let i = 0; i < 16; i++) {
|
for(let i = 0; i < 16; i++) {
|
||||||
console.log(`itshiptobeesfuck`)
|
console.log(`itshiptobeesfuck`)
|
||||||
console.log(graphlog[i].amount)
|
console.log(graphlog[i].amount)
|
||||||
|
let thingy
|
||||||
|
if(graphlog[i].amount >0 ){
|
||||||
|
thingy = parseInt(final[i]) + parseInt(graphlog[i].amount)
|
||||||
|
} else {
|
||||||
|
thingy = parseInt(final[i]) - parseInt(graphlog[i].amount)
|
||||||
|
|
||||||
let thingy = parseInt(final[i]) + parseInt(graphlog[i].amount)
|
}
|
||||||
final.push(`${thingy}`)
|
|
||||||
|
final.push(Math.abs(thingy))
|
||||||
}
|
}
|
||||||
console.log(`here`)
|
console.log(`here`)
|
||||||
console.log(`${final}`)
|
console.log(`${final}`)
|
||||||
final = final.reverse()
|
final = final.reverse()
|
||||||
final.unshift(balance)
|
final.unshift(balance)
|
||||||
let final2 = [];
|
|
||||||
for(let i=0;i<final.length;i++){
|
for(let i=0;i<final.length;i++){
|
||||||
final2.push([i, final[i]])
|
final2.push([i, final[i]])
|
||||||
}
|
}
|
||||||
final2.unshift(["Transaction", "Amount"])
|
final2.unshift(["Transaction", "Amount"])
|
||||||
|
|
||||||
|
|
||||||
for(i = 0; i < 15; i++){
|
for(i = 0; i < log.length; i++){
|
||||||
|
|
||||||
|
|
||||||
if(log[i].amount > 0){
|
if(log[i].amount > 0){
|
||||||
|
|
@ -200,14 +207,15 @@ fastify.get(
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(final)
|
}
|
||||||
|
|
||||||
|
|
||||||
console.log("begin render " + Date.now());
|
console.log("begin render " + Date.now());
|
||||||
|
|
||||||
let maxgraph = balance + 1000;
|
let maxgraph = balance + 1000;
|
||||||
stringgraphdata = JSON.stringify(final2)
|
let stringgraphdata = JSON.stringify(final2)
|
||||||
console.log(stringgraphdata)
|
console.log(stringgraphdata)
|
||||||
graphdata = stringgraphdata.slice(1,stringgraphdata.length-1)
|
let graphdata = stringgraphdata.slice(1,stringgraphdata.length-1)
|
||||||
res.view("bankf", {
|
res.view("bankf", {
|
||||||
transactionlog: transactionlog,
|
transactionlog: transactionlog,
|
||||||
maxgraph: maxgraph,
|
maxgraph: maxgraph,
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@ block content
|
||||||
p #{i}
|
p #{i}
|
||||||
|
|
||||||
#balhistory.tab-pane(role='tabpanel', aria-labelledby='balhistory-tab')
|
#balhistory.tab-pane(role='tabpanel', aria-labelledby='balhistory-tab')
|
||||||
|
p Balance histroy is currently broken and we know this, please do not contact us about it, it is getting fixed
|
||||||
#chart_div(style="width:100%; height 100%")
|
#chart_div(style="width:100%; height 100%")
|
||||||
|
|
||||||
script(type='text/javascript' src='https://www.gstatic.com/charts/loader.js')
|
script(type='text/javascript' src='https://www.gstatic.com/charts/loader.js')
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue