Add LndHub db/models, and quick stats for admin views
This commit is contained in:
12
app/controllers/admin/lightning_controller.rb
Normal file
12
app/controllers/admin/lightning_controller.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
class Admin::LightningController < Admin::BaseController
|
||||
def index
|
||||
@current_section = :lightning
|
||||
|
||||
@users = User.pluck(:cn, :ou, :ln_account)
|
||||
@accounts = LndhubAccount.with_balances.order(balance: :desc).to_a
|
||||
|
||||
@ln = {}
|
||||
@ln[:current_balance] = LndhubAccount.current.joins(:ledgers).sum("account_ledgers.amount")
|
||||
@ln[:users_with_sats] = @accounts.length
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user