-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstatus.js
49 lines (44 loc) · 1.71 KB
/
status.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
function displayStatus() {
document.getElementById("maincontent").replaceChildren(prepWindow())
document.getElementById("heading").innerText = "Current Mindmachine Status"
document.getElementById("content").replaceChildren(loadingSign())
waitForStatusReady(function () {
rewriteURL("status")
document.getElementById("content").replaceChildren(renderStatus())
})
}
var statusready = false
function waitForStatusReady(callback) {
var interval = setInterval(function() {
if (statusready) {
clearInterval(interval);
callback();
}
}, 200);
}
function renderStatus() {
deets = document.createElement("div")
deets.className = "content"
deets.appendChild(createElement("Bitcoin Block Height", currentStatus.Height))
deets.appendChild(createElement("Total Shares in Stackerstan", currentStatus.Shares))
deets.appendChild(createElement("Number of Shareholders", currentStatus.Shareholders))
deets.appendChild(createElement("Total Votepower in Stackerstan", currentStatus.Votepower))
deets.appendChild(createElement("Number of Participants", currentStatus.Participants))
deets.appendChild(createElement("Number of Maintainers", currentStatus.Maintainers))
deets.appendChild(createElement("Latest OP_RETURN State", currentStatus.OpReturn))
return deets
}
function loadingSign() {
d = document.createElement("div")
d.className = "content"
deets = document.createElement("progress")
deets.className = "progress is-large is-info"
deets.max = 100
deets.innerText = "60%"
i = document.createElement("img")
i.src = "icon.png"
d.appendChild(deets)
d.appendChild(i)
d.style.width = "75%"
return d
}