Class: PgBouncerHero::DatabaseController

Inherits:
ApplicationController show all
Defined in:
app/controllers/pg_bouncer_hero/database_controller.rb

Instance Method Summary collapse

Instance Method Details

#clientsObject



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

#confObject



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

#databasesObject



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

#poolsObject



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

#reloadObject



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

#shutdownObject



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

#statsObject



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

#summaryObject



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

#suspendObject



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