50 lines
1.2 KiB
HTML
50 lines
1.2 KiB
HTML
<html>
|
|
<header>
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/water.css@2/out/dark.css">
|
|
<script>
|
|
function http(method, remote, callback, body) {
|
|
var xmlhttp = new XMLHttpRequest();
|
|
xmlhttp.onreadystatechange = function() {
|
|
if (xmlhttp.readyState == XMLHttpRequest.DONE) {
|
|
callback(xmlhttp.responseText, xmlhttp.status)
|
|
}
|
|
};
|
|
xmlhttp.open(method, remote, true);
|
|
if (typeof body == "undefined") {
|
|
body = null
|
|
}
|
|
xmlhttp.send(body);
|
|
}
|
|
function callback(responseBody, responseStatus) {
|
|
}
|
|
var f = String(window.location).split("/transactions")[1]
|
|
if (!f) {
|
|
f = "./moolah.dat"
|
|
}
|
|
function init() {
|
|
load(f)
|
|
}
|
|
function load(f) {
|
|
http("GET", "/api/transactions?f="+f, (body, status) => {
|
|
var d = JSON.parse(body)
|
|
console.log(status, d)
|
|
})
|
|
}
|
|
</script>
|
|
</header>
|
|
<body onload="init();">
|
|
<h2>Moolah2</h2>
|
|
<details>
|
|
<summary>Balance</summary>
|
|
<div id="bal">
|
|
</div>
|
|
</details>
|
|
<details open>
|
|
<div id="reg">
|
|
</div>
|
|
</details>
|
|
</body>
|
|
<footer>
|
|
</footer>
|
|
</html>
|