started a simple board plugin
This commit is contained in:
parent
b45bb94375
commit
2289171b0f
10 changed files with 105 additions and 27 deletions
|
@ -2,8 +2,8 @@
|
|||
"general" : {
|
||||
"dev_mode" : true,
|
||||
"display_header" : false,
|
||||
"minimum_block_pow": 4,
|
||||
"minimum_send_pow": 4,
|
||||
"minimum_block_pow": 3,
|
||||
"minimum_send_pow": 3,
|
||||
"socket_servers": false,
|
||||
"security_level": 0,
|
||||
"max_block_age": 2678400,
|
||||
|
@ -69,7 +69,7 @@
|
|||
},
|
||||
|
||||
"allocations" : {
|
||||
"disk" : 2000,
|
||||
"disk" : 100000000,
|
||||
"net_total" : 1000000000,
|
||||
"blockCache" : 5000000,
|
||||
"blockCacheTotal" : 50000000
|
||||
|
|
32
onionr/static-data/www/board/board.js
Normal file
32
onionr/static-data/www/board/board.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
webpassword = ''
|
||||
requested = {}
|
||||
document.getElementById('feed').innerText = 'none :)'
|
||||
|
||||
function httpGet(theUrl) {
|
||||
var xmlHttp = new XMLHttpRequest()
|
||||
xmlHttp.open( "GET", theUrl, false ) // false for synchronous request
|
||||
xmlHttp.setRequestHeader('token', webpassword)
|
||||
xmlHttp.send( null )
|
||||
return xmlHttp.responseText
|
||||
}
|
||||
function appendMessages(msg){
|
||||
document.getElementById('feed').append(msg)
|
||||
document.getElementById('feed').appendChild(document.createElement('br'))
|
||||
}
|
||||
|
||||
function getBlocks(){
|
||||
var feedText = httpGet('/getblocksbytype/txt')
|
||||
var blockList = feedText.split(',')
|
||||
for (i = 0; i < blockList.length; i++){
|
||||
bl = httpGet('/gethtmlsafeblockdata/' + blockList[i])
|
||||
appendMessages(bl)
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById('webpassword').oninput = function(){
|
||||
webpassword = document.getElementById('webpassword').value
|
||||
}
|
||||
|
||||
document.getElementById('refreshFeed').onclick = function(){
|
||||
getBlocks()
|
||||
}
|
16
onionr/static-data/www/board/index.html
Normal file
16
onionr/static-data/www/board/index.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset='utf-8'>
|
||||
<title>
|
||||
OnionrBoard
|
||||
</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Onionr Board</h1>
|
||||
<input id='webpassword' type='password' placeholder="Web password for daemon">
|
||||
<input type='button' id='refreshFeed' value='Refresh Feed'>
|
||||
<div id='feed'></div>
|
||||
<script src='board.js'></script>
|
||||
</body>
|
||||
</html>
|
0
onionr/static-data/www/board/theme.css
Normal file
0
onionr/static-data/www/board/theme.css
Normal file
Loading…
Add table
Add a link
Reference in a new issue