-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6b1c810
commit d3f20ed
Showing
17 changed files
with
471 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# Generated by Django 3.2.7 on 2022-01-26 21:13 | ||
|
||
from django.db import migrations, models | ||
import django.utils.timezone | ||
|
||
def update_defaults(apps, schedma_editor): | ||
channels = apps.get_model('gui', 'channels') | ||
settings = apps.get_model('gui', 'localsettings') | ||
try: | ||
if settings.objects.filter(key='AR-MaxCost%').exists(): | ||
ar_max_cost = float(settings.objects.filter(key='AR-MaxCost%')[0].value) | ||
else: | ||
ar_max_cost = 0.75 | ||
channels.objects.all().update(ar_max_cost=ar_max_cost*100) | ||
except Exception as e: | ||
print('Migration step failed:', str(e)) | ||
|
||
def revert_defaults(apps, schedma_editor): | ||
pass | ||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('gui', '0019_auto_20220122_1009'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='channels', | ||
name='ar_max_cost', | ||
field=models.IntegerField(default=65), | ||
), | ||
migrations.AddField( | ||
model_name='channels', | ||
name='last_update', | ||
field=models.DateTimeField(default=django.utils.timezone.now), | ||
), | ||
migrations.AddField( | ||
model_name='channels', | ||
name='local_disabled', | ||
field=models.BooleanField(default=False), | ||
preserve_default=False, | ||
), | ||
migrations.AddField( | ||
model_name='channels', | ||
name='remote_disabled', | ||
field=models.BooleanField(default=False), | ||
preserve_default=False, | ||
), | ||
migrations.AddField( | ||
model_name='payments', | ||
name='cleaned', | ||
field=models.BooleanField(default=False), | ||
), | ||
migrations.AlterField( | ||
model_name='invoices', | ||
name='message', | ||
field=models.CharField(max_length=500, null=True), | ||
), | ||
migrations.RunPython(update_defaults, revert_defaults), | ||
migrations.AlterField( | ||
model_name='channels', | ||
name='ar_max_cost', | ||
field=models.IntegerField(), | ||
), | ||
migrations.AlterField( | ||
model_name='channels', | ||
name='last_update', | ||
field=models.DateTimeField(), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{% extends "base.html" %} | ||
{% block title %} {{ block.super }} - Closures{% endblock %} | ||
{% block content %} | ||
{% load humanize %} | ||
{% if closures %} | ||
<div class="w3-container w3-padding-small"> | ||
<h2>Closures</h2> | ||
<table class="w3-table-all w3-centered w3-hoverable"> | ||
<tr> | ||
<th>Channel ID</th> | ||
<th>Capacity</th> | ||
<th width=20%>Closing TXID</th> | ||
<th>Settled Balance</th> | ||
<th>Locked Balance</th> | ||
<th>Close Height</th> | ||
<th>Close Type</th> | ||
<th>Opener</th> | ||
<th>Closer</th> | ||
</tr> | ||
{% for closure in closures %} | ||
<tr> | ||
<td><a href="{{ network_links }}/{{ network }}tx/{{ closure.channel_point|slice:":-2" }}" target="_blank">{{ closure.chan_id }}</a></td> | ||
<td>{{ closure.capacity|intcomma }}</td> | ||
<td><a href="{{ network_links }}/{{ network }}tx/{{ closure.closing_tx_hash }}" target="_blank">{{ closure.closing_tx_hash }}</a></td> | ||
<td>{{ closure.settled_balance|intcomma }}</td> | ||
<td>{{ closure.time_locked_balance|intcomma }}</td> | ||
<td>{{ closure.close_height|intcomma }}</td> | ||
<td>{% if closure.close_type == 0 %}Cooperative{% elif closure.close_type == 1 %}Local Force{% elif closure.close_type == 2 %}Remote Force{% elif closure.close_type == 3 %}Breach{% elif closure.close_type == 4 %}Funding Cancelled{% elif closure.close_type == 5 %}Abandoned{% else %}{{ closure.close_type }}{% endif %}</td> | ||
<td>{% if closure.open_initiator == 0 %}Unknown{% elif closure.open_initiator == 1 %}Local{% elif closure.open_initiator == 2 %}Remote{% elif closure.open_initiator == 3 %}Both{% else %}{{ closure.open_initiator }}{% endif %}</td> | ||
<td>{% if closure.close_initiator == 0 %}Unknown{% elif closure.close_initiator == 1 %}Local{% elif closure.close_initiator == 2 %}Remote{% elif closure.close_initiator == 3 %}Both{% else %}{{ closure.close_initiator }}{% endif %}</td> | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
</div> | ||
{% endif %} | ||
{% if not closures %} | ||
<div class="w3-container w3-padding-small"> | ||
<center><h1>No channel closures found!</h1></center> | ||
</div> | ||
{% endif %} | ||
{% endblock %} |
Oops, something went wrong.