From 2fde909d86437c6dc1ca92586c343bf50fc30ce1 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Mon, 15 Apr 2019 18:48:11 -0500 Subject: [PATCH] bug fixes and ui appearance improvements --- docs/http-api.md | 5 ++++- .../default-plugins/clandestine/peerserver.py | 4 +--- onionr/static-data/www/mail/mail.js | 11 ----------- onionr/static-data/www/private/index.html | 18 +++++++++++------- onionr/static-data/www/shared/main/style.css | 2 +- onionr/static-data/www/shared/misc.js | 12 ++++++++++++ 6 files changed, 29 insertions(+), 23 deletions(-) diff --git a/docs/http-api.md b/docs/http-api.md index d2ee56a5..2fe1728d 100755 --- a/docs/http-api.md +++ b/docs/http-api.md @@ -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 \ No newline at end of file +# Direct Connection API + +These are constant endpoints available on direct connection servers. Plugin endpoints for direct connections are not documented here. + diff --git a/onionr/static-data/default-plugins/clandestine/peerserver.py b/onionr/static-data/default-plugins/clandestine/peerserver.py index 64e4eaeb..5fe92fe9 100644 --- a/onionr/static-data/default-plugins/clandestine/peerserver.py +++ b/onionr/static-data/default-plugins/clandestine/peerserver.py @@ -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') diff --git a/onionr/static-data/www/mail/mail.js b/onionr/static-data/www/mail/mail.js index 06cb080a..cdc013e1 100644 --- a/onionr/static-data/www/mail/mail.js +++ b/onionr/static-data/www/mail/mail.js @@ -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' } diff --git a/onionr/static-data/www/private/index.html b/onionr/static-data/www/private/index.html index 8d35f070..b1e50e12 100644 --- a/onionr/static-data/www/private/index.html +++ b/onionr/static-data/www/private/index.html @@ -19,17 +19,21 @@ Onionr Web Control Panel

- +
🕵️‍♂️ Current Used Identity:
+
+

- +

Onionr Services

+


Mail - Friend Manager +


Stats

-

Uptime:

-

Last Received Connection: Unknown

-

Stored Blocks:

-

Blocks in queue:

-

Connected nodes:

+

🕰️ Uptime:

+

🖇️ Last Received Connection: Unknown

+

💾 Stored Blocks:

+

📨 Blocks in queue:

+

🔗 Outgoing Connections:


         
         
diff --git a/onionr/static-data/www/shared/main/style.css b/onionr/static-data/www/shared/main/style.css
index 90d4af13..a673ea7b 100644
--- a/onionr/static-data/www/shared/main/style.css
+++ b/onionr/static-data/www/shared/main/style.css
@@ -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;
diff --git a/onionr/static-data/www/shared/misc.js b/onionr/static-data/www/shared/misc.js
index 3c960c8f..eeaddf71 100644
--- a/onionr/static-data/www/shared/misc.js
+++ b/onionr/static-data/www/shared/misc.js
@@ -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
+    }
 }
\ No newline at end of file