This commit is contained in:
ncoelho 2021-02-17 15:22:57 +01:00 committed by Overtorment
parent 7df309771e
commit 989b195ba5
2 changed files with 5 additions and 3 deletions

View File

@ -26,11 +26,13 @@ function updateLightning() {
lightningListChannels = response;
let channels = [];
for (let channel of lightningListChannels.channels) {
let divider = 0.1;
let divider = 0.01;
let max = 100;
let ascii_length1 = channel.local_balance * divider;
let ascii_length2 = channel.remote_balance * divider;
channel.local = (Math.round(ascii_length1));
channel.remote = (Math.round(ascii_length2));
channel.remote = (max - (Math.round(ascii_length2)));
channel.total = ((channel.local) +(channel.remote);
channel.capacity_btc = channel.capacity / 100000000;
channel.name = pubkey2name[channel.remote_pubkey];
if (channel.name) {

View File

@ -106,7 +106,7 @@
{{/name}}
<span class="amount">{{capacity_btc}} BTC</span>
</div>
<div class="graph"><progress id="progressbar" class="" value="{{local}}" max="100-{{remote}}" style="width:{{local}}+{{remote}}%"></progress></div>
<div class="graph"><progress id="progressbar" class="" value="{{local}}" max="{{remote}}" style="width:{{total}}%"></progress></div>
{{^active}}
<div class="status"><span class="label right" title="inactive"></span></div>
{{/active}}