Class: PgBouncerHero::DatabaseController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- PgBouncerHero::DatabaseController
- Defined in:
- app/controllers/pg_bouncer_hero/database_controller.rb
Instance Method Summary collapse
- #clients ⇒ Object
- #conf ⇒ Object
- #databases ⇒ Object
- #pools ⇒ Object
- #reload ⇒ Object
- #shutdown ⇒ Object
- #stats ⇒ Object
- #summary ⇒ Object
- #suspend ⇒ Object
Instance Method Details
#clients ⇒ Object
33 34 35 36 37 38 39 |
# File 'app/controllers/pg_bouncer_hero/database_controller.rb', line 33 def clients if @database.connection @clients = @database.clients else flash[:error] = "#{@database.name} does not look online." end end |
#conf ⇒ Object
40 41 42 43 44 45 46 |
# File 'app/controllers/pg_bouncer_hero/database_controller.rb', line 40 def conf if @database.connection @conf = @database.conf else flash[:error] = "#{@database.name} does not look online." end end |
#databases ⇒ Object
12 13 14 15 16 17 18 |
# File 'app/controllers/pg_bouncer_hero/database_controller.rb', line 12 def databases if @database.connection @dbs = @database.databases else flash[:error] = "#{@database.name} does not look online." end end |
#pools ⇒ Object
26 27 28 29 30 31 32 |
# File 'app/controllers/pg_bouncer_hero/database_controller.rb', line 26 def pools if @database.connection @pools = @database.pools else flash[:error] = "#{@database.name} does not look online." end end |
#reload ⇒ Object
47 48 49 50 51 52 53 54 |
# File 'app/controllers/pg_bouncer_hero/database_controller.rb', line 47 def reload if @database.connection @database.reload flash[:success] = "#{@database.name} has been reloaded." else flash[:error] = "#{@database.name} does not look online." end end |
#shutdown ⇒ Object
63 64 65 66 67 68 69 70 |
# File 'app/controllers/pg_bouncer_hero/database_controller.rb', line 63 def shutdown if @database.connection @database.shutdown flash[:success] = "#{@database.name} has been shutdown." else flash[:error] = "#{@database.name} does not look online." end end |
#stats ⇒ Object
19 20 21 22 23 24 25 |
# File 'app/controllers/pg_bouncer_hero/database_controller.rb', line 19 def stats if @database.connection @stats = @database.stats else flash[:error] = "#{@database.name} does not look online." end end |
#summary ⇒ Object
5 6 7 8 9 10 11 |
# File 'app/controllers/pg_bouncer_hero/database_controller.rb', line 5 def summary if @database.connection @dbs = @database.summary else flash[:error] = "#{@database.name} does not look online." end end |
#suspend ⇒ Object
55 56 57 58 59 60 61 62 |
# File 'app/controllers/pg_bouncer_hero/database_controller.rb', line 55 def suspend if @database.connection @database.suspend flash[:success] = "#{@database.name} has been suspended." else flash[:error] = "#{@database.name} does not look online." end end |