mirror of
https://github.com/Expand-sys/ccashfrontend
synced 2025-12-16 23:02:13 +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
84
index.js
84
index.js
|
|
@ -155,59 +155,67 @@ fastify.get(
|
|||
Accept: "application/json",
|
||||
},
|
||||
});
|
||||
console.log(log.body)
|
||||
let transactionlog = []
|
||||
let currentbal = balance;
|
||||
log = JSON.parse(log.body);
|
||||
let graphlog = log.reverse();
|
||||
let graphdata = []
|
||||
let final = []
|
||||
|
||||
console.log(graphlog)
|
||||
console.log(`the previous thing should be a array`)
|
||||
final.push(parseInt(balance))
|
||||
console.log(final)
|
||||
for(let i = 0; i < 16; i++) {
|
||||
console.log(`itshiptobeesfuck`)
|
||||
console.log(graphlog[i].amount)
|
||||
|
||||
let thingy = parseInt(final[i]) + parseInt(graphlog[i].amount)
|
||||
final.push(`${thingy}`)
|
||||
}
|
||||
console.log(`here`)
|
||||
console.log(`${final}`)
|
||||
final = final.reverse()
|
||||
final.unshift(balance)
|
||||
let final2 = [];
|
||||
for(let i=0;i<final.length;i++){
|
||||
final2.push([i, final[i]])
|
||||
}
|
||||
final2.unshift(["Transaction", "Amount"])
|
||||
|
||||
|
||||
for(i = 0; i < 15; i++){
|
||||
if(log != null){
|
||||
let graphlog = log.reverse();
|
||||
|
||||
|
||||
if(log[i].amount > 0){
|
||||
let absol = Math.abs(log[i].amount)
|
||||
let date = new Date(log[i].time * 1000)
|
||||
transactionlog.push(`You sent ${log[i].counterparty} ${absol} at ${date}`);
|
||||
|
||||
} else {
|
||||
let date = new Date(log[i].time * 1000)
|
||||
let absol = Math.abs(log[i].amount)
|
||||
transactionlog.push(`${log[i].counterparty} sent you ${absol} at ${date}`);
|
||||
|
||||
console.log(graphlog)
|
||||
console.log(`the previous thing should be a array`)
|
||||
final.push(parseInt(balance))
|
||||
console.log(final)
|
||||
for(let i = 0; i < 16; i++) {
|
||||
console.log(`itshiptobeesfuck`)
|
||||
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)
|
||||
|
||||
}
|
||||
|
||||
final.push(Math.abs(thingy))
|
||||
}
|
||||
console.log(`here`)
|
||||
console.log(`${final}`)
|
||||
final = final.reverse()
|
||||
final.unshift(balance)
|
||||
for(let i=0;i<final.length;i++){
|
||||
final2.push([i, final[i]])
|
||||
}
|
||||
final2.unshift(["Transaction", "Amount"])
|
||||
|
||||
|
||||
for(i = 0; i < log.length; i++){
|
||||
|
||||
|
||||
if(log[i].amount > 0){
|
||||
let absol = Math.abs(log[i].amount)
|
||||
let date = new Date(log[i].time * 1000)
|
||||
transactionlog.push(`You sent ${log[i].counterparty} ${absol} at ${date}`);
|
||||
|
||||
} else {
|
||||
let date = new Date(log[i].time * 1000)
|
||||
let absol = Math.abs(log[i].amount)
|
||||
transactionlog.push(`${log[i].counterparty} sent you ${absol} at ${date}`);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log(final)
|
||||
|
||||
|
||||
console.log("begin render " + Date.now());
|
||||
|
||||
let maxgraph = balance + 1000;
|
||||
stringgraphdata = JSON.stringify(final2)
|
||||
let stringgraphdata = JSON.stringify(final2)
|
||||
console.log(stringgraphdata)
|
||||
graphdata = stringgraphdata.slice(1,stringgraphdata.length-1)
|
||||
let graphdata = stringgraphdata.slice(1,stringgraphdata.length-1)
|
||||
res.view("bankf", {
|
||||
transactionlog: transactionlog,
|
||||
maxgraph: maxgraph,
|
||||
|
|
|
|||
|
|
@ -46,7 +46,8 @@ block content
|
|||
hr
|
||||
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%")
|
||||
|
||||
script(type='text/javascript' src='https://www.gstatic.com/charts/loader.js')
|
||||
|
|
|
|||
Loading…
Reference in a new issue