added particles and some code for recent block listing

This commit is contained in:
Kevin 2020-06-20 05:31:51 -05:00
parent c9a6769be7
commit c81df9093d
9 changed files with 1789 additions and 30 deletions

View file

@ -1,27 +1,41 @@
var torSource = new EventSourcePolyfill('/torcircuits', {
fetch('/config/get/transports.tor', {
headers: {
"token": webpass
}
})
var displays = document.getElementsByClassName('torInfo')
for (x = 0; x < displays.length; x++){
displays[x].style.whiteSpace = 'pre'
}
torSource.onmessage = function(e){
let data = JSON.parse(e.data)
let i = 0
let displaying = true
for (x = 0; x < displays.length; x++){
let circuitCount = Object.keys(data).length
let node = Object.keys(data)[0]
if (circuitCount > 0){
displays[x].innerText = "Using " + circuitCount + " Tor circuits with " + data[node]['nodes'][0]['finger'] + " as guard.\nGuard nick: " + data[node]['nodes'][0]['nick']
}
else{
displays[x].innerText = "Using 0 Tor circuits."
}
}
}
}})
.then((resp) => resp.text()) // Transform the data into text
.then(function(resp) {
var displays = document.getElementsByClassName('torInfo')
if (resp == true){
var torSource = new EventSourcePolyfill('/torcircuits', {
headers: {
"token": webpass
}
})
displays = document.getElementsByClassName('torInfo')
for (x = 0; x < displays.length; x++){
displays[x].style.whiteSpace = 'pre'
}
torSource.onmessage = function(e){
let data = JSON.parse(e.data)
let i = 0
let displaying = true
for (x = 0; x < displays.length; x++){
let circuitCount = Object.keys(data).length
let node = Object.keys(data)[0]
if (circuitCount > 0){
displays[x].innerText = "Using " + circuitCount + " Tor circuits with " + data[node]['nodes'][0]['finger'] + " as guard.\nGuard nick: " + data[node]['nodes'][0]['nick']
}
else{
displays[x].innerText = "Using 0 Tor circuits."
}
}
}
}
else{
console.debug("No tor enabled, not getting tor stats")
displays[0].innerHTML = "<i class=\"fas fa-plug\"></i> Tor is disabled"
}
})