pgbus 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/pgbus/api/insights_controller.rb +5 -4
  3. data/app/controllers/pgbus/application_controller.rb +40 -0
  4. data/app/controllers/pgbus/insights_controller.rb +3 -2
  5. data/app/controllers/pgbus/locale_controller.rb +15 -0
  6. data/app/helpers/pgbus/application_helper.rb +67 -7
  7. data/app/views/layouts/pgbus/application.html.erb +50 -14
  8. data/app/views/pgbus/dashboard/_processes_table.html.erb +6 -6
  9. data/app/views/pgbus/dashboard/_queues_table.html.erb +8 -8
  10. data/app/views/pgbus/dashboard/_recent_failures.html.erb +6 -6
  11. data/app/views/pgbus/dashboard/_stats_cards.html.erb +9 -9
  12. data/app/views/pgbus/dashboard/show.html.erb +1 -1
  13. data/app/views/pgbus/dead_letter/_messages_table.html.erb +19 -19
  14. data/app/views/pgbus/dead_letter/index.html.erb +5 -5
  15. data/app/views/pgbus/dead_letter/show.html.erb +12 -12
  16. data/app/views/pgbus/events/index.html.erb +11 -11
  17. data/app/views/pgbus/events/show.html.erb +6 -6
  18. data/app/views/pgbus/insights/show.html.erb +41 -21
  19. data/app/views/pgbus/jobs/_enqueued_table.html.erb +19 -19
  20. data/app/views/pgbus/jobs/_failed_table.html.erb +11 -11
  21. data/app/views/pgbus/jobs/index.html.erb +5 -5
  22. data/app/views/pgbus/jobs/show.html.erb +13 -13
  23. data/app/views/pgbus/locks/index.html.erb +11 -11
  24. data/app/views/pgbus/outbox/index.html.erb +15 -15
  25. data/app/views/pgbus/processes/_processes_table.html.erb +7 -7
  26. data/app/views/pgbus/processes/index.html.erb +1 -1
  27. data/app/views/pgbus/queues/_queues_list.html.erb +14 -14
  28. data/app/views/pgbus/queues/index.html.erb +1 -1
  29. data/app/views/pgbus/queues/show.html.erb +11 -11
  30. data/app/views/pgbus/recurring_tasks/_tasks_table.html.erb +14 -14
  31. data/app/views/pgbus/recurring_tasks/index.html.erb +2 -2
  32. data/app/views/pgbus/recurring_tasks/show.html.erb +21 -21
  33. data/config/i18n-tasks.yml +41 -0
  34. data/config/locales/da.yml +348 -0
  35. data/config/locales/de.yml +348 -0
  36. data/config/locales/en.yml +348 -0
  37. data/config/locales/es.yml +348 -0
  38. data/config/locales/fi.yml +348 -0
  39. data/config/locales/fr.yml +348 -0
  40. data/config/locales/it.yml +348 -0
  41. data/config/locales/ja.yml +348 -0
  42. data/config/locales/nb.yml +348 -0
  43. data/config/locales/nl.yml +348 -0
  44. data/config/locales/pt.yml +348 -0
  45. data/config/locales/sv.yml +348 -0
  46. data/config/routes.rb +2 -0
  47. data/lib/pgbus/configuration.rb +8 -2
  48. data/lib/pgbus/engine.rb +4 -0
  49. data/lib/pgbus/version.rb +1 -1
  50. metadata +15 -1
@@ -63,7 +63,8 @@ module Pgbus
63
63
  attr_accessor :stats_retention, :stats_enabled
64
64
 
65
65
  # Web dashboard
66
- attr_accessor :web_auth, :web_refresh_interval, :web_per_page, :web_live_updates, :web_data_source
66
+ attr_accessor :web_auth, :web_refresh_interval, :web_per_page, :web_live_updates, :web_data_source,
67
+ :insights_default_minutes
67
68
 
68
69
  def initialize
69
70
  @database_url = nil
@@ -124,7 +125,7 @@ module Pgbus
124
125
  @recurring_execution_retention = 7 * 24 * 3600 # 7 days
125
126
 
126
127
  @stats_enabled = true
127
- @stats_retention = 7 * 24 * 3600 # 7 days
128
+ @stats_retention = 30 * 24 * 3600 # 30 days
128
129
 
129
130
  @connects_to = nil
130
131
 
@@ -133,6 +134,7 @@ module Pgbus
133
134
  @web_per_page = 25
134
135
  @web_live_updates = true
135
136
  @web_data_source = nil
137
+ @insights_default_minutes = 30 * 24 * 60 # 30 days
136
138
  end
137
139
 
138
140
  def queue_name(name)
@@ -182,6 +184,10 @@ module Pgbus
182
184
  raise ArgumentError, "priority_levels must be an integer between 1 and 10"
183
185
  end
184
186
 
187
+ unless insights_default_minutes.is_a?(Integer) && insights_default_minutes.positive?
188
+ raise ArgumentError, "insights_default_minutes must be a positive integer"
189
+ end
190
+
185
191
  self
186
192
  end
187
193
 
data/lib/pgbus/engine.rb CHANGED
@@ -48,6 +48,10 @@ module Pgbus
48
48
  load File.expand_path("../tasks/pgbus_pgmq.rake", __dir__)
49
49
  end
50
50
 
51
+ initializer "pgbus.i18n" do
52
+ config.i18n.load_path += Dir[root.join("config", "locales", "**", "*.yml")]
53
+ end
54
+
51
55
  initializer "pgbus.web" do
52
56
  require "pgbus/web/authentication"
53
57
  require "pgbus/web/data_source"
data/lib/pgbus/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pgbus
4
- VERSION = "0.2.1"
4
+ VERSION = "0.2.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pgbus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikael Henriksson
@@ -115,6 +115,7 @@ files:
115
115
  - app/controllers/pgbus/events_controller.rb
116
116
  - app/controllers/pgbus/insights_controller.rb
117
117
  - app/controllers/pgbus/jobs_controller.rb
118
+ - app/controllers/pgbus/locale_controller.rb
118
119
  - app/controllers/pgbus/locks_controller.rb
119
120
  - app/controllers/pgbus/outbox_controller.rb
120
121
  - app/controllers/pgbus/processes_controller.rb
@@ -159,6 +160,19 @@ files:
159
160
  - app/views/pgbus/recurring_tasks/_tasks_table.html.erb
160
161
  - app/views/pgbus/recurring_tasks/index.html.erb
161
162
  - app/views/pgbus/recurring_tasks/show.html.erb
163
+ - config/i18n-tasks.yml
164
+ - config/locales/da.yml
165
+ - config/locales/de.yml
166
+ - config/locales/en.yml
167
+ - config/locales/es.yml
168
+ - config/locales/fi.yml
169
+ - config/locales/fr.yml
170
+ - config/locales/it.yml
171
+ - config/locales/ja.yml
172
+ - config/locales/nb.yml
173
+ - config/locales/nl.yml
174
+ - config/locales/pt.yml
175
+ - config/locales/sv.yml
162
176
  - config/routes.rb
163
177
  - exe/pgbus
164
178
  - lib/active_job/queue_adapters/pgbus_adapter.rb