akkounts/app/views/admin/lightning/index.html.erb
2023-02-25 15:27:28 +08:00

49 lines
1.2 KiB
Plaintext

<%= render HeaderComponent.new(title: "Lightning Network") %>
<%= render MainSimpleComponent.new do %>
<section>
<%= render QuickstatsContainerComponent.new do %>
<%= render QuickstatsItemComponent.new(
type: :number,
title: 'Current user balance',
value: @ln[:current_balance],
unit: 'sats'
) %>
<%= render QuickstatsItemComponent.new(
type: :number,
title: 'Users with sats',
value: @ln[:users_with_sats],
meta: "/ #{User.count}"
) %>
<% end %>
</section>
<section>
<h3>Accounts</h3>
<table class="divided">
<thead>
<tr>
<th>LN Account</th>
<th>User</th>
<th>Balance</th>
</tr>
</thead>
<tbody>
<% @accounts.each do |account| %>
<tr>
<td class="font-mono">
<%= account.login %>
</td>
<td>
<% if user = @users.find{ |u| u[2] == account.login } %>
<%= "#{user[0]}@#{user[1]}" %>
<% end %>
</td>
<td><%= number_with_delimiter account.balance.to_i.to_s %></td>
</tr>
<% end %>
</tbody>
</table>
</section>
<% end %>