Add LndHub db/models, and quick stats for admin views

This commit is contained in:
Râu Cao
2023-02-10 13:12:36 +08:00
parent 09d99ce9c2
commit dd482d7f2e
23 changed files with 282 additions and 37 deletions

View File

@@ -10,21 +10,40 @@ default: &default
timeout: 5000
development:
<<: *default
database: db/development.sqlite3
primary:
<<: *default
database: db/development.sqlite3
# lndhub:
# <<: *default
# database: db/lndhub.sqlite3
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
database: db/test.sqlite3
primary:
<<: *default
database: db/test.sqlite3
lndhub:
<<: *default
database_tasks: false
database: db/test.lndhub.sqlite3
production:
<<: *default
adapter: postgresql
database: akkounts
port: 5432
host: <%= Rails.application.credentials.postgres[:host] rescue nil %>
username: <%= Rails.application.credentials.postgres[:username] rescue nil %>
password: <%= Rails.application.credentials.postgres[:password] rescue nil %>
primary:
<<: *default
adapter: postgresql
database: akkounts
port: 5432
host: <%= Rails.application.credentials.postgres[:host] rescue nil %>
username: <%= Rails.application.credentials.postgres[:username] rescue nil %>
password: <%= Rails.application.credentials.postgres[:password] rescue nil %>
lndhub:
<<: *default
adapter: postgresql
database_tasks: false
database: lndhub
port: 5432
host: <%= Rails.application.credentials.postgres[:host] rescue nil %>
username: <%= Rails.application.credentials.postgres[:username] rescue nil %>
password: <%= Rails.application.credentials.postgres[:password] rescue nil %>

View File

@@ -39,9 +39,10 @@ Rails.application.routes.draw do
namespace :admin do
root to: 'dashboard#index'
get 'invitations', to: 'invitations#index'
get 'ldap_users', to: 'ldap_users#index'
get 'invitations', to: 'invitations#index'
resources :donations
get 'lightning', to: 'lightning#index'
end
authenticate :user, ->(user) { user.is_admin? } do