bug fixes and ui appearance improvements

master
Kevin Froman 2019-04-15 18:48:11 -05:00
parent 9ee31684f6
commit 2fde909d86
6 changed files with 29 additions and 23 deletions

View File

@ -101,4 +101,7 @@ v0
- Accepts form data for 'block' as a 'file' upload.
- Returns 200 with 'success' if no error occurs. If the block cannot be accepted, 'failure' with 400 is returned.
# Direct Connection API
# Direct Connection API
These are constant endpoints available on direct connection servers. Plugin endpoints for direct connections are not documented here.

View File

@ -45,11 +45,9 @@ def sendto():
msg = request.get_json(force=True)
except:
msg = ''
if msg == None or msg == '':
msg = json.dumps({'m': 'hello world', 't': core_inst._utils.getEpoch()})
else:
msg = json.dumps(msg)
core_inst._utils.localCommand('/clandestine/addrec/%s' % (g.peer,), post=True, postData=msg)
core_inst._utils.localCommand('/clandestine/addrec/%s' % (g.peer,), post=True, postData=msg)
return Response('success')
@direct_blueprint.route('/clandestine/poll')

View File

@ -23,7 +23,6 @@ threadPart = document.getElementById('threads')
threadPlaceholder = document.getElementById('threadPlaceholder')
tabBtns = document.getElementById('tabBtns')
threadContent = {}
myPub = httpGet('/getActivePubkey')
replyBtn = document.getElementById('replyBtn')
function openReply(bHash, quote, subject){
@ -300,16 +299,6 @@ tabBtns.onclick = function(event){
setActiveTab(event.target.innerText.toLowerCase())
}
var idStrings = document.getElementsByClassName('myPub')
for (var i = 0; i < idStrings.length; i++){
if (idStrings[i].tagName.toLowerCase() == 'input'){
idStrings[i].value = myPub
}
else{
idStrings[i].innerText = myPub
}
}
for (var i = 0; i < document.getElementsByClassName('refresh').length; i++){
document.getElementsByClassName('refresh')[i].style.float = 'right'
}

View File

@ -19,17 +19,21 @@
<img class='logo' src='/shared/onionr-icon.png' alt='onionr logo'>
<span class='logoText'>Onionr Web Control Panel</span>
<br><br>
<button id='shutdownNode'>Shutdown Node</button> <button id='refreshStats'>Refresh Stats</button>
<div>🕵️‍♂️ Current Used Identity: <input class='myPub' type='text' readonly></div>
<br>
<button id='shutdownNode' class='warnBtn'>Shutdown Node</button> <button id='refreshStats' class='primaryBtn'>Refresh Stats</button>
<br><br>
<label>Site Hash: <input type='text' id='siteViewer'> <button id='openSite' class='primaryBtn openSiteBtn'>Open Onionr Site</button></label>
<h2>Onionr Services</h2>
<label>Open Site: <input type='text' id='siteViewer' placeholder='Site Hash'> <button id='openSite' class='primaryBtn openSiteBtn'>Open Onionr Site</button></label>
<br>
<br><br><a class='idLink' href='/mail/'>Mail</a> - <a class='idLink' href='/friends/'>Friend Manager</a>
<br><br><hr>
<h2>Stats</h2>
<p>Uptime: <span id='uptime'></span></p>
<p>Last Received Connection: <span id='lastIncoming'>Unknown</span></p>
<p>Stored Blocks: <span id='storedBlocks'></span></p>
<p>Blocks in queue: <span id='blockQueue'></span></p>
<p>Connected nodes:</p>
<p>🕰️ Uptime: <span id='uptime'></span></p>
<p>🖇️ Last Received Connection: <span id='lastIncoming'>Unknown</span></p>
<p>💾 Stored Blocks: <span id='storedBlocks'></span></p>
<p>📨 Blocks in queue: <span id='blockQueue'></span></p>
<p>🔗 Outgoing Connections:</p>
<pre id='connectedNodes'></pre>
</div>
<script src='/shared/misc.js'></script>

View File

@ -152,7 +152,7 @@ body{
padding: 5px;
}
.btn, .warnBtn, .dangerBtn, .successBtn{
.btn, .warnBtn, .dangerBtn, .successBtn, .primaryBtn{
padding: 5px;
border-radius: 5px;
border: 2px solid black;

View File

@ -20,6 +20,8 @@
webpass = document.location.hash.replace('#', '')
nowebpass = false
myPub = httpGet('/getActivePubkey')
function post_to_url(path, params) {
var form = document.createElement("form")
@ -91,4 +93,14 @@ for (var i = 0; i < document.getElementsByClassName('closeOverlay').length; i++)
document.getElementsByClassName('closeOverlay')[i].onclick = function(e){
document.getElementById(e.target.getAttribute('overlay')).style.visibility = 'hidden'
}
}
var idStrings = document.getElementsByClassName('myPub')
for (var i = 0; i < idStrings.length; i++){
if (idStrings[i].tagName.toLowerCase() == 'input'){
idStrings[i].value = myPub
}
else{
idStrings[i].innerText = myPub
}
}