From e5fc15acc2b0b3ade87c218e8d7d3cf7fd8a1bb1 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Fri, 11 Oct 2019 04:28:43 -0500 Subject: [PATCH] lots of web ui work --- TODO.txt | 4 ++++ onionr/communicatorutils/proxypicker.py | 2 +- onionr/httpapi/friendsapi/__init__.py | 2 +- onionr/runtests/inserttest.py | 7 +++++-- onionr/serializeddata.py | 4 +++- static-data/www/board/board.js | 2 +- static-data/www/board/index.html | 4 ++-- static-data/www/chat/index.html | 2 +- static-data/www/friends/index.html | 2 +- static-data/www/mail/index.html | 2 +- static-data/www/mail/mail.css | 2 +- static-data/www/onboarding/index.html | 10 +++++----- static-data/www/onboarding/onboarding.js | 8 ++++++++ static-data/www/private/index.html | 2 +- static-data/www/private/main.css | 2 ++ static-data/www/shared/main/stats.js | 1 - 16 files changed, 37 insertions(+), 19 deletions(-) diff --git a/TODO.txt b/TODO.txt index 82941d66..93850055 100644 --- a/TODO.txt +++ b/TODO.txt @@ -8,3 +8,7 @@ * make forward secrecy compatible with multiple devices * make uptime timer be human meaningful * add way to mark key as dead +* add hashable set password for web ui +* add node online check for web ui +* add edits to circles posts +* use truncated words in mail instead of inputs diff --git a/onionr/communicatorutils/proxypicker.py b/onionr/communicatorutils/proxypicker.py index a6461b5c..c8981dae 100755 --- a/onionr/communicatorutils/proxypicker.py +++ b/onionr/communicatorutils/proxypicker.py @@ -23,4 +23,4 @@ def pick_proxy(peer_address): return 'tor' elif peer_address.endswith('.i2p'): return 'i2p' - raise ValueError("Peer address was not string ending with acceptable value") \ No newline at end of file + raise ValueError(f"Peer address was not string ending with acceptable value: {peer_address}") \ No newline at end of file diff --git a/onionr/httpapi/friendsapi/__init__.py b/onionr/httpapi/friendsapi/__init__.py index 051a5c1a..ee19c0ab 100755 --- a/onionr/httpapi/friendsapi/__init__.py +++ b/onionr/httpapi/friendsapi/__init__.py @@ -38,7 +38,7 @@ def add_friend(pubkey): @friends.route('/friends/remove/', methods=['POST']) def remove_friend(pubkey): - contactmanager.ContactManager(pubkey).setTrust(0) + contactmanager.ContactManager(pubkey).delete_contact() return redirect(request.referrer + '#' + request.form['token']) @friends.route('/friends/setinfo//', methods=['POST']) diff --git a/onionr/runtests/inserttest.py b/onionr/runtests/inserttest.py index 5d67bca3..3d52d740 100644 --- a/onionr/runtests/inserttest.py +++ b/onionr/runtests/inserttest.py @@ -4,10 +4,13 @@ import onionrblocks import logger import coredb +def _check_remote_node(testmanager): + return + def insert_bin_test(testmanager): data = os.urandom(32) b_hash = onionrblocks.insert(data, ) - + if not b_hash in coredb.blockmetadb.get_block_list(): logger.error(str(b_hash) + 'is not in bl') - raise ValueError \ No newline at end of file + raise ValueError diff --git a/onionr/serializeddata.py b/onionr/serializeddata.py index 6daac1e4..a44ca9df 100755 --- a/onionr/serializeddata.py +++ b/onionr/serializeddata.py @@ -40,8 +40,10 @@ class SerializedData: except AttributeError: time.sleep(1) comm_inst = self._too_many.get(communicator.OnionrCommunicatorDaemon, args=(self._too_many,)) + connected = [] + [connected.append(x) for x in comm_inst.onlinePeers if x not in connected] stats['uptime'] = comm_inst.getUptime() - stats['connectedNodes'] = '\n'.join(comm_inst.onlinePeers) + stats['connectedNodes'] = '\n'.join(connected) stats['blockCount'] = len(blockmetadb.get_block_list()) stats['blockQueueCount'] = len(comm_inst.blockQueue) return json.dumps(stats) diff --git a/static-data/www/board/board.js b/static-data/www/board/board.js index 516654fd..c3d7f556 100755 --- a/static-data/www/board/board.js +++ b/static-data/www/board/board.js @@ -141,7 +141,7 @@ function getBlocks(){ requested = [] // reset requested list setTimeout(function(){ if (! loadedAny && ch == document.getElementById('feedIDInput').value){ - PNotify.notice("There are no posts for " + ch + " (yet).") + PNotify.notice("There are no posts for " + ch + ". You can be the first!") } }, loadingTimeout) } diff --git a/static-data/www/board/index.html b/static-data/www/board/index.html index dc70d9a1..f90a8639 100755 --- a/static-data/www/board/index.html +++ b/static-data/www/board/index.html @@ -31,7 +31,7 @@