lndg/gui/templates/fee_rates.html
2023-06-09 11:38:09 -04:00

90 lines
No EOL
5.4 KiB
HTML

{% extends "base.html" %}
{% block title %} {{ block.super }} - Fee Rates{% endblock %}
{% block content %}
{% load humanize %}
{% if channels %}
<div class="w3-container w3-padding-small">
<h2>Suggested Fee Rates</h2>
<div class="w3-container w3-padding-small" style="overflow-x: scroll">
<table id="feeTable" class="w3-table-all w3-centered w3-hoverable">
<tr>
<th onclick="sortTable(event.target, 0, 'String', 0, 'a')">Channel ID</th>
<th onclick="sortTable(event.target, 1, 'String', 0, 'a')">Peer Alias</th>
<th onclick="sortTable(event.target, 2, 'int')">Outbound Liquidity</th>
<th onclick="sortTable(event.target, 3, 'int', 0, 'label')" width=10%>Capacity</th>
<th onclick="sortTable(event.target, 4, 'int')">Inbound Liquidity</th>
<th onclick="sortTable(event.target, 5, 'int')" title="The value represents net flow --> (routed out - routed in) / capacity">7Day Flow</th>
<th onclick="sortTable(event.target, 9, 'int')">Adjustment</th>
<th onclick="sortTable(event.target, 10, 'int')" title="A suggested fee rate based on the flow pattern over the last 7 days">Suggested Rate</th>
<th>oRate</th>
<th onclick="sortTable(event.target, 12, 'int')">oBase</th>
<th onclick="sortTable(event.target, 13, '%')">Max Cost</th>
<th onclick="sortTable(event.target, 14, 'int')">iRate</th>
<th onclick="sortTable(event.target, 15, 'int')">iBase</th>
<th>Updated</th>
<th width=92px>
<form title="Enable all channels" style="position: absolute;" action="/update_setting/" method="post">
{% csrf_token %}
<input type="submit" value="✅">
<input type="hidden" name="key" value="ALL-AF">
<input type="hidden" name="value" value="1">
</form>
<form title="Disable all channels" style="position: absolute;margin-left:40px" action="/update_setting/" method="post">
{% csrf_token %}
<input type="submit" value="❌">
<input type="hidden" name="key" value="ALL-AF">
<input type="hidden" name="value" value="0">
</form>
</th>
</tr>
{% for channel in channels %}
<tr>
<td title="{{ channel.funding_txid }}:{{ channel.output_index }}"><a href="/channel?={{ channel.chan_id }}" target="_blank">{{ channel.short_chan_id }}</a></td>
<td title="{{ channel.remote_pubkey }}">{% if channel.private == False %}<a href="{{ graph_links }}/{{ network }}node/{{ channel.remote_pubkey }}" target="_blank">{% endif %}{% if channel.alias == '' %}{{ channel.remote_pubkey|slice:":12" }}{% else %}{{ channel.alias }}{% endif %}{% if channel.private == False %}</a>{% endif %}</td>
<td>{{ channel.local_balance|intcomma }} <small class="w3-round w3-border-small w3-border-grey">{{ channel.out_percent }}%</small></td>
<td>
<label>{{channel.capacity|intcomma}}</label>
<div class="progress w3-round w3-grey">
<span class="value w3-round w3-blue" style="width:{{channel.out_percent|default:"0"}}%"></span>
</div>
</td>
<td>{{ channel.remote_balance|intcomma }} <small class="w3-round w3-border-small w3-border-grey">{{ channel.in_percent }}%</small></td>
<td>{% if channel.net_routed_7day != 0 %}{{ channel.net_routed_7day }} <small class="w3-round w3-border-small w3-border-grey">{% if channel.net_routed_7day > 0 %}OUT{% else %}IN{% endif %}</small>{% else %}0{% endif %}</td>
<td>{{ channel.adjustment }}</td>
<td>{{ channel.new_rate|intcomma }}</td>
<td>
<form action="/update_channel/" method="post">
{% csrf_token %}
<input style="text-align:center" id="target" type="number" min="0" max="100000" name="target" value="{{ channel.local_fee_rate }}">
<input type="hidden" name="chan_id" value="{{ channel.chan_id }}">
<input type="hidden" name="update_target" value="1">
</form>
</td>
<td>{{ channel.local_base_fee|intcomma }}</td>
<td {% if channel.auto_rebalance == True %}style="background-color: rgba(56,139,253,0.15)"{% endif %}>{{ channel.ar_max_cost }}%</td>
<td>{{ channel.remote_fee_rate|intcomma }}</td>
<td>{{ channel.remote_base_fee|intcomma }}</td>
<td {% if channel.eligible == True %}style="background-color: rgba(248,81,73,0.15);"{% else %}style="background-color: rgba(56,139,253,0.15)"{% endif %}>{{ channel.fees_updated|naturaltime }}</td>
<td {% if channel.auto_fees == False %}style="background-color: rgba(248,81,73,0.15);"{% else %}style="background-color: rgba(56,139,253,0.15)"{% endif %}>
<form action="/update_channel/" method="post">
{% csrf_token %}
<input type="submit" value="{% if channel.auto_fees == True %}Disable{% else %}Enable{% endif %}">
<input type="hidden" name="chan_id" value="{{ channel.chan_id }}">
<input type="hidden" name="update_target" value="8">
<input type="hidden" name="target" value="0">
</form>
</td>
</tr>
{% endfor %}
</table>
</div>
</div>
{% else %}
<div class="w3-container w3-padding-small">
<center><h1>You dont have any channels to analyze yet!</h1></center>
</div>
{% endif %}
{% if local_settings %}
{% include 'local_settings.html' with settings=local_settings title='Auto-Fees' postURL='update_setting' %}
{% endif %}
{% endblock %}