mirror of
https://github.com/Expand-sys/ccashfrontend
synced 2025-12-18 15:42: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
84
index.js
84
index.js
|
|
@ -155,59 +155,67 @@ 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 = []
|
||||||
|
|
||||||
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 = [];
|
let final2 = [];
|
||||||
for(let i=0;i<final.length;i++){
|
|
||||||
final2.push([i, final[i]])
|
|
||||||
}
|
|
||||||
final2.unshift(["Transaction", "Amount"])
|
|
||||||
|
|
||||||
|
if(log != null){
|
||||||
for(i = 0; i < 15; i++){
|
let graphlog = log.reverse();
|
||||||
|
|
||||||
|
|
||||||
if(log[i].amount > 0){
|
console.log(graphlog)
|
||||||
let absol = Math.abs(log[i].amount)
|
console.log(`the previous thing should be a array`)
|
||||||
let date = new Date(log[i].time * 1000)
|
final.push(parseInt(balance))
|
||||||
transactionlog.push(`You sent ${log[i].counterparty} ${absol} at ${date}`);
|
console.log(final)
|
||||||
|
for(let i = 0; i < 16; i++) {
|
||||||
} else {
|
console.log(`itshiptobeesfuck`)
|
||||||
let date = new Date(log[i].time * 1000)
|
console.log(graphlog[i].amount)
|
||||||
let absol = Math.abs(log[i].amount)
|
let thingy
|
||||||
transactionlog.push(`${log[i].counterparty} sent you ${absol} at ${date}`);
|
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());
|
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,
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,8 @@ block content
|
||||||
hr
|
hr
|
||||||
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