Skip to content

Commit

Permalink
Fixes for inactive, rebalance repeat, settings
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptosharks131 committed Dec 20, 2023
1 parent a3e3c11 commit 3d84290
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
8 changes: 3 additions & 5 deletions gui/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ <h2>Sign a Message</h2>
}
function build_active(channels, forwards_sum){
let sum = {inbound: 0, outbound: 0, unsettled: 0, earned:{d1:0, d7:0}, rOUTed:{d1:{amt:0, count:0}, d7:{amt:0, count:0} } }
if(!addTitle("Active Channels", channels)) return sum
if(!addTitle("Active Channels", channels)) return update_liq('active_', sum)

const [activeChannels, template] = [byId("active_channels"), use(detailed_ch_template)]

Expand Down Expand Up @@ -689,7 +689,7 @@ <h2>Sign a Message</h2>
}
function build_inactive(channels){
let sum = {inbound: 0, outbound: 0, unsettled: 0}
if(!addTitle("Inactive Channels", channels)) return sum
if(!addTitle("Inactive Channels", channels)) return update_liq('inactive_', sum)

const table = byId('inactive_channels'), template = use(inactive_ch_template)
table.innerHTML = null
Expand All @@ -704,9 +704,7 @@ <h2>Sign a Message</h2>
}
function update_liq(status, sum){
for (id of ['inbound', 'outbound', 'unsettled']){
const [value, total] = [sum[id], byId('total_'+id)]

byId(status+id).innerHTML = value.intcomma()
byId(status+id).innerHTML = sum[id].intcomma()
}
return sum
}
Expand Down
6 changes: 5 additions & 1 deletion gui/templates/rebalances_table.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ <h2>{% if status == 2 %}Successful{% elif status == 0 %}Pending{% elif status =
input.title="Repeat this request"
input.onclick = async function(){
const {value, fee_limit, outgoing_chan_ids, last_hop_pubkey, duration, target_alias, manual} = rebalance
const new_rebal = {value, fee_limit, outgoing_chan_ids, last_hop_pubkey, duration, target_alias, manual}
if (last_hop_pubkey.length === 0){
var new_rebal = {value, fee_limit, outgoing_chan_ids, duration, manual}
}else{
var new_rebal = {value, fee_limit, outgoing_chan_ids, last_hop_pubkey, duration, target_alias, manual}
}
const response = await POST('rebalancer', {body: new_rebal})
const table = input.parentElement.parentElement.parentElement
table.prepend(use(transformations).render(response))
Expand Down
2 changes: 1 addition & 1 deletion gui/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1744,7 +1744,7 @@ def update_settings(request):
except:
LocalSettings(key=field['id'], value=field['value']).save()
db_value = LocalSettings.objects.get(key=field['id'])
if db_value.value == value or len(str(value)) == 0:
if db_value.value == str(value) or len(str(value)) == 0:
continue
db_value.value = value
db_value.save()
Expand Down

0 comments on commit 3d84290

Please sign in to comment.