added particles and some code for recent block listing
This commit is contained in:
parent
c9a6769be7
commit
c81df9093d
9 changed files with 1789 additions and 30 deletions
1541
static-data/www/shared/main/particles.js
Normal file
1541
static-data/www/shared/main/particles.js
Normal file
File diff suppressed because it is too large
Load diff
110
static-data/www/shared/main/particles.json
Normal file
110
static-data/www/shared/main/particles.json
Normal file
|
@ -0,0 +1,110 @@
|
|||
{
|
||||
"particles": {
|
||||
"number": {
|
||||
"value": 10,
|
||||
"density": {
|
||||
"enable": true,
|
||||
"value_area": 800
|
||||
}
|
||||
},
|
||||
"color": {
|
||||
"value": "#ffffff"
|
||||
},
|
||||
"shape": {
|
||||
"type": "circle",
|
||||
"stroke": {
|
||||
"width": 0,
|
||||
"color": "#000000"
|
||||
},
|
||||
"polygon": {
|
||||
"nb_sides": 5
|
||||
},
|
||||
"image": {
|
||||
"src": "img/github.svg",
|
||||
"width": 100,
|
||||
"height": 100
|
||||
}
|
||||
},
|
||||
"opacity": {
|
||||
"value": 0.5,
|
||||
"random": true,
|
||||
"anim": {
|
||||
"enable": false,
|
||||
"speed": 1,
|
||||
"opacity_min": 0.1,
|
||||
"sync": false
|
||||
}
|
||||
},
|
||||
"size": {
|
||||
"value": 10,
|
||||
"random": true,
|
||||
"anim": {
|
||||
"enable": false,
|
||||
"speed": 80,
|
||||
"size_min": 0.1,
|
||||
"sync": false
|
||||
}
|
||||
},
|
||||
"line_linked": {
|
||||
"enable": true,
|
||||
"distance": 300,
|
||||
"color": "#ffffff",
|
||||
"opacity": 0.4,
|
||||
"width": 2
|
||||
},
|
||||
"move": {
|
||||
"enable": true,
|
||||
"speed": 1,
|
||||
"direction": "none",
|
||||
"random": true,
|
||||
"straight": false,
|
||||
"out_mode": "out",
|
||||
"bounce": false,
|
||||
"attract": {
|
||||
"enable": false,
|
||||
"rotateX": 600,
|
||||
"rotateY": 1200
|
||||
}
|
||||
}
|
||||
},
|
||||
"interactivity": {
|
||||
"detect_on": "canvas",
|
||||
"events": {
|
||||
"onhover": {
|
||||
"enable": false,
|
||||
"mode": "repulse"
|
||||
},
|
||||
"onclick": {
|
||||
"enable": false,
|
||||
"mode": "push"
|
||||
},
|
||||
"resize": true
|
||||
},
|
||||
"modes": {
|
||||
"grab": {
|
||||
"distance": 800,
|
||||
"line_linked": {
|
||||
"opacity": 1
|
||||
}
|
||||
},
|
||||
"bubble": {
|
||||
"distance": 800,
|
||||
"size": 80,
|
||||
"duration": 2,
|
||||
"opacity": 0.8,
|
||||
"speed": 3
|
||||
},
|
||||
"repulse": {
|
||||
"distance": 400,
|
||||
"duration": 0.4
|
||||
},
|
||||
"push": {
|
||||
"particles_nb": 4
|
||||
},
|
||||
"remove": {
|
||||
"particles_nb": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"retina_detect": true
|
||||
}
|
10
static-data/www/shared/main/recent.js
Normal file
10
static-data/www/shared/main/recent.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
var recentSource = new EventSourcePolyfill('/recentblocks', {
|
||||
headers: {
|
||||
"token": webpass
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
recentSource.onmessage = function(e){
|
||||
console.debug(e)
|
||||
}
|
|
@ -143,4 +143,10 @@ document.addEventListener("visibilitychange", function() {
|
|||
})
|
||||
|
||||
getStats()
|
||||
setInterval(function(){getStats()}, 1000)
|
||||
setInterval(function(){getStats()}, 1000)
|
||||
|
||||
|
||||
/* particlesJS.load(@dom-id, @path-json, @callback (optional)); */
|
||||
particlesJS.load('particles-js', '/shared/main/particles.json', function() {
|
||||
console.log('callback - particles.js config loaded');
|
||||
});
|
|
@ -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"
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue