lots of web ui work

This commit is contained in:
Kevin Froman 2019-10-11 04:28:43 -05:00
parent f0c72ef1c8
commit e5fc15acc2
16 changed files with 37 additions and 19 deletions

View File

@ -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

View File

@ -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")
raise ValueError(f"Peer address was not string ending with acceptable value: {peer_address}")

View File

@ -38,7 +38,7 @@ def add_friend(pubkey):
@friends.route('/friends/remove/<pubkey>', 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/<pubkey>/<key>', methods=['POST'])

View File

@ -4,6 +4,9 @@ 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, )

View File

@ -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)

View File

@ -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)
}

View File

@ -31,7 +31,7 @@
<nav class="navbar is-dark" role="navigation" aria-label="main navigation">
<div class="navbar-brand">
<a class="navbar-item idLink" href="/">
<img src="/shared/images/favicon.ico" class="navbarLogo"> Onionr
<img src="/shared/images/favicon.ico" class="navbarLogo">
</a>
<a role="button" class="navbar-burger burger" aria-label="menu" aria-expanded="false"
@ -141,7 +141,7 @@
</div>
</div>
<div class="content">
<span id='loadingBoard'>Loading Circle... <i class="fas fa-yin-yang fa-spin"></i></span>
<span id='loadingBoard'><i class="fas fa-yin-yang fa-spin"></i></span>
<div id='feed'>
<span id='none'>None yet, try refreshing 😃</span>
<!--Message Items are appended here based on template-->

View File

@ -25,7 +25,7 @@
<nav class="navbar is-dark" role="navigation" aria-label="main navigation">
<div class="navbar-brand">
<a class="navbar-item idLink" href="/">
<img src="/shared/images/favicon.ico" class="navabarLogo"> Onionr
<img src="/shared/images/favicon.ico" class="navabarLogo">
</a>
<a role="button" class="navbar-burger burger" aria-label="menu" aria-expanded="false"

View File

@ -23,7 +23,7 @@
<nav class="navbar is-dark" role="navigation" aria-label="main navigation">
<div class="navbar-brand">
<a class="navbar-item idLink" href="/">
<img src="/shared/images/favicon.ico" class="navbarLogo"> Onionr
<img src="/shared/images/favicon.ico" class="navbarLogo">
</a>
<a role="button" class="navbar-burger burger" aria-label="menu" aria-expanded="false"

View File

@ -26,7 +26,7 @@
<nav class="navbar is-dark" role="navigation" aria-label="main navigation">
<div class="navbar-brand">
<a class="navbar-item idLink" href="/">
<img src="/shared/images/favicon.ico" class="navbarLogo"> Onionr
<img src="/shared/images/favicon.ico" class="navbarLogo">
</a>
<a role="button" class="navbar-burger burger" aria-label="menu" aria-expanded="false"

View File

@ -81,7 +81,7 @@
<br>
<i class="icon fas fa-university"></i> <input type="checkbox" name="stateTarget"> <label for="stateTarget">Government (direct target)</label>
<br>
<i class="icon fas fa-binoculars"></i> <input type="checkbox" name="local"> <label for="local">Local area threat (LAN or physical)</label>
<i class="icon fas fa-binoculars"></i> <input type="checkbox" name="local"> <label for="local">Physically nearby threat</label>
</div>
<br>
<div class="field">
@ -91,14 +91,14 @@
<i class="icon fas fa-network-wired"></i> <input checked type="checkbox" name="networkContribution"> <label for="networkContribution">Participating in data storage & sharing</label>
<br>
<i class="icon fas fa-book-open"></i> <input checked type="checkbox" name="networkContributionPlain"> <label for="networkContributionPlain">Storing plaintext data</label>
<br>
<i class="icon fas fa-dollar-sign"></i> <input type="checkbox" name="donate"> <label for="donate">Donating the price of a coffee to fund development</label>
</div>
<div class="field">
<div>
I prefer these words...
I want to...
</div>
<select name="userIDWords">
<option value=""></option>
</select>
<i class="icon fas fa-user"></i> <input type="checkbox" name="useDeterministic"> <label for="useDeterminisitc">Use a seed to re(generate) an ID</label>
</div>
<br>
<input type="submit" value="Get Started" class="button is-primary">

View File

@ -0,0 +1,8 @@
fetch('/getnewkeys', {
headers: {
"token": webpass
}})
.then((resp) => resp.text()) // Transform the data into text
.then(function(resp) {
keys = keys.split('')
})

View File

@ -36,7 +36,7 @@
<nav class="navbar is-dark" role="navigation" aria-label="main navigation">
<div class="navbar-brand">
<a class="navbar-item idLink" href="/">
<img src="/shared/images/favicon.ico" class="navbarLogo"> Onionr
<img src="/shared/images/favicon.ico" class="navbarLogo">
</a>
<a role="button" class="navbar-burger burger" aria-label="menu" aria-expanded="false"

View File

@ -16,6 +16,8 @@
#connectedNodes{
overflow-y: auto;
max-height: 300px;
}
#configToggle, #configContent{

View File

@ -18,7 +18,6 @@
*/
uptimeDisplay = document.getElementById('uptime')
connectedDisplay = document.getElementById('connectedNodes')
connectedDisplay.style.maxHeight = '300px'
storedBlockDisplay = document.getElementById('storedBlocks')
queuedBlockDisplay = document.getElementById('blockQueue')
lastIncoming = document.getElementById('lastIncoming')