solid_queue_interface 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.
Files changed (40) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +41 -0
  4. data/Rakefile +8 -0
  5. data/app/assets/config/solid_queue_interface_manifest.js +1 -0
  6. data/app/assets/javascripts/solid_queue_interface/application.js +15 -0
  7. data/app/assets/stylesheets/solid_queue_interface/application.css +15 -0
  8. data/app/controllers/solid_queue_interface/application_controller.rb +4 -0
  9. data/app/controllers/solid_queue_interface/jobs_controller.rb +41 -0
  10. data/app/controllers/solid_queue_interface/processes_controller.rb +7 -0
  11. data/app/controllers/solid_queue_interface/queues_controller.rb +23 -0
  12. data/app/controllers/solid_queue_interface/semaphores_controller.rb +7 -0
  13. data/app/helpers/solid_queue_interface/application_helper.rb +4 -0
  14. data/app/helpers/solid_queue_interface/jobs_helper.rb +4 -0
  15. data/app/helpers/solid_queue_interface/processes_helper.rb +4 -0
  16. data/app/helpers/solid_queue_interface/queues_helper.rb +4 -0
  17. data/app/helpers/solid_queue_interface/semaphores_helper.rb +4 -0
  18. data/app/jobs/solid_queue_interface/application_job.rb +4 -0
  19. data/app/mailers/solid_queue_interface/application_mailer.rb +6 -0
  20. data/app/models/solid_queue_interface/application_record.rb +5 -0
  21. data/app/views/layouts/solid_queue_interface/_navbar.html.erb +14 -0
  22. data/app/views/layouts/solid_queue_interface/application.html.erb +15 -0
  23. data/app/views/solid_queue_interface/jobs/blocked.html.erb +27 -0
  24. data/app/views/solid_queue_interface/jobs/claimed.html.erb +21 -0
  25. data/app/views/solid_queue_interface/jobs/failed.html.erb +27 -0
  26. data/app/views/solid_queue_interface/jobs/index.html.erb +33 -0
  27. data/app/views/solid_queue_interface/jobs/ready.html.erb +23 -0
  28. data/app/views/solid_queue_interface/jobs/recurring.html.erb +23 -0
  29. data/app/views/solid_queue_interface/jobs/scheduled.html.erb +25 -0
  30. data/app/views/solid_queue_interface/jobs/show.html.erb +26 -0
  31. data/app/views/solid_queue_interface/processes/index.html.erb +35 -0
  32. data/app/views/solid_queue_interface/queues/index.html.erb +25 -0
  33. data/app/views/solid_queue_interface/queues/paused.html.erb +19 -0
  34. data/app/views/solid_queue_interface/semaphores/index.html.erb +25 -0
  35. data/config/routes.rb +23 -0
  36. data/lib/solid_queue_interface/engine.rb +9 -0
  37. data/lib/solid_queue_interface/version.rb +3 -0
  38. data/lib/solid_queue_interface.rb +6 -0
  39. data/lib/tasks/solid_queue_interface_tasks.rake +4 -0
  40. metadata +112 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: f4867a44e6340fff2c02f6410ca2de07b19322dd0072f5817e3fbe6f5743f616
4
+ data.tar.gz: 52dd205bc38a532bc788962c393ac5b0b903c4f4030bac851ab12ae623196f39
5
+ SHA512:
6
+ metadata.gz: 69c518fab0517a039b8789036175779c0dc87274cb8a49942da42f905fb84d3e2648579d08384d1f1942e9d7c526834ee442375c69fb1caed3798e5bfe46b888
7
+ data.tar.gz: 2f345acfbcee720a32d92b50b1f7319385cf2105c3f8d57b5b8ccc2ea13d26d5184fcf567b49a23c1ca27daa83a0b2e834d7b062472ab365b037090fefa7f930
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright AquisTech
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # SolidQueueInterface
2
+ This gem provides interface for managing background jobs via [solid_queue](https://github.com/rails/solid_queue) gem. Apart from listing jobs, this gem also provides managing queues, processes. It also acts as a control center to perform functionalities like 'Retry Failed Job', 'Pause Queue' and 'Resume Queue'
3
+
4
+ ## Installation
5
+ Add this line to your application's Gemfile:
6
+
7
+ ```ruby
8
+ gem "solid_queue_interface"
9
+ ```
10
+
11
+ And then execute:
12
+ ```bash
13
+ $ bundle
14
+ ```
15
+
16
+ ## Usage
17
+ Update `config/routes.rb` to mount `SolidQueueInterface::Engine` like so:
18
+ ```bash
19
+ Rails.application.routes.draw do
20
+ mount SolidQueueInterface::Engine => '/solid_queue_interface'
21
+
22
+ # all your routes.
23
+ end
24
+ ```
25
+ Now you can access SolidQueueInterface at `<YOUR_URL>/solid_queue_interface`
26
+
27
+ ## ToDo
28
+ * Pagination with `pagy` gem
29
+ * Basic styling support
30
+ * Sorting on columns
31
+ * Searching on columns
32
+ * Generator to copy views to your project for overriding
33
+
34
+ ## Contributing
35
+ Bug reports, feature requests and pull requests are welcome on GitHub at [https://github.com/aquistech/solid_queue_interface](https://github.com/aquistech/solid_queue_interface). This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/aquistech/solid_queue_interface/blob/main/CODE_OF_CONDUCT.md).
36
+
37
+ ## License
38
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
39
+
40
+ ## Code of Conduct
41
+ Everyone interacting in the RailsInteractiveGenerators project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/aquistech/solid_queue_interface/blob/main/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ require "bundler/setup"
2
+
3
+ APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
4
+ load "rails/tasks/engine.rake"
5
+
6
+ load "rails/tasks/statistics.rake"
7
+
8
+ require "bundler/gem_tasks"
@@ -0,0 +1 @@
1
+ //= link_directory ../stylesheets/solid_queue_interface .css
@@ -0,0 +1,15 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file. JavaScript code in this file should be added after the last require_* statement.
9
+ //
10
+ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require rails-ujs
14
+ //= require activestorage
15
+ //= require_tree .
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,4 @@
1
+ module SolidQueueInterface
2
+ class ApplicationController < ActionController::Base
3
+ end
4
+ end
@@ -0,0 +1,41 @@
1
+ module SolidQueueInterface
2
+ class JobsController < ApplicationController
3
+ def index
4
+ @jobs = SolidQueue::Job.order(created_at: :desc)
5
+ end
6
+
7
+ def scheduled
8
+ @jobs = SolidQueue::ScheduledExecution.order(created_at: :desc)
9
+ end
10
+
11
+ def failed
12
+ @jobs = SolidQueue::FailedExecution.order(created_at: :desc)
13
+ end
14
+
15
+ def blocked
16
+ @jobs = SolidQueue::BlockedExecution.order(created_at: :desc)
17
+ end
18
+
19
+ def claimed
20
+ @jobs = SolidQueue::ClaimedExecution.order(created_at: :desc)
21
+ end
22
+
23
+ def ready
24
+ @jobs = SolidQueue::ReadyExecution.order(created_at: :desc)
25
+ end
26
+
27
+ def recurring
28
+ @jobs = SolidQueue::RecurringExecution.order(created_at: :desc)
29
+ end
30
+
31
+ def show
32
+ @job = SolidQueue::FailedExecution.find(params[:id])
33
+ end
34
+
35
+ def retry
36
+ @job = SolidQueue::Job.find(params[:id])
37
+ @job.retry
38
+ redirect_to failed_solid_queue_interface_jobs_path, notice: "Successfully retried Job ##{@job.id}"
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,7 @@
1
+ module SolidQueueInterface
2
+ class ProcessesController < ApplicationController
3
+ def index
4
+ @processes = SolidQueue::Process.all
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,23 @@
1
+ module SolidQueueInterface
2
+ class QueuesController < ApplicationController
3
+ def index
4
+ @queues = SolidQueue::Queue.all
5
+ end
6
+
7
+ def paused
8
+ @queues = SolidQueue::Pause.all
9
+ end
10
+
11
+ def pause
12
+ @queue = SolidQueue::Queue.find_by_name(params[:queue_name])
13
+ @queue.pause
14
+ redirect_to solid_queue_interface_queues_path, notice: "Successfully paused queue: #{params[:queue_name]}"
15
+ end
16
+
17
+ def resume
18
+ @queue = SolidQueue::Queue.find_by_name(params[:queue_name])
19
+ @queue.resume
20
+ redirect_to solid_queue_interface_queues_path, notice: "Successfully resumed queue: #{params[:queue_name]}"
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,7 @@
1
+ module SolidQueueInterface
2
+ class SemaphoresController < ApplicationController
3
+ def index
4
+ @semaphores = SolidQueue::Semaphore.all
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,4 @@
1
+ module SolidQueueInterface
2
+ module ApplicationHelper
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module SolidQueueInterface
2
+ module JobsHelper
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module SolidQueueInterface
2
+ module ProcessesHelper
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module SolidQueueInterface
2
+ module QueuesHelper
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module SolidQueueInterface
2
+ module SemaphoresHelper
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module SolidQueueInterface
2
+ class ApplicationJob < ActiveJob::Base
3
+ end
4
+ end
@@ -0,0 +1,6 @@
1
+ module SolidQueueInterface
2
+ class ApplicationMailer < ActionMailer::Base
3
+ default from: "from@example.com"
4
+ layout "mailer"
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ module SolidQueueInterface
2
+ class ApplicationRecord < ActiveRecord::Base
3
+ self.abstract_class = true
4
+ end
5
+ end
@@ -0,0 +1,14 @@
1
+ <header class='navbar'>
2
+ <%= link_to 'SolidQueueInterface', root_path, class: 'navbar-link' %>
3
+ <%= link_to 'Processes', solid_queue_interface_processes_path, class: 'navbar-link' %>
4
+ <%= link_to 'All Queues', solid_queue_interface_queues_path, class: 'navbar-link' %>
5
+ <%= link_to 'Paused Queues', paused_solid_queue_interface_queues_path, class: 'navbar-link' %>
6
+ <%= link_to 'All Jobs', solid_queue_interface_jobs_path, class: 'navbar-link' %>
7
+ <%= link_to 'Scheduled Jobs', scheduled_solid_queue_interface_jobs_path, class: 'navbar-link' %>
8
+ <%= link_to 'Failed Jobs', failed_solid_queue_interface_jobs_path, class: 'navbar-link' %>
9
+ <%= link_to 'Blocked Jobs', blocked_solid_queue_interface_jobs_path, class: 'navbar-link' %>
10
+ <%= link_to 'Claimed Jobs', claimed_solid_queue_interface_jobs_path, class: 'navbar-link' %>
11
+ <%= link_to 'Ready Jobs', ready_solid_queue_interface_jobs_path, class: 'navbar-link' %>
12
+ <%= link_to 'Recurring Jobs', recurring_solid_queue_interface_jobs_path, class: 'navbar-link' %>
13
+ <%= link_to 'Semaphores', solid_queue_interface_semaphores_path, class: 'navbar-link' %>
14
+ </header>
@@ -0,0 +1,15 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Solid queue interface</title>
5
+ <%= csrf_meta_tags %>
6
+ <%= csp_meta_tag %>
7
+
8
+ <%= stylesheet_link_tag "solid_queue_interface/application", media: "all" %>
9
+ </head>
10
+ <body id='solid_queue_interface' class='solid_queue_interface-<%= controller_name %>-<%= action_name %>'>
11
+ <%= render partial: 'layouts/solid_queue_interface/navbar' %>
12
+ <%= yield %>
13
+
14
+ </body>
15
+ </html>
@@ -0,0 +1,27 @@
1
+ <h1>Blocked Executions</h1>
2
+ <table class='table'>
3
+ <thead class='thead'>
4
+ <tr class='thead-tr'>
5
+ <th class='thead-th'>ID</th>
6
+ <th class='thead-th'>Job ID</th>
7
+ <th class='thead-th'>Queue</th>
8
+ <th class='thead-th'>Priority</th>
9
+ <th class='thead-th'>Concurrency Key</th>
10
+ <th class='thead-th'>Created</th>
11
+ <th class='thead-th'>Expires</th>
12
+ </tr>
13
+ </thead>
14
+ <tbody class='tbody'>
15
+ <% @jobs.each do |job| %>
16
+ <tr class='tbody-tr'>
17
+ <td class='tbody-td'><%= job.id %></td>
18
+ <td class='tbody-td'><%= job.job_id %></td>
19
+ <td class='tbody-td'><%= job.queue_name %></td>
20
+ <td class='tbody-td'><%= job.priority %></td>
21
+ <td class='tbody-td'><%= job.concurrency_key %></td>
22
+ <td class='tbody-td'><%= job.created_at %></td>
23
+ <td class='tbody-td'><%= job.expires_at %></td>
24
+ </tr>
25
+ <% end %>
26
+ </tbody>
27
+ </table>
@@ -0,0 +1,21 @@
1
+ <h1>Claimed Executions</h1>
2
+ <table class='table'>
3
+ <thead class='thead'>
4
+ <tr class='thead-tr'>
5
+ <th class='thead-th'>ID</th>
6
+ <th class='thead-th'>Job ID</th>
7
+ <th class='thead-th'>Process ID</th>
8
+ <th class='thead-th'>Created</th>
9
+ </tr>
10
+ </thead>
11
+ <tbody class='tbody'>
12
+ <% @jobs.each do |job| %>
13
+ <tr class='tbody-tr'>
14
+ <td class='tbody-td'><%= job.id %></td>
15
+ <td class='tbody-td'><%= job.job_id %></td>
16
+ <td class='tbody-td'><%= job.process_id %></td>
17
+ <td class='tbody-td'><%= job.created_at %></td>
18
+ </tr>
19
+ <% end %>
20
+ </tbody>
21
+ </table>
@@ -0,0 +1,27 @@
1
+ <h1>Failed Executions</h1>
2
+ <table class='table'>
3
+ <thead class='thead'>
4
+ <tr class='thead-tr'>
5
+ <th class='thead-th'>ID</th>
6
+ <th class='thead-th'>Job ID</th>
7
+ <th class='thead-th'>Exception Class</th>
8
+ <th class='thead-th'>Exception Message</th>
9
+ <th class='thead-th'>Error Details</th>
10
+ <th class='thead-th'>Created</th>
11
+ <th class='thead-th'>Retry</th>
12
+ </tr>
13
+ </thead>
14
+ <tbody class='tbody'>
15
+ <% @jobs.each do |job| %>
16
+ <tr class='tbody-tr'>
17
+ <td class='tbody-td'><%= job.id %></td>
18
+ <td class='tbody-td'><%= job.job_id %></td>
19
+ <td class='tbody-td'><%= job.exception_class %></td>
20
+ <td class='tbody-td'><%= job.message %></td>
21
+ <td class='tbody-td'><%= link_to 'Backtrace', solid_queue_interface_job_path(job) %></td>
22
+ <td class='tbody-td'><%= job.created_at %></td>
23
+ <td class='tbody-td'><%= button_to "Retry Job", retry_solid_queue_interface_job_path(job) %></td>
24
+ </tr>
25
+ <% end %>
26
+ </tbody>
27
+ </table>
@@ -0,0 +1,33 @@
1
+ <h1>All Jobs</h1>
2
+ <table class='table'>
3
+ <thead class='thead'>
4
+ <tr class='thead-tr'>
5
+ <th class='thead-th'>ID</th>
6
+ <th class='thead-th'>Class</th>
7
+ <th class='thead-th'>Queue</th>
8
+ <th class='thead-th'>Arguments</th>
9
+ <th class='thead-th'>Priority</th>
10
+ <th class='thead-th'>Active Job ID</th>
11
+ <th class='thead-th'>Concurrency Key</th>
12
+ <th class='thead-th'>Created</th>
13
+ <th class='thead-th'>Scheduled</th>
14
+ <th class='thead-th'>Finished</th>
15
+ </tr>
16
+ </thead>
17
+ <tbody class='tbody'>
18
+ <% @jobs.each do |job| %>
19
+ <tr class='tbody-tr'>
20
+ <td class='tbody-td'><%= job.id %></td>
21
+ <td class='tbody-td'><%= job.class_name %></td>
22
+ <td class='tbody-td'><%= job.queue_name %></td>
23
+ <td class='tbody-td'><%= job.arguments %></td>
24
+ <td class='tbody-td'><%= job.priority %></td>
25
+ <td class='tbody-td'><%= job.active_job_id %></td>
26
+ <td class='tbody-td'><%= job.concurrency_key %></td>
27
+ <td class='tbody-td'><%= job.created_at %></td>
28
+ <td class='tbody-td'><%= job.scheduled_at %></td>
29
+ <td class='tbody-td'><%= job.finished_at %></td>
30
+ </tr>
31
+ <% end %>
32
+ </tbody>
33
+ </table>
@@ -0,0 +1,23 @@
1
+ <h1>Ready Executions</h1>
2
+ <table class='table'>
3
+ <thead class='thead'>
4
+ <tr class='thead-tr'>
5
+ <th class='thead-th'>ID</th>
6
+ <th class='thead-th'>Job ID</th>
7
+ <th class='thead-th'>Queue</th>
8
+ <th class='thead-th'>Priority</th>
9
+ <th class='thead-th'>Created</th>
10
+ </tr>
11
+ </thead>
12
+ <tbody class='tbody'>
13
+ <% @jobs.each do |job| %>
14
+ <tr class='tbody-tr'>
15
+ <td class='tbody-td'><%= job.id %></td>
16
+ <td class='tbody-td'><%= job.job_id %></td>
17
+ <td class='tbody-td'><%= job.queue_name %></td>
18
+ <td class='tbody-td'><%= job.priority %></td>
19
+ <td class='tbody-td'><%= job.created_at %></td>
20
+ </tr>
21
+ <% end %>
22
+ </tbody>
23
+ </table>
@@ -0,0 +1,23 @@
1
+ <h1>Recurring Executions</h1>
2
+ <table class='table'>
3
+ <thead class='thead'>
4
+ <tr class='thead-tr'>
5
+ <th class='thead-th'>ID</th>
6
+ <th class='thead-th'>Job ID</th>
7
+ <th class='thead-th'>Task Key</th>
8
+ <th class='thead-th'>Run At</th>
9
+ <th class='thead-th'>Created</th>
10
+ </tr>
11
+ </thead>
12
+ <tbody class='tbody'>
13
+ <% @jobs.each do |job| %>
14
+ <tr class='tbody-tr'>
15
+ <td class='tbody-td'><%= job.id %></td>
16
+ <td class='tbody-td'><%= job.job_id %></td>
17
+ <td class='tbody-td'><%= job.task_key %></td>
18
+ <td class='tbody-td'><%= job.run_at %></td>
19
+ <td class='tbody-td'><%= job.created_at %></td>
20
+ </tr>
21
+ <% end %>
22
+ </tbody>
23
+ </table>
@@ -0,0 +1,25 @@
1
+ <h1>Scheduled Executions</h1>
2
+ <table class='table'>
3
+ <thead class='thead'>
4
+ <tr class='thead-tr'>
5
+ <th class='thead-th'>ID</th>
6
+ <th class='thead-th'>Job ID</th>
7
+ <th class='thead-th'>Queue</th>
8
+ <th class='thead-th'>Priority</th>
9
+ <th class='thead-th'>Created</th>
10
+ <th class='thead-th'>Scheduled</th>
11
+ </tr>
12
+ </thead>
13
+ <tbody class='tbody'>
14
+ <% @jobs.each do |job| %>
15
+ <tr class='tbody-tr'>
16
+ <td class='tbody-td'><%= job.id %></td>
17
+ <td class='tbody-td'><%= job.job_id %></td>
18
+ <td class='tbody-td'><%= job.queue_name %></td>
19
+ <td class='tbody-td'><%= job.priority %></td>
20
+ <td class='tbody-td'><%= job.created_at %></td>
21
+ <td class='tbody-td'><%= job.scheduled_at %></td>
22
+ </tr>
23
+ <% end %>
24
+ </tbody>
25
+ </table>
@@ -0,0 +1,26 @@
1
+ <h1>Failed Executions Details For #<%= @job.id %></h1>
2
+ <table class='table'>
3
+ <thead class='thead'>
4
+ <tr class='thead-tr'>
5
+ <th class='thead-th'>Attribute</th>
6
+ <th class='thead-th'>Details</th>
7
+ </tr>
8
+ </thead>
9
+ <tbody class='tbody'>
10
+ <% attributes = { id: 'ID', job_id: 'Job ID', created_at: 'Created', exception_class: 'Exception Class', message: 'Exception Message' } %>
11
+ <% attributes.each do |method, title| %>
12
+ <tr class='tbody-tr'>
13
+ <td class='tbody-td'><b><%= title %></b></td>
14
+ <td class='tbody-td'><%= @job.send(method) %></td>
15
+ </tr>
16
+ <% end %>
17
+ <tr class='tbody-tr'>
18
+ <td class='tbody-td'><b>Backtrace</b></td>
19
+ <td class='tbody-td'><%= @job.backtrace.join("<br>").html_safe %></td>
20
+ </tr>
21
+ <tr class='tbody-tr'>
22
+ <td class='tbody-td'><b>Action</b></td>
23
+ <td class='tbody-td'><%= button_to "Retry Job", retry_solid_queue_interface_job_path(@job) %></td>
24
+ </tr>
25
+ </tbody>
26
+ </table>
@@ -0,0 +1,35 @@
1
+ <h1>Processes</h1>
2
+ <table class='table'>
3
+ <thead class='thead'>
4
+ <tr class='thead-tr'>
5
+ <th class='thead-th'>ID</th>
6
+ <th class='thead-th'>Kind</th>
7
+ <th class='thead-th'>Last Heartbeat At</th>
8
+ <th class='thead-th'>Supervisor</th>
9
+ <th class='thead-th'>PID</th>
10
+ <th class='thead-th'>Hostname</th>
11
+ <th class='thead-th'>Metadata</th>
12
+ <th class='thead-th'>Created</th>
13
+ </tr>
14
+ </thead>
15
+ <tbody class='tbody'>
16
+ <% @processes.each do |process| %>
17
+ <tr class='tbody-tr'>
18
+ <td class='tbody-td'><%= process.id %></td>
19
+ <td class='tbody-td'><%= process.kind %></td>
20
+ <td class='tbody-td'><%= process.last_heartbeat_at %></td>
21
+ <td class='tbody-td'><%= process.supervisor_id %></td>
22
+ <td class='tbody-td'><%= process.pid %></td>
23
+ <td class='tbody-td'><%= process.hostname %></td>
24
+ <td class='tbody-td'>
25
+ <ul>
26
+ <% process.metadata.each do |setting, value| %>
27
+ <li><%= setting %>: <%= value %></li>
28
+ <% end %>
29
+ </ul>
30
+ </td>
31
+ <td class='tbody-td'><%= process.created_at %></td>
32
+ </tr>
33
+ <% end %>
34
+ </tbody>
35
+ </table>
@@ -0,0 +1,25 @@
1
+ <h1>All Queues</h1>
2
+ <table class='table'>
3
+ <thead class='thead'>
4
+ <tr class='thead-tr'>
5
+ <th class='thead-th'>Name</th>
6
+ <th class='thead-th'>Size</th>
7
+ <th class='thead-th'>Action</th>
8
+ </tr>
9
+ </thead>
10
+ <tbody class='tbody'>
11
+ <% @queues.each do |queue| %>
12
+ <tr class='tbody-tr'>
13
+ <td class='tbody-td'><%= queue.name %></td>
14
+ <td class='tbody-td'><%= queue.size %></td>
15
+ <td class='tbody-td'>
16
+ <% if queue.paused? %>
17
+ <%= button_to 'Resume', resume_solid_queue_interface_queue_path(queue.name) %>
18
+ <% else %>
19
+ <%= button_to 'Pause', pause_solid_queue_interface_queue_path(queue.name) %>
20
+ <% end %>
21
+ </td>
22
+ </tr>
23
+ <% end %>
24
+ </tbody>
25
+ </table>
@@ -0,0 +1,19 @@
1
+ <h1>Paused Queues</h1>
2
+ <table class='table'>
3
+ <thead class='thead'>
4
+ <tr class='thead-tr'>
5
+ <th class='thead-th'>#</th>
6
+ <th class='thead-th'>Name</th>
7
+ <th class='thead-th'>Created</th>
8
+ </tr>
9
+ </thead>
10
+ <tbody class='tbody'>
11
+ <% @queues.each do |queue| %>
12
+ <tr class='tbody-tr'>
13
+ <td class='tbody-td'><%= queue.id %></td>
14
+ <td class='tbody-td'><%= queue.queue_name %></td>
15
+ <td class='tbody-td'><%= queue.created_at %></td>
16
+ </tr>
17
+ <% end %>
18
+ </tbody>
19
+ </table>
@@ -0,0 +1,25 @@
1
+ <h1>Semaphores</h1>
2
+ <table class='table'>
3
+ <thead class='thead'>
4
+ <tr class='thead-tr'>
5
+ <th class='thead-th'>ID</th>
6
+ <th class='thead-th'>Key</th>
7
+ <th class='thead-th'>Value</th>
8
+ <th class='thead-th'>Created</th>
9
+ <th class='thead-th'>Updated</th>
10
+ <th class='thead-th'>Expires</th>
11
+ </tr>
12
+ </thead>
13
+ <tbody class='tbody'>
14
+ <% @semaphores.each do |semaphore| %>
15
+ <tr class='tbody-tr'>
16
+ <td class='tbody-td'><%= semaphore.id %></td>
17
+ <td class='tbody-td'><%= semaphore.key %></td>
18
+ <td class='tbody-td'><%= semaphore.value %></td>
19
+ <td class='tbody-td'><%= semaphore.created_at %></td>
20
+ <td class='tbody-td'><%= semaphore.updated_at %></td>
21
+ <td class='tbody-td'><%= semaphore.expires_at %></td>
22
+ </tr>
23
+ <% end %>
24
+ </tbody>
25
+ </table>
data/config/routes.rb ADDED
@@ -0,0 +1,23 @@
1
+ SolidQueueInterface::Engine.routes.draw do
2
+ resources :jobs, only: [:index, :show], as: :solid_queue_interface_jobs do
3
+ get :scheduled, on: :collection
4
+ get :failed, on: :collection
5
+ get :blocked, on: :collection
6
+ get :claimed, on: :collection
7
+ get :ready, on: :collection
8
+ get :recurring, on: :collection
9
+ post :retry, on: :member
10
+ end
11
+
12
+ resources :queues, only: :index, param: :queue_name, as: :solid_queue_interface_queues do
13
+ get :paused, on: :collection
14
+ post :pause, on: :member
15
+ post :resume, on: :member
16
+ end
17
+
18
+ resources :semaphores, only: :index, as: :solid_queue_interface_semaphores
19
+
20
+ resources :processes, only: :index, as: :solid_queue_interface_processes
21
+
22
+ root to: "jobs#index"
23
+ end
@@ -0,0 +1,9 @@
1
+ module SolidQueueInterface
2
+ class Engine < ::Rails::Engine
3
+ isolate_namespace SolidQueueInterface
4
+
5
+ initializer "panoptic.assets.precompile" do |app|
6
+ app.config.assets.precompile += %w[solid_queue_interface_manifest.js]
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,3 @@
1
+ module SolidQueueInterface
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,6 @@
1
+ require "solid_queue_interface/version"
2
+ require "solid_queue_interface/engine"
3
+
4
+ module SolidQueueInterface
5
+ # Your code goes here...
6
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :solid_queue_interface do
3
+ # # Task goes here
4
+ # end
metadata ADDED
@@ -0,0 +1,112 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: solid_queue_interface
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - AquisTech
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2024-04-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 7.1.3.2
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 7.1.3.2
27
+ - !ruby/object:Gem::Dependency
28
+ name: solid_queue
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.3.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.3.0
41
+ description: UI for monitoring solid_queue
42
+ email:
43
+ - aquis.tech@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - MIT-LICENSE
49
+ - README.md
50
+ - Rakefile
51
+ - app/assets/config/solid_queue_interface_manifest.js
52
+ - app/assets/javascripts/solid_queue_interface/application.js
53
+ - app/assets/stylesheets/solid_queue_interface/application.css
54
+ - app/controllers/solid_queue_interface/application_controller.rb
55
+ - app/controllers/solid_queue_interface/jobs_controller.rb
56
+ - app/controllers/solid_queue_interface/processes_controller.rb
57
+ - app/controllers/solid_queue_interface/queues_controller.rb
58
+ - app/controllers/solid_queue_interface/semaphores_controller.rb
59
+ - app/helpers/solid_queue_interface/application_helper.rb
60
+ - app/helpers/solid_queue_interface/jobs_helper.rb
61
+ - app/helpers/solid_queue_interface/processes_helper.rb
62
+ - app/helpers/solid_queue_interface/queues_helper.rb
63
+ - app/helpers/solid_queue_interface/semaphores_helper.rb
64
+ - app/jobs/solid_queue_interface/application_job.rb
65
+ - app/mailers/solid_queue_interface/application_mailer.rb
66
+ - app/models/solid_queue_interface/application_record.rb
67
+ - app/views/layouts/solid_queue_interface/_navbar.html.erb
68
+ - app/views/layouts/solid_queue_interface/application.html.erb
69
+ - app/views/solid_queue_interface/jobs/blocked.html.erb
70
+ - app/views/solid_queue_interface/jobs/claimed.html.erb
71
+ - app/views/solid_queue_interface/jobs/failed.html.erb
72
+ - app/views/solid_queue_interface/jobs/index.html.erb
73
+ - app/views/solid_queue_interface/jobs/ready.html.erb
74
+ - app/views/solid_queue_interface/jobs/recurring.html.erb
75
+ - app/views/solid_queue_interface/jobs/scheduled.html.erb
76
+ - app/views/solid_queue_interface/jobs/show.html.erb
77
+ - app/views/solid_queue_interface/processes/index.html.erb
78
+ - app/views/solid_queue_interface/queues/index.html.erb
79
+ - app/views/solid_queue_interface/queues/paused.html.erb
80
+ - app/views/solid_queue_interface/semaphores/index.html.erb
81
+ - config/routes.rb
82
+ - lib/solid_queue_interface.rb
83
+ - lib/solid_queue_interface/engine.rb
84
+ - lib/solid_queue_interface/version.rb
85
+ - lib/tasks/solid_queue_interface_tasks.rake
86
+ homepage: https://github.com/AquisTech/solid_queue_interface
87
+ licenses:
88
+ - MIT
89
+ metadata:
90
+ homepage_uri: https://github.com/AquisTech/solid_queue_interface
91
+ source_code_uri: https://github.com/AquisTech/solid_queue_interface
92
+ changelog_uri: https://github.com/AquisTech/solid_queue_interface
93
+ post_install_message:
94
+ rdoc_options: []
95
+ require_paths:
96
+ - lib
97
+ required_ruby_version: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ required_rubygems_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
107
+ requirements: []
108
+ rubygems_version: 3.1.2
109
+ signing_key:
110
+ specification_version: 4
111
+ summary: UI for monitoring solid_queue
112
+ test_files: []