panoptic 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +21 -0
- data/README.md +47 -11
- data/app/assets/builds/panoptic/application.css +11980 -0
- data/app/assets/builds/panoptic/application.js +4509 -0
- data/app/assets/config/panoptic_manifest.js +5 -0
- data/app/assets/javascripts/panoptic/application.js +1 -0
- data/app/assets/stylesheets/panoptic/application.scss +1 -0
- data/app/controllers/panoptic/jobs/failed_controller.rb +11 -0
- data/app/controllers/panoptic/jobs/scheduled_controller.rb +1 -1
- data/app/controllers/panoptic/jobs_controller.rb +1 -1
- data/app/models/panoptic/failed_job.rb +1 -1
- data/app/views/layouts/panoptic/application.html.erb +4 -5
- data/app/views/panoptic/jobs/failed/_job.html.erb +5 -0
- data/config/importmap.rb +2 -0
- data/config/routes.rb +2 -2
- data/lib/panoptic/engine.rb +5 -0
- data/lib/panoptic/version.rb +1 -1
- metadata +25 -4
- /data/app/views/{shared → panoptic/shared}/_flashes.html.erb +0 -0
- /data/app/views/{shared → panoptic/shared}/_navbar.html.erb +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
import "@hotwired/turbo-rails"
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "bootstrap/scss/bootstrap";
|
@@ -13,5 +13,16 @@ module Panoptic
|
|
13
13
|
def show
|
14
14
|
@job = Panoptic::FailedJob.find(params[:id])
|
15
15
|
end
|
16
|
+
|
17
|
+
def destroy
|
18
|
+
@job = Panoptic::FailedJob.find(params[:id])
|
19
|
+
if @job.destroy
|
20
|
+
redirect_back fallback_location: failed_jobs_path,
|
21
|
+
notice: "Job was successfully deleted."
|
22
|
+
else
|
23
|
+
redirect_back fallback_location: failed_jobs_path,
|
24
|
+
alert: @job.errors.full_messages.to_sentence
|
25
|
+
end
|
26
|
+
end
|
16
27
|
end
|
17
28
|
end
|
@@ -7,7 +7,7 @@ module Panoptic
|
|
7
7
|
def index
|
8
8
|
# TODO: use the `scheduled` scope available in SolidQueue next release
|
9
9
|
@pagy, @jobs = pagy(
|
10
|
-
SolidQueue::Job.joins(:scheduled_execution).order(
|
10
|
+
SolidQueue::Job.joins(:scheduled_execution).order(scheduled_at: :asc)
|
11
11
|
)
|
12
12
|
|
13
13
|
render "panoptic/jobs/index"
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Panoptic
|
4
4
|
class FailedJob < SolidQueue::Job
|
5
5
|
# TODO: use the `failed` scope available in SolidQueue next release
|
6
|
-
default_scope {
|
6
|
+
default_scope { includes(:failed_execution).where.not(failed_execution: { id: nil }) }
|
7
7
|
|
8
8
|
def enqueued_at
|
9
9
|
Time.parse(arguments["enqueued_at"])
|
@@ -5,17 +5,16 @@
|
|
5
5
|
<%= csrf_meta_tags %>
|
6
6
|
<%= csp_meta_tag %>
|
7
7
|
|
8
|
-
|
8
|
+
<%= stylesheet_link_tag "panoptic/application" %>
|
9
|
+
<%= javascript_include_tag "panoptic/application", defer: true %>
|
9
10
|
</head>
|
10
11
|
<body class="pb-4">
|
11
12
|
|
12
|
-
<%= render "shared/navbar" %>
|
13
|
+
<%= render "panoptic/shared/navbar" %>
|
13
14
|
|
14
15
|
<main class="container mt-2">
|
15
|
-
<%= render "shared/flashes" %>
|
16
|
+
<%= render "panoptic/shared/flashes" %>
|
16
17
|
<%= content_for?(:content) ? yield(:content) : yield %>
|
17
18
|
</main>
|
18
|
-
|
19
|
-
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
|
20
19
|
</body>
|
21
20
|
</html>
|
@@ -9,5 +9,10 @@
|
|
9
9
|
<%= button_to "Retry Job", job_retry_path(job),
|
10
10
|
class: "btn btn-link",
|
11
11
|
form_class: "d-inline" %>
|
12
|
+
<%= button_to "Delete Job", failed_job_path(job),
|
13
|
+
method: :delete,
|
14
|
+
form: { data: { turbo_confirm: "Are you sure you want delete?" } },
|
15
|
+
class: "btn btn-link text-danger",
|
16
|
+
form_class: "d-inline" %>
|
12
17
|
</td>
|
13
18
|
</tr>
|
data/config/importmap.rb
ADDED
data/config/routes.rb
CHANGED
@@ -7,8 +7,8 @@ Panoptic::Engine.routes.draw do
|
|
7
7
|
resource :retry, only: :create, module: :jobs
|
8
8
|
end
|
9
9
|
|
10
|
-
scope module: :jobs do
|
10
|
+
scope :jobs, module: :jobs do
|
11
11
|
resources :scheduled, only: :index, as: :scheduled_jobs
|
12
|
-
resources :failed, only: [:index, :show], as: :failed_jobs
|
12
|
+
resources :failed, only: [:index, :show, :destroy], as: :failed_jobs
|
13
13
|
end
|
14
14
|
end
|
data/lib/panoptic/engine.rb
CHANGED
@@ -1,9 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "turbo-rails"
|
3
4
|
require "pagy"
|
4
5
|
|
5
6
|
module Panoptic
|
6
7
|
class Engine < ::Rails::Engine
|
7
8
|
isolate_namespace Panoptic
|
9
|
+
|
10
|
+
initializer "panoptic.assets.precompile" do |app|
|
11
|
+
app.config.assets.precompile += %w[panoptic_manifest.js]
|
12
|
+
end
|
8
13
|
end
|
9
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.5.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: 2024-01-
|
11
|
+
date: 2024-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '6.2'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: turbo-rails
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.5'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.5'
|
55
69
|
description: Panoptic adds a real time web interface on top of SolidQueue to monitor
|
56
70
|
processes, queues and jobs
|
57
71
|
email:
|
@@ -60,8 +74,14 @@ executables: []
|
|
60
74
|
extensions: []
|
61
75
|
extra_rdoc_files: []
|
62
76
|
files:
|
77
|
+
- LICENSE
|
63
78
|
- README.md
|
64
79
|
- Rakefile
|
80
|
+
- app/assets/builds/panoptic/application.css
|
81
|
+
- app/assets/builds/panoptic/application.js
|
82
|
+
- app/assets/config/panoptic_manifest.js
|
83
|
+
- app/assets/javascripts/panoptic/application.js
|
84
|
+
- app/assets/stylesheets/panoptic/application.scss
|
65
85
|
- app/controllers/panoptic/application_controller.rb
|
66
86
|
- app/controllers/panoptic/jobs/failed_controller.rb
|
67
87
|
- app/controllers/panoptic/jobs/retries_controller.rb
|
@@ -87,8 +107,9 @@ files:
|
|
87
107
|
- app/views/panoptic/processes/index.html.erb
|
88
108
|
- app/views/panoptic/queues/_queue.html.erb
|
89
109
|
- app/views/panoptic/queues/index.html.erb
|
90
|
-
- app/views/shared/_flashes.html.erb
|
91
|
-
- app/views/shared/_navbar.html.erb
|
110
|
+
- app/views/panoptic/shared/_flashes.html.erb
|
111
|
+
- app/views/panoptic/shared/_navbar.html.erb
|
112
|
+
- config/importmap.rb
|
92
113
|
- config/initializers/pagy.rb
|
93
114
|
- config/routes.rb
|
94
115
|
- lib/panoptic.rb
|
File without changes
|
File without changes
|