job_harbor 0.1.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/README.md +98 -0
- data/Rakefile +6 -0
- data/app/assets/stylesheets/solidqueue_dashboard/application.css +1 -0
- data/app/components/job_harbor/application_component.rb +13 -0
- data/app/components/job_harbor/badge_component.rb +26 -0
- data/app/components/job_harbor/chart_component.rb +82 -0
- data/app/components/job_harbor/empty_state_component.rb +41 -0
- data/app/components/job_harbor/failure_rates_component.rb +84 -0
- data/app/components/job_harbor/job_filters_component.rb +92 -0
- data/app/components/job_harbor/job_row_component.rb +106 -0
- data/app/components/job_harbor/nav_link_component.rb +50 -0
- data/app/components/job_harbor/pagination_component.rb +72 -0
- data/app/components/job_harbor/per_page_selector_component.rb +40 -0
- data/app/components/job_harbor/queue_card_component.rb +59 -0
- data/app/components/job_harbor/refresh_selector_component.rb +57 -0
- data/app/components/job_harbor/stat_card_component.rb +77 -0
- data/app/components/job_harbor/theme_toggle_component.rb +48 -0
- data/app/components/job_harbor/worker_card_component.rb +86 -0
- data/app/controllers/job_harbor/application_controller.rb +44 -0
- data/app/controllers/job_harbor/dashboard_controller.rb +17 -0
- data/app/controllers/job_harbor/jobs_controller.rb +151 -0
- data/app/controllers/job_harbor/queues_controller.rb +40 -0
- data/app/controllers/job_harbor/recurring_tasks_controller.rb +35 -0
- data/app/controllers/job_harbor/workers_controller.rb +12 -0
- data/app/helpers/job_harbor/application_helper.rb +4 -0
- data/app/models/job_harbor/chart_data.rb +104 -0
- data/app/models/job_harbor/dashboard_stats.rb +90 -0
- data/app/models/job_harbor/failure_stats.rb +63 -0
- data/app/models/job_harbor/job_presenter.rb +246 -0
- data/app/models/job_harbor/queue_stats.rb +77 -0
- data/app/views/job_harbor/dashboard/index.html.erb +112 -0
- data/app/views/job_harbor/jobs/index.html.erb +100 -0
- data/app/views/job_harbor/jobs/search.html.erb +43 -0
- data/app/views/job_harbor/jobs/show.html.erb +133 -0
- data/app/views/job_harbor/queues/index.html.erb +13 -0
- data/app/views/job_harbor/queues/show.html.erb +88 -0
- data/app/views/job_harbor/recurring_tasks/index.html.erb +36 -0
- data/app/views/job_harbor/recurring_tasks/show.html.erb +97 -0
- data/app/views/job_harbor/workers/index.html.erb +33 -0
- data/app/views/layouts/job_harbor/application.html.erb +1434 -0
- data/config/routes.rb +39 -0
- data/lib/job_harbor/configuration.rb +31 -0
- data/lib/job_harbor/engine.rb +28 -0
- data/lib/job_harbor/version.rb +3 -0
- data/lib/job_harbor.rb +19 -0
- data/lib/tasks/solidqueue_dashboard_tasks.rake +4 -0
- metadata +134 -0
data/config/routes.rb
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
JobHarbor::Engine.routes.draw do
|
|
2
|
+
root to: "dashboard#index"
|
|
3
|
+
|
|
4
|
+
resources :jobs, only: [ :index, :show ] do
|
|
5
|
+
member do
|
|
6
|
+
post :retry
|
|
7
|
+
delete :discard
|
|
8
|
+
end
|
|
9
|
+
collection do
|
|
10
|
+
post :retry_all
|
|
11
|
+
delete :discard_all
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Status-scoped job routes
|
|
16
|
+
get "jobs/status/pending", to: "jobs#index", defaults: { status: "pending" }, as: :pending_jobs
|
|
17
|
+
get "jobs/status/scheduled", to: "jobs#index", defaults: { status: "scheduled" }, as: :scheduled_jobs
|
|
18
|
+
get "jobs/status/in_progress", to: "jobs#index", defaults: { status: "in_progress" }, as: :in_progress_jobs
|
|
19
|
+
get "jobs/status/failed", to: "jobs#index", defaults: { status: "failed" }, as: :failed_jobs
|
|
20
|
+
get "jobs/status/blocked", to: "jobs#index", defaults: { status: "blocked" }, as: :blocked_jobs
|
|
21
|
+
get "jobs/status/finished", to: "jobs#index", defaults: { status: "finished" }, as: :finished_jobs
|
|
22
|
+
|
|
23
|
+
resources :queues, only: [ :index, :show ], param: :name do
|
|
24
|
+
member do
|
|
25
|
+
post :pause
|
|
26
|
+
delete :resume
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
resources :workers, only: [ :index ]
|
|
31
|
+
|
|
32
|
+
resources :recurring_tasks, only: [ :index, :show ] do
|
|
33
|
+
member do
|
|
34
|
+
post :enqueue_now
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
get "search", to: "jobs#search", as: :search
|
|
39
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
module JobHarbor
|
|
2
|
+
class Configuration
|
|
3
|
+
attr_accessor :authorize_with,
|
|
4
|
+
:theme,
|
|
5
|
+
:primary_color,
|
|
6
|
+
:jobs_per_page,
|
|
7
|
+
:enable_recurring_tasks,
|
|
8
|
+
:enable_real_time_updates,
|
|
9
|
+
:poll_interval,
|
|
10
|
+
:enable_failure_stats,
|
|
11
|
+
:enable_charts,
|
|
12
|
+
:default_chart_range
|
|
13
|
+
|
|
14
|
+
def initialize
|
|
15
|
+
@authorize_with = -> { true }
|
|
16
|
+
@theme = :dark
|
|
17
|
+
@primary_color = "amber"
|
|
18
|
+
@jobs_per_page = 25
|
|
19
|
+
@enable_recurring_tasks = true
|
|
20
|
+
@enable_real_time_updates = true
|
|
21
|
+
@poll_interval = 5
|
|
22
|
+
@enable_failure_stats = true
|
|
23
|
+
@enable_charts = true
|
|
24
|
+
@default_chart_range = "24h"
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def authorize(controller)
|
|
28
|
+
controller.instance_exec(&authorize_with)
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
module JobHarbor
|
|
2
|
+
class Engine < ::Rails::Engine
|
|
3
|
+
isolate_namespace JobHarbor
|
|
4
|
+
|
|
5
|
+
# Load ViewComponent
|
|
6
|
+
initializer "job_harbor.view_component" do
|
|
7
|
+
ActiveSupport.on_load(:view_component) do
|
|
8
|
+
# Configure ViewComponent for the engine
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
# Set up component paths
|
|
13
|
+
initializer "job_harbor.components" do |app|
|
|
14
|
+
if app.config.respond_to?(:view_component)
|
|
15
|
+
app.config.view_component.preview_paths << root.join("app/components")
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# Add assets to pipeline
|
|
20
|
+
initializer "job_harbor.assets" do |app|
|
|
21
|
+
if app.config.respond_to?(:assets)
|
|
22
|
+
app.config.assets.precompile += %w[
|
|
23
|
+
job_harbor/application.css
|
|
24
|
+
]
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
data/lib/job_harbor.rb
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
require "job_harbor/version"
|
|
2
|
+
require "job_harbor/configuration"
|
|
3
|
+
require "job_harbor/engine"
|
|
4
|
+
|
|
5
|
+
module JobHarbor
|
|
6
|
+
class << self
|
|
7
|
+
def configuration
|
|
8
|
+
@configuration ||= Configuration.new
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def configure
|
|
12
|
+
yield(configuration)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def reset_configuration!
|
|
16
|
+
@configuration = Configuration.new
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: job_harbor
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Evan Sparkman
|
|
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: '0.3'
|
|
33
|
+
type: :runtime
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - ">="
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '0.3'
|
|
40
|
+
- !ruby/object:Gem::Dependency
|
|
41
|
+
name: view_component
|
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - ">="
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '3.0'
|
|
47
|
+
type: :runtime
|
|
48
|
+
prerelease: false
|
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - ">="
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '3.0'
|
|
54
|
+
description: A mountable Rails engine providing a beautiful, self-contained dashboard
|
|
55
|
+
for Solid Queue. Monitor jobs, queues, workers, and recurring tasks with a modern
|
|
56
|
+
UI built on ViewComponents.
|
|
57
|
+
email:
|
|
58
|
+
- evan@mountaingapcoffee.com
|
|
59
|
+
executables: []
|
|
60
|
+
extensions: []
|
|
61
|
+
extra_rdoc_files: []
|
|
62
|
+
files:
|
|
63
|
+
- README.md
|
|
64
|
+
- Rakefile
|
|
65
|
+
- app/assets/stylesheets/solidqueue_dashboard/application.css
|
|
66
|
+
- app/components/job_harbor/application_component.rb
|
|
67
|
+
- app/components/job_harbor/badge_component.rb
|
|
68
|
+
- app/components/job_harbor/chart_component.rb
|
|
69
|
+
- app/components/job_harbor/empty_state_component.rb
|
|
70
|
+
- app/components/job_harbor/failure_rates_component.rb
|
|
71
|
+
- app/components/job_harbor/job_filters_component.rb
|
|
72
|
+
- app/components/job_harbor/job_row_component.rb
|
|
73
|
+
- app/components/job_harbor/nav_link_component.rb
|
|
74
|
+
- app/components/job_harbor/pagination_component.rb
|
|
75
|
+
- app/components/job_harbor/per_page_selector_component.rb
|
|
76
|
+
- app/components/job_harbor/queue_card_component.rb
|
|
77
|
+
- app/components/job_harbor/refresh_selector_component.rb
|
|
78
|
+
- app/components/job_harbor/stat_card_component.rb
|
|
79
|
+
- app/components/job_harbor/theme_toggle_component.rb
|
|
80
|
+
- app/components/job_harbor/worker_card_component.rb
|
|
81
|
+
- app/controllers/job_harbor/application_controller.rb
|
|
82
|
+
- app/controllers/job_harbor/dashboard_controller.rb
|
|
83
|
+
- app/controllers/job_harbor/jobs_controller.rb
|
|
84
|
+
- app/controllers/job_harbor/queues_controller.rb
|
|
85
|
+
- app/controllers/job_harbor/recurring_tasks_controller.rb
|
|
86
|
+
- app/controllers/job_harbor/workers_controller.rb
|
|
87
|
+
- app/helpers/job_harbor/application_helper.rb
|
|
88
|
+
- app/models/job_harbor/chart_data.rb
|
|
89
|
+
- app/models/job_harbor/dashboard_stats.rb
|
|
90
|
+
- app/models/job_harbor/failure_stats.rb
|
|
91
|
+
- app/models/job_harbor/job_presenter.rb
|
|
92
|
+
- app/models/job_harbor/queue_stats.rb
|
|
93
|
+
- app/views/job_harbor/dashboard/index.html.erb
|
|
94
|
+
- app/views/job_harbor/jobs/index.html.erb
|
|
95
|
+
- app/views/job_harbor/jobs/search.html.erb
|
|
96
|
+
- app/views/job_harbor/jobs/show.html.erb
|
|
97
|
+
- app/views/job_harbor/queues/index.html.erb
|
|
98
|
+
- app/views/job_harbor/queues/show.html.erb
|
|
99
|
+
- app/views/job_harbor/recurring_tasks/index.html.erb
|
|
100
|
+
- app/views/job_harbor/recurring_tasks/show.html.erb
|
|
101
|
+
- app/views/job_harbor/workers/index.html.erb
|
|
102
|
+
- app/views/layouts/job_harbor/application.html.erb
|
|
103
|
+
- config/routes.rb
|
|
104
|
+
- lib/job_harbor.rb
|
|
105
|
+
- lib/job_harbor/configuration.rb
|
|
106
|
+
- lib/job_harbor/engine.rb
|
|
107
|
+
- lib/job_harbor/version.rb
|
|
108
|
+
- lib/tasks/solidqueue_dashboard_tasks.rake
|
|
109
|
+
homepage: https://github.com/esparkman/job_harbor
|
|
110
|
+
licenses:
|
|
111
|
+
- MIT
|
|
112
|
+
metadata:
|
|
113
|
+
homepage_uri: https://github.com/esparkman/job_harbor
|
|
114
|
+
source_code_uri: https://github.com/esparkman/job_harbor
|
|
115
|
+
changelog_uri: https://github.com/esparkman/job_harbor/blob/main/CHANGELOG.md
|
|
116
|
+
rubygems_mfa_required: 'true'
|
|
117
|
+
rdoc_options: []
|
|
118
|
+
require_paths:
|
|
119
|
+
- lib
|
|
120
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
121
|
+
requirements:
|
|
122
|
+
- - ">="
|
|
123
|
+
- !ruby/object:Gem::Version
|
|
124
|
+
version: '3.2'
|
|
125
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
126
|
+
requirements:
|
|
127
|
+
- - ">="
|
|
128
|
+
- !ruby/object:Gem::Version
|
|
129
|
+
version: '0'
|
|
130
|
+
requirements: []
|
|
131
|
+
rubygems_version: 4.0.4
|
|
132
|
+
specification_version: 4
|
|
133
|
+
summary: A modern dashboard for monitoring and managing Solid Queue jobs
|
|
134
|
+
test_files: []
|