panoptic 0.1.3 → 0.2.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 +4 -4
- data/README.md +21 -12
- data/app/controllers/panoptic/application_controller.rb +1 -0
- data/app/controllers/panoptic/jobs/failed_controller.rb +14 -0
- data/app/controllers/panoptic/jobs/scheduled_controller.rb +14 -0
- data/app/controllers/panoptic/jobs_controller.rb +0 -2
- data/app/helpers/panoptic/application_helper.rb +1 -0
- data/app/helpers/panoptic/date_time_helper.rb +11 -0
- data/app/views/panoptic/jobs/_job.html.erb +2 -3
- data/app/views/panoptic/jobs/index.html.erb +15 -4
- data/config/routes.rb +9 -1
- data/lib/panoptic/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7765d548dafa03735d2dc25e0319bb04857aeaff9b4b8394eec1f1f524674eee
|
4
|
+
data.tar.gz: a2aa9f24af59985caff5c0d4650f474f727819d247964d54175da407fd5fd3dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e65e09ed7d09a7e3543e03b04f7c6fb12536b37fab220ce4c5e9170cdcd94093f6dd8105c0f998ee9333817b6ea11372627708c412c9f088e22e1278a14a546
|
7
|
+
data.tar.gz: a5ad871749df301daf5e13561cfafe05ae5d1bc8f1a67030560f027c92c4ba4d962beb386ce44a2716411673100ff8c2c6f821b4d9be5d66c20ba932a72aa183
|
data/README.md
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
# Panoptic
|
2
|
-
Short description and motivation.
|
3
2
|
|
4
|
-
|
5
|
-
|
3
|
+
[](https://badge.fury.io/rb/panoptic)
|
4
|
+
|
5
|
+
Panoptic is a web interface for the [SolidQueue](https://github.com/basecamp/solid_queue) queuing backend.
|
6
|
+
|
7
|
+

|
8
|
+
|
9
|
+
While MissionControl is getting ready for release, this gem offers a visual interface for testing purposes with SolidQueue.
|
6
10
|
|
7
11
|
## Installation
|
8
12
|
Add this line to your application's Gemfile:
|
@@ -11,18 +15,23 @@ Add this line to your application's Gemfile:
|
|
11
15
|
gem "panoptic"
|
12
16
|
```
|
13
17
|
|
14
|
-
|
15
|
-
```bash
|
16
|
-
$ bundle
|
17
|
-
```
|
18
|
+
Then mount the engine in your `config/routes.rb` file
|
18
19
|
|
19
|
-
|
20
|
-
|
21
|
-
$ gem install panoptic
|
20
|
+
```ruby
|
21
|
+
mount Panoptic::Engine => "/panoptic"
|
22
22
|
```
|
23
23
|
|
24
|
-
##
|
25
|
-
|
24
|
+
## Usage
|
25
|
+
|
26
|
+
Once the gem is installed and the Engine mounted, visit your engine route to access Panoptic. For now, it offers three views:
|
27
|
+
- Processes
|
28
|
+
- Queues
|
29
|
+
- A first version of the jobs view
|
30
|
+
|
31
|
+
In the near future, the following features could be implemented:
|
32
|
+
- Pause and clear queues
|
33
|
+
- Advanced jobs view, with filters for executed, failed and scheduled jobs
|
34
|
+
- Search and retries
|
26
35
|
|
27
36
|
## License
|
28
37
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Panoptic
|
4
|
+
class Jobs::FailedController < ApplicationController
|
5
|
+
def index
|
6
|
+
# TODO: use the `failed` scope available in SolidQueue next release
|
7
|
+
@pagy, @jobs = pagy(
|
8
|
+
SolidQueue::Job.joins(:failed_execution).order(created_at: :asc)
|
9
|
+
)
|
10
|
+
|
11
|
+
render "panoptic/jobs/index"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Panoptic
|
4
|
+
class Jobs::ScheduledController < ApplicationController
|
5
|
+
def index
|
6
|
+
# TODO: use the `scheduled` scope available in SolidQueue next release
|
7
|
+
@pagy, @jobs = pagy(
|
8
|
+
SolidQueue::Job.joins(:scheduled_execution).order(created_at: :asc)
|
9
|
+
)
|
10
|
+
|
11
|
+
render "panoptic/jobs/index"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -2,7 +2,6 @@
|
|
2
2
|
<th scope="row"><%= job.id %></th>
|
3
3
|
<td scope="col"><%= job.class_name %></td>
|
4
4
|
<td scope="col"><%= job.queue_name %></td>
|
5
|
-
<td scope="col"><%= job.
|
6
|
-
<td scope="col"
|
7
|
-
<td scope="col"><% job.finished_at %></td>
|
5
|
+
<td scope="col"><%= safe_time_tag job.scheduled_at %></td>
|
6
|
+
<td scope="col"><%= safe_time_tag job.finished_at %></td>
|
8
7
|
</tr>
|
@@ -1,5 +1,17 @@
|
|
1
1
|
<h1>Jobs</h1>
|
2
2
|
|
3
|
+
<ul class="nav nav-underline">
|
4
|
+
<li class="nav-item">
|
5
|
+
<%= link_to "All", jobs_path, class: class_names("nav-link", "active": current_page?(jobs_path)) %>
|
6
|
+
</li>
|
7
|
+
<li class="nav-item">
|
8
|
+
<%= link_to "Scheduled", scheduled_jobs_path, class: class_names("nav-link", "active": current_page?(scheduled_jobs_path)) %>
|
9
|
+
</li>
|
10
|
+
<li class="nav-item">
|
11
|
+
<%= link_to "Failed", failed_jobs_path, class: class_names("nav-link", "active": current_page?(failed_jobs_path)) %>
|
12
|
+
</li>
|
13
|
+
</ul>
|
14
|
+
|
3
15
|
<div class="d-flex justify-content-end">
|
4
16
|
<%== pagy_info(@pagy) %>
|
5
17
|
</div>
|
@@ -10,14 +22,13 @@
|
|
10
22
|
<th scope="col">#</th>
|
11
23
|
<th scope="col">Class</th>
|
12
24
|
<th scope="col">Queue</th>
|
13
|
-
<th scope="col">
|
14
|
-
<th scope="col">
|
15
|
-
<th scope="col">Finished at</th>
|
25
|
+
<th scope="col">Scheduled</th>
|
26
|
+
<th scope="col">Finished</th>
|
16
27
|
</tr>
|
17
28
|
</thead>
|
18
29
|
|
19
30
|
<tbody>
|
20
|
-
<%= render partial: "job", collection: @jobs %>
|
31
|
+
<%= render partial: "panoptic/jobs/job", collection: @jobs %>
|
21
32
|
</tbody>
|
22
33
|
</table>
|
23
34
|
|
data/config/routes.rb
CHANGED
@@ -2,5 +2,13 @@ Panoptic::Engine.routes.draw do
|
|
2
2
|
root to: "processes#index"
|
3
3
|
|
4
4
|
resources :queues, only: [:index]
|
5
|
-
|
5
|
+
|
6
|
+
scope "jobs" do
|
7
|
+
get "all", to: "jobs#index", as: "jobs"
|
8
|
+
|
9
|
+
scope module: "jobs" do
|
10
|
+
resources :scheduled, only: :index, as: :scheduled_jobs
|
11
|
+
resources :failed, only: :index, as: :failed_jobs
|
12
|
+
end
|
13
|
+
end
|
6
14
|
end
|
data/lib/panoptic/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: panoptic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vincent Rolea
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-12-
|
11
|
+
date: 2023-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -63,10 +63,13 @@ files:
|
|
63
63
|
- README.md
|
64
64
|
- Rakefile
|
65
65
|
- app/controllers/panoptic/application_controller.rb
|
66
|
+
- app/controllers/panoptic/jobs/failed_controller.rb
|
67
|
+
- app/controllers/panoptic/jobs/scheduled_controller.rb
|
66
68
|
- app/controllers/panoptic/jobs_controller.rb
|
67
69
|
- app/controllers/panoptic/processes_controller.rb
|
68
70
|
- app/controllers/panoptic/queues_controller.rb
|
69
71
|
- app/helpers/panoptic/application_helper.rb
|
72
|
+
- app/helpers/panoptic/date_time_helper.rb
|
70
73
|
- app/jobs/panoptic/application_job.rb
|
71
74
|
- app/mailers/panoptic/application_mailer.rb
|
72
75
|
- app/models/panoptic/application_record.rb
|