solid_queue-flightdeck 0.6.0
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.
- checksums.yaml +7 -0
- data/MIT-LICENSE +21 -0
- data/README.md +206 -0
- data/app/assets/flightdeck/flightdeck-3967b9e6c506.css +3 -0
- data/app/assets/flightdeck/flightdeck-ad1bcc693cfd.js +414 -0
- data/app/assets/flightdeck/manifest.json +16 -0
- data/app/controllers/concerns/flightdeck/toasts.rb +35 -0
- data/app/controllers/flightdeck/application_controller.rb +110 -0
- data/app/controllers/flightdeck/assets_controller.rb +39 -0
- data/app/controllers/flightdeck/jobs/actions_controller.rb +166 -0
- data/app/controllers/flightdeck/jobs/discards_controller.rb +43 -0
- data/app/controllers/flightdeck/jobs/retries_controller.rb +22 -0
- data/app/controllers/flightdeck/jobs_controller.rb +39 -0
- data/app/controllers/flightdeck/overview_controller.rb +11 -0
- data/app/controllers/flightdeck/processes_controller.rb +54 -0
- data/app/controllers/flightdeck/queues_controller.rb +56 -0
- data/app/controllers/flightdeck/recurring_tasks_controller.rb +51 -0
- data/app/helpers/flightdeck/application_helper.rb +85 -0
- data/app/helpers/flightdeck/infrastructure_helper.rb +24 -0
- data/app/helpers/flightdeck/jobs_helper.rb +117 -0
- data/app/helpers/flightdeck/metrics_helper.rb +49 -0
- data/app/models/flightdeck/arguments_preview.rb +95 -0
- data/app/models/flightdeck/bulk_action.rb +83 -0
- data/app/models/flightdeck/cache.rb +51 -0
- data/app/models/flightdeck/cron_schedule.rb +102 -0
- data/app/models/flightdeck/duration.rb +23 -0
- data/app/models/flightdeck/error_summary.rb +64 -0
- data/app/models/flightdeck/grouped_failures.rb +24 -0
- data/app/models/flightdeck/job_detail.rb +156 -0
- data/app/models/flightdeck/job_row.rb +103 -0
- data/app/models/flightdeck/jobs_query.rb +233 -0
- data/app/models/flightdeck/metrics/bar_chart.rb +49 -0
- data/app/models/flightdeck/metrics/chart.rb +111 -0
- data/app/models/flightdeck/metrics/line_chart.rb +63 -0
- data/app/models/flightdeck/metrics/series.rb +165 -0
- data/app/models/flightdeck/metrics/sparkline.rb +45 -0
- data/app/models/flightdeck/metrics/time_bucket.rb +95 -0
- data/app/models/flightdeck/overview.rb +210 -0
- data/app/models/flightdeck/process_registry.rb +102 -0
- data/app/models/flightdeck/queue_stats.rb +86 -0
- data/app/models/flightdeck/recurring_catalog.rb +114 -0
- data/app/views/flightdeck/jobs/_failed_row.html.erb +33 -0
- data/app/views/flightdeck/jobs/_filter_bar.html.erb +29 -0
- data/app/views/flightdeck/jobs/_list.html.erb +94 -0
- data/app/views/flightdeck/jobs/_pager.html.erb +22 -0
- data/app/views/flightdeck/jobs/_row.html.erb +23 -0
- data/app/views/flightdeck/jobs/_state_tabs.html.erb +10 -0
- data/app/views/flightdeck/jobs/index.html.erb +10 -0
- data/app/views/flightdeck/jobs/show.html.erb +100 -0
- data/app/views/flightdeck/metrics/_bar_chart.html.erb +34 -0
- data/app/views/flightdeck/metrics/_line_chart.html.erb +38 -0
- data/app/views/flightdeck/metrics/_range_control.html.erb +7 -0
- data/app/views/flightdeck/metrics/_sparkline.html.erb +9 -0
- data/app/views/flightdeck/overview/_completion.html.erb +19 -0
- data/app/views/flightdeck/overview/_failures.html.erb +28 -0
- data/app/views/flightdeck/overview/_fleet.html.erb +21 -0
- data/app/views/flightdeck/overview/_queues.html.erb +41 -0
- data/app/views/flightdeck/overview/_throughput.html.erb +23 -0
- data/app/views/flightdeck/overview/_tiles.html.erb +14 -0
- data/app/views/flightdeck/overview/index.html.erb +29 -0
- data/app/views/flightdeck/processes/_fleet.html.erb +54 -0
- data/app/views/flightdeck/processes/_row.html.erb +28 -0
- data/app/views/flightdeck/processes/index.html.erb +5 -0
- data/app/views/flightdeck/queues/_cards.html.erb +46 -0
- data/app/views/flightdeck/queues/index.html.erb +5 -0
- data/app/views/flightdeck/recurring_tasks/_table.html.erb +53 -0
- data/app/views/flightdeck/recurring_tasks/index.html.erb +5 -0
- data/app/views/flightdeck/shared/_toast.html.erb +7 -0
- data/app/views/flightdeck/shared/refresh.turbo_stream.erb +14 -0
- data/app/views/layouts/flightdeck/application.html.erb +110 -0
- data/config/routes.rb +40 -0
- data/lib/flightdeck/assets.rb +72 -0
- data/lib/flightdeck/configuration.rb +82 -0
- data/lib/flightdeck/engine.rb +31 -0
- data/lib/flightdeck/version.rb +5 -0
- data/lib/flightdeck.rb +31 -0
- data/lib/solid_queue-flightdeck.rb +5 -0
- metadata +149 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Flightdeck
|
|
4
|
+
class Configuration
|
|
5
|
+
attr_accessor :base_controller_class,
|
|
6
|
+
:http_basic,
|
|
7
|
+
:skip_authentication,
|
|
8
|
+
:poll_interval,
|
|
9
|
+
:chart_poll_interval,
|
|
10
|
+
:per_page,
|
|
11
|
+
:count_cap,
|
|
12
|
+
:bulk_action_limit,
|
|
13
|
+
:chart_cache_ttl,
|
|
14
|
+
:display_timezone,
|
|
15
|
+
:backtrace_lines
|
|
16
|
+
|
|
17
|
+
def initialize
|
|
18
|
+
@base_controller_class = nil
|
|
19
|
+
@http_basic = nil
|
|
20
|
+
@skip_authentication = false
|
|
21
|
+
@poll_interval = 5.seconds
|
|
22
|
+
@chart_poll_interval = 30.seconds
|
|
23
|
+
@per_page = 25
|
|
24
|
+
@count_cap = 500_000
|
|
25
|
+
@bulk_action_limit = 1_000
|
|
26
|
+
@chart_cache_ttl = 30.seconds
|
|
27
|
+
@display_timezone = "UTC"
|
|
28
|
+
@backtrace_lines = 50
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Resolved fresh on every call so that credentials rotated in the
|
|
32
|
+
# environment (or in Rails credentials) take effect without a restart,
|
|
33
|
+
# and so that nothing touches Rails.application.credentials at boot.
|
|
34
|
+
#
|
|
35
|
+
# Returns a { username:, password: } hash, or nil when unconfigured.
|
|
36
|
+
def resolve_http_basic
|
|
37
|
+
from_explicit || from_env || from_credentials
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
private
|
|
41
|
+
def from_explicit
|
|
42
|
+
normalize(http_basic)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def from_env
|
|
46
|
+
normalize(username: ENV["FLIGHTDECK_USERNAME"], password: ENV["FLIGHTDECK_PASSWORD"])
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def from_credentials
|
|
50
|
+
return nil unless defined?(Rails) && Rails.application
|
|
51
|
+
|
|
52
|
+
normalize(Rails.application.credentials.flightdeck)
|
|
53
|
+
rescue StandardError
|
|
54
|
+
nil
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def normalize(source)
|
|
58
|
+
return nil if source.nil?
|
|
59
|
+
|
|
60
|
+
source = source.call if source.respond_to?(:call)
|
|
61
|
+
return nil if source.nil?
|
|
62
|
+
|
|
63
|
+
username = fetch(source, :username)
|
|
64
|
+
password = fetch(source, :password)
|
|
65
|
+
return nil if username.nil? || password.nil?
|
|
66
|
+
|
|
67
|
+
username = username.to_s
|
|
68
|
+
password = password.to_s
|
|
69
|
+
return nil if username.empty? || password.empty?
|
|
70
|
+
|
|
71
|
+
{ username: username, password: password }
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def fetch(source, key)
|
|
75
|
+
if source.respond_to?(:[])
|
|
76
|
+
source[key] || source[key.to_s]
|
|
77
|
+
elsif source.respond_to?(key)
|
|
78
|
+
source.public_send(key)
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "rails"
|
|
4
|
+
require "action_controller/railtie"
|
|
5
|
+
require "action_view/railtie"
|
|
6
|
+
require "solid_queue"
|
|
7
|
+
|
|
8
|
+
module Flightdeck
|
|
9
|
+
class Engine < ::Rails::Engine
|
|
10
|
+
isolate_namespace Flightdeck
|
|
11
|
+
|
|
12
|
+
# Engine-local middleware: wraps only requests routed into the mount, so
|
|
13
|
+
# Flightdeck has cookies, a session and flash even when the host app is
|
|
14
|
+
# `config.api_only = true` and carries none of them.
|
|
15
|
+
middleware.use ActionDispatch::Cookies
|
|
16
|
+
middleware.use ActionDispatch::Session::CookieStore,
|
|
17
|
+
key: "_flightdeck_session",
|
|
18
|
+
same_site: :lax,
|
|
19
|
+
httponly: true
|
|
20
|
+
middleware.use ActionDispatch::Flash
|
|
21
|
+
|
|
22
|
+
config.flightdeck = Flightdeck.config
|
|
23
|
+
|
|
24
|
+
# Flightdeck speaks Turbo Streams but does not depend on turbo-rails: the
|
|
25
|
+
# engine ships its own Turbo build. Registering the type is all the server
|
|
26
|
+
# side actually needs, and the host may well have registered it already.
|
|
27
|
+
initializer "flightdeck.mime_types" do
|
|
28
|
+
Mime::Type.register "text/vnd.turbo-stream.html", :turbo_stream unless Mime[:turbo_stream]
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
data/lib/flightdeck.rb
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "active_support"
|
|
4
|
+
require "active_support/core_ext/numeric/time"
|
|
5
|
+
require "active_support/core_ext/object/blank"
|
|
6
|
+
require "active_support/core_ext/string/inflections"
|
|
7
|
+
|
|
8
|
+
require "flightdeck/version"
|
|
9
|
+
require "flightdeck/configuration"
|
|
10
|
+
require "flightdeck/assets"
|
|
11
|
+
|
|
12
|
+
module Flightdeck
|
|
13
|
+
class << self
|
|
14
|
+
def config
|
|
15
|
+
@config ||= Configuration.new
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def configure
|
|
19
|
+
yield config
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# Resolved at controller-definition time. Zeitwerk loads the engine's
|
|
23
|
+
# controllers lazily, so host configuration set in an initializer wins.
|
|
24
|
+
def base_controller_class
|
|
25
|
+
name = config.base_controller_class
|
|
26
|
+
name.presence ? name.to_s.constantize : ActionController::Base
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
require "flightdeck/engine"
|
metadata
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: solid_queue-flightdeck
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.6.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Carl Mercier
|
|
8
|
+
bindir: bin
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: rails
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '7.1'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - ">="
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '7.1'
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: solid_queue
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - ">="
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '1.0'
|
|
33
|
+
type: :runtime
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - ">="
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '1.0'
|
|
40
|
+
description: 'Flightdeck is a mountable Rails engine that gives Solid Queue a fast,
|
|
41
|
+
polished dashboard: jobs, failures, queues, processes, recurring tasks and live
|
|
42
|
+
charts. Works in API-only hosts and ships its own precompiled assets.'
|
|
43
|
+
email:
|
|
44
|
+
- carl@carlmercier.com
|
|
45
|
+
executables: []
|
|
46
|
+
extensions: []
|
|
47
|
+
extra_rdoc_files: []
|
|
48
|
+
files:
|
|
49
|
+
- MIT-LICENSE
|
|
50
|
+
- README.md
|
|
51
|
+
- app/assets/flightdeck/flightdeck-3967b9e6c506.css
|
|
52
|
+
- app/assets/flightdeck/flightdeck-ad1bcc693cfd.js
|
|
53
|
+
- app/assets/flightdeck/manifest.json
|
|
54
|
+
- app/controllers/concerns/flightdeck/toasts.rb
|
|
55
|
+
- app/controllers/flightdeck/application_controller.rb
|
|
56
|
+
- app/controllers/flightdeck/assets_controller.rb
|
|
57
|
+
- app/controllers/flightdeck/jobs/actions_controller.rb
|
|
58
|
+
- app/controllers/flightdeck/jobs/discards_controller.rb
|
|
59
|
+
- app/controllers/flightdeck/jobs/retries_controller.rb
|
|
60
|
+
- app/controllers/flightdeck/jobs_controller.rb
|
|
61
|
+
- app/controllers/flightdeck/overview_controller.rb
|
|
62
|
+
- app/controllers/flightdeck/processes_controller.rb
|
|
63
|
+
- app/controllers/flightdeck/queues_controller.rb
|
|
64
|
+
- app/controllers/flightdeck/recurring_tasks_controller.rb
|
|
65
|
+
- app/helpers/flightdeck/application_helper.rb
|
|
66
|
+
- app/helpers/flightdeck/infrastructure_helper.rb
|
|
67
|
+
- app/helpers/flightdeck/jobs_helper.rb
|
|
68
|
+
- app/helpers/flightdeck/metrics_helper.rb
|
|
69
|
+
- app/models/flightdeck/arguments_preview.rb
|
|
70
|
+
- app/models/flightdeck/bulk_action.rb
|
|
71
|
+
- app/models/flightdeck/cache.rb
|
|
72
|
+
- app/models/flightdeck/cron_schedule.rb
|
|
73
|
+
- app/models/flightdeck/duration.rb
|
|
74
|
+
- app/models/flightdeck/error_summary.rb
|
|
75
|
+
- app/models/flightdeck/grouped_failures.rb
|
|
76
|
+
- app/models/flightdeck/job_detail.rb
|
|
77
|
+
- app/models/flightdeck/job_row.rb
|
|
78
|
+
- app/models/flightdeck/jobs_query.rb
|
|
79
|
+
- app/models/flightdeck/metrics/bar_chart.rb
|
|
80
|
+
- app/models/flightdeck/metrics/chart.rb
|
|
81
|
+
- app/models/flightdeck/metrics/line_chart.rb
|
|
82
|
+
- app/models/flightdeck/metrics/series.rb
|
|
83
|
+
- app/models/flightdeck/metrics/sparkline.rb
|
|
84
|
+
- app/models/flightdeck/metrics/time_bucket.rb
|
|
85
|
+
- app/models/flightdeck/overview.rb
|
|
86
|
+
- app/models/flightdeck/process_registry.rb
|
|
87
|
+
- app/models/flightdeck/queue_stats.rb
|
|
88
|
+
- app/models/flightdeck/recurring_catalog.rb
|
|
89
|
+
- app/views/flightdeck/jobs/_failed_row.html.erb
|
|
90
|
+
- app/views/flightdeck/jobs/_filter_bar.html.erb
|
|
91
|
+
- app/views/flightdeck/jobs/_list.html.erb
|
|
92
|
+
- app/views/flightdeck/jobs/_pager.html.erb
|
|
93
|
+
- app/views/flightdeck/jobs/_row.html.erb
|
|
94
|
+
- app/views/flightdeck/jobs/_state_tabs.html.erb
|
|
95
|
+
- app/views/flightdeck/jobs/index.html.erb
|
|
96
|
+
- app/views/flightdeck/jobs/show.html.erb
|
|
97
|
+
- app/views/flightdeck/metrics/_bar_chart.html.erb
|
|
98
|
+
- app/views/flightdeck/metrics/_line_chart.html.erb
|
|
99
|
+
- app/views/flightdeck/metrics/_range_control.html.erb
|
|
100
|
+
- app/views/flightdeck/metrics/_sparkline.html.erb
|
|
101
|
+
- app/views/flightdeck/overview/_completion.html.erb
|
|
102
|
+
- app/views/flightdeck/overview/_failures.html.erb
|
|
103
|
+
- app/views/flightdeck/overview/_fleet.html.erb
|
|
104
|
+
- app/views/flightdeck/overview/_queues.html.erb
|
|
105
|
+
- app/views/flightdeck/overview/_throughput.html.erb
|
|
106
|
+
- app/views/flightdeck/overview/_tiles.html.erb
|
|
107
|
+
- app/views/flightdeck/overview/index.html.erb
|
|
108
|
+
- app/views/flightdeck/processes/_fleet.html.erb
|
|
109
|
+
- app/views/flightdeck/processes/_row.html.erb
|
|
110
|
+
- app/views/flightdeck/processes/index.html.erb
|
|
111
|
+
- app/views/flightdeck/queues/_cards.html.erb
|
|
112
|
+
- app/views/flightdeck/queues/index.html.erb
|
|
113
|
+
- app/views/flightdeck/recurring_tasks/_table.html.erb
|
|
114
|
+
- app/views/flightdeck/recurring_tasks/index.html.erb
|
|
115
|
+
- app/views/flightdeck/shared/_toast.html.erb
|
|
116
|
+
- app/views/flightdeck/shared/refresh.turbo_stream.erb
|
|
117
|
+
- app/views/layouts/flightdeck/application.html.erb
|
|
118
|
+
- config/routes.rb
|
|
119
|
+
- lib/flightdeck.rb
|
|
120
|
+
- lib/flightdeck/assets.rb
|
|
121
|
+
- lib/flightdeck/configuration.rb
|
|
122
|
+
- lib/flightdeck/engine.rb
|
|
123
|
+
- lib/flightdeck/version.rb
|
|
124
|
+
- lib/solid_queue-flightdeck.rb
|
|
125
|
+
homepage: https://github.com/cmer/solid_queue-flightdeck
|
|
126
|
+
licenses:
|
|
127
|
+
- MIT
|
|
128
|
+
metadata:
|
|
129
|
+
homepage_uri: https://github.com/cmer/solid_queue-flightdeck
|
|
130
|
+
source_code_uri: https://github.com/cmer/solid_queue-flightdeck
|
|
131
|
+
changelog_uri: https://github.com/cmer/solid_queue-flightdeck/blob/main/CHANGELOG.md
|
|
132
|
+
rdoc_options: []
|
|
133
|
+
require_paths:
|
|
134
|
+
- lib
|
|
135
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
136
|
+
requirements:
|
|
137
|
+
- - ">="
|
|
138
|
+
- !ruby/object:Gem::Version
|
|
139
|
+
version: '3.1'
|
|
140
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
|
+
requirements:
|
|
142
|
+
- - ">="
|
|
143
|
+
- !ruby/object:Gem::Version
|
|
144
|
+
version: '0'
|
|
145
|
+
requirements: []
|
|
146
|
+
rubygems_version: 4.0.10
|
|
147
|
+
specification_version: 4
|
|
148
|
+
summary: A beautiful, featureful dashboard for Solid Queue.
|
|
149
|
+
test_files: []
|