panoptic 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- 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 +1 -1
- data/app/helpers/panoptic/application_helper.rb +2 -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 +17 -8
- data/config/initializers/pagy.rb +1 -0
- data/config/routes.rb +9 -1
- data/lib/panoptic/engine.rb +4 -0
- data/lib/panoptic/version.rb +1 -1
- metadata +9 -12
- data/app/views/panoptic/kaminari/_first_page.html.erb +0 -3
- data/app/views/panoptic/kaminari/_gap.html.erb +0 -3
- data/app/views/panoptic/kaminari/_last_page.html.erb +0 -3
- data/app/views/panoptic/kaminari/_next_page.html.erb +0 -3
- data/app/views/panoptic/kaminari/_page.html.erb +0 -9
- data/app/views/panoptic/kaminari/_paginator.html.erb +0 -17
- data/app/views/panoptic/kaminari/_prev_page.html.erb +0 -3
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
|
+
[![Gem Version](https://badge.fury.io/rb/panoptic.svg)](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
|
+
![](./images/demo.png)
|
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,9 +1,19 @@
|
|
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
|
-
|
5
|
-
<%= page_entries_info @jobs %>
|
6
|
-
</div>
|
16
|
+
<%== pagy_info(@pagy) %>
|
7
17
|
</div>
|
8
18
|
|
9
19
|
<table class="table">
|
@@ -12,17 +22,16 @@
|
|
12
22
|
<th scope="col">#</th>
|
13
23
|
<th scope="col">Class</th>
|
14
24
|
<th scope="col">Queue</th>
|
15
|
-
<th scope="col">
|
16
|
-
<th scope="col">
|
17
|
-
<th scope="col">Finished at</th>
|
25
|
+
<th scope="col">Scheduled</th>
|
26
|
+
<th scope="col">Finished</th>
|
18
27
|
</tr>
|
19
28
|
</thead>
|
20
29
|
|
21
30
|
<tbody>
|
22
|
-
<%= render partial: "job", collection: @jobs %>
|
31
|
+
<%= render partial: "panoptic/jobs/job", collection: @jobs %>
|
23
32
|
</tbody>
|
24
33
|
</table>
|
25
34
|
|
26
35
|
<div class="d-flex justify-content-center">
|
27
|
-
|
36
|
+
<%== pagy_bootstrap_nav(@pagy) if @pagy.pages > 1 %>
|
28
37
|
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
require "pagy/extras/bootstrap"
|
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/engine.rb
CHANGED
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
|
@@ -39,19 +39,19 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0.1'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: pagy
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '6.2'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '6.2'
|
55
55
|
description: Web interface for the SoldiQueue queuing backend
|
56
56
|
email:
|
57
57
|
- 3525369+virolea@users.noreply.github.com
|
@@ -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
|
@@ -74,18 +77,12 @@ files:
|
|
74
77
|
- app/views/layouts/panoptic/application.html.erb
|
75
78
|
- app/views/panoptic/jobs/_job.html.erb
|
76
79
|
- app/views/panoptic/jobs/index.html.erb
|
77
|
-
- app/views/panoptic/kaminari/_first_page.html.erb
|
78
|
-
- app/views/panoptic/kaminari/_gap.html.erb
|
79
|
-
- app/views/panoptic/kaminari/_last_page.html.erb
|
80
|
-
- app/views/panoptic/kaminari/_next_page.html.erb
|
81
|
-
- app/views/panoptic/kaminari/_page.html.erb
|
82
|
-
- app/views/panoptic/kaminari/_paginator.html.erb
|
83
|
-
- app/views/panoptic/kaminari/_prev_page.html.erb
|
84
80
|
- app/views/panoptic/processes/_process.html.erb
|
85
81
|
- app/views/panoptic/processes/index.html.erb
|
86
82
|
- app/views/panoptic/queues/_queue.html.erb
|
87
83
|
- app/views/panoptic/queues/index.html.erb
|
88
84
|
- app/views/shared/_navbar.html.erb
|
85
|
+
- config/initializers/pagy.rb
|
89
86
|
- config/routes.rb
|
90
87
|
- lib/panoptic.rb
|
91
88
|
- lib/panoptic/engine.rb
|
@@ -1,9 +0,0 @@
|
|
1
|
-
<% if page.current? %>
|
2
|
-
<li class="page-item active">
|
3
|
-
<%= content_tag :a, page, data: { remote: remote }, rel: page.rel, class: 'page-link' %>
|
4
|
-
</li>
|
5
|
-
<% else %>
|
6
|
-
<li class="page-item">
|
7
|
-
<%= link_to page, url, remote: remote, rel: page.rel, class: 'page-link' %>
|
8
|
-
</li>
|
9
|
-
<% end %>
|
@@ -1,17 +0,0 @@
|
|
1
|
-
<%= paginator.render do %>
|
2
|
-
<nav>
|
3
|
-
<ul class="pagination">
|
4
|
-
<%= first_page_tag unless current_page.first? %>
|
5
|
-
<%= prev_page_tag unless current_page.first? %>
|
6
|
-
<% each_page do |page| %>
|
7
|
-
<% if page.left_outer? || page.right_outer? || page.inside_window? %>
|
8
|
-
<%= page_tag page %>
|
9
|
-
<% elsif !page.was_truncated? -%>
|
10
|
-
<%= gap_tag %>
|
11
|
-
<% end %>
|
12
|
-
<% end %>
|
13
|
-
<%= next_page_tag unless current_page.last? %>
|
14
|
-
<%= last_page_tag unless current_page.last? %>
|
15
|
-
</ul>
|
16
|
-
</nav>
|
17
|
-
<% end %>
|