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



31
32
33
34
35
36
37
# File 'app/controllers/pg_bouncer_hero/database_controller.rb', line 31

def clients
  if @database.connection
    @clients = @database.clients
  else
    flash[:error] = "#{@database.name} does not look online."
  end
end

#confObject



38
39
40
41
42
43
44
# File 'app/controllers/pg_bouncer_hero/database_controller.rb', line 38

def conf
  if @database.connection
    @conf = @database.conf
  else
    flash[:error] = "#{@database.name} does not look online."
  end
end

#databasesObject



10
11
12
13
14
15
16
# File 'app/controllers/pg_bouncer_hero/database_controller.rb', line 10

def databases
  if @database.connection
    @dbs = @database.databases
  else
    flash[:error] = "#{@database.name} does not look online."
  end
end

#poolsObject



24
25
26
27
28
29
30
# File 'app/controllers/pg_bouncer_hero/database_controller.rb', line 24

def pools
  if @database.connection
    @pools = @database.pools
  else
    flash[:error] = "#{@database.name} does not look online."
  end
end

#reloadObject



45
46
47
48
49
50
51
52
# File 'app/controllers/pg_bouncer_hero/database_controller.rb', line 45

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



61
62
63
64
65
66
67
68
# File 'app/controllers/pg_bouncer_hero/database_controller.rb', line 61

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



17
18
19
20
21
22
23
# File 'app/controllers/pg_bouncer_hero/database_controller.rb', line 17

def stats
  if @database.connection
    @stats = @database.stats
  else
    flash[:error] = "#{@database.name} does not look online."
  end
end

#summaryObject



3
4
5
6
7
8
9
# File 'app/controllers/pg_bouncer_hero/database_controller.rb', line 3

def summary
  if @database.connection
    @dbs = @database.summary
  else
    flash[:error] = "#{@database.name} does not look online."
  end
end

#suspendObject



53
54
55
56
57
58
59
60
# File 'app/controllers/pg_bouncer_hero/database_controller.rb', line 53

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