panoptic 0.1.1 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ffd2df5c200efbb2a0807cfbcbcb0b2ffc3dd6045577af41d5e36d3d695a7866
4
- data.tar.gz: 60b28f52cccafb095f3ef313ce958198ca0f01fb32981de0b4429ba69d489985
3
+ metadata.gz: 92d310e17406ea0681469b5f4f4ff1d456b9d24ad4c89d4498adc87643f9ed8c
4
+ data.tar.gz: 9e2faccbac6daf2820c63202adc28292918934e596462443b046be5d4b874c72
5
5
  SHA512:
6
- metadata.gz: 02a533dbc94921173ad5cb39360b6f3c06ede8ecd602a93ff3d039a609d6717772abe7f3a5d496f563c6586dfd53acdb0772968825fed735bfe191a8485ca663
7
- data.tar.gz: b1893a8603182fe8be1596c4238c0ed39a7349415ece36ae96d81e1ae2f47ccf6d47b5c45af03116af0f160c2e6c0de6465e5ebf264edcfe1893e0c85979b47e
6
+ metadata.gz: b596a1d4224631ffb6f1e619958bbed94c20c4bfcb6c64fd967045efd40d785be72d2393b1317dc239866be6ba35952eebbf3eeac22e02cc270626475f325328
7
+ data.tar.gz: b07d2227e30e712aedaeb5d1213991fba6cb5e467f67466795c3b1fd8d10a92e9fa5c9a98e86f6afc2a71bd2ac4de963c3a5de2a49a3f74494973c666227d4ba
@@ -2,8 +2,10 @@
2
2
 
3
3
  module Panoptic
4
4
  class JobsController < ApplicationController
5
+ include Pagy::Backend
6
+
5
7
  def index
6
- @jobs = SolidQueue::Job.order(created_at: :asc).page(params[:page])
8
+ @pagy, @jobs = pagy(SolidQueue::Job.order(created_at: :asc))
7
9
  end
8
10
  end
9
11
  end
@@ -1,4 +1,5 @@
1
1
  module Panoptic
2
2
  module ApplicationHelper
3
+ include Pagy::Frontend
3
4
  end
4
5
  end
@@ -5,7 +5,6 @@
5
5
  <%= csrf_meta_tags %>
6
6
  <%= csp_meta_tag %>
7
7
 
8
- <%= stylesheet_link_tag "panoptic/application", media: "all" %>
9
8
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
10
9
  </head>
11
10
  <body>
@@ -1,9 +1,7 @@
1
1
  <h1>Jobs</h1>
2
2
 
3
3
  <div class="d-flex justify-content-end">
4
- <div>
5
- <%= page_entries_info @jobs %>
6
- </div>
4
+ <%== pagy_info(@pagy) %>
7
5
  </div>
8
6
 
9
7
  <table class="table">
@@ -24,5 +22,5 @@
24
22
  </table>
25
23
 
26
24
  <div class="d-flex justify-content-center">
27
- <%= paginate @jobs, views_prefix: "panoptic" %>
25
+ <%== pagy_bootstrap_nav(@pagy) if @pagy.pages > 1 %>
28
26
  </div>
@@ -0,0 +1 @@
1
+ require "pagy/extras/bootstrap"
@@ -1,3 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "pagy"
4
+
1
5
  module Panoptic
2
6
  class Engine < ::Rails::Engine
3
7
  isolate_namespace Panoptic
@@ -1,3 +1,3 @@
1
1
  module Panoptic
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: panoptic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vincent Rolea
@@ -39,19 +39,19 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0.1'
41
41
  - !ruby/object:Gem::Dependency
42
- name: kaminari
42
+ name: pagy
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.2'
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: '1.2'
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
@@ -74,18 +74,12 @@ files:
74
74
  - app/views/layouts/panoptic/application.html.erb
75
75
  - app/views/panoptic/jobs/_job.html.erb
76
76
  - 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
77
  - app/views/panoptic/processes/_process.html.erb
85
78
  - app/views/panoptic/processes/index.html.erb
86
79
  - app/views/panoptic/queues/_queue.html.erb
87
80
  - app/views/panoptic/queues/index.html.erb
88
81
  - app/views/shared/_navbar.html.erb
82
+ - config/initializers/pagy.rb
89
83
  - config/routes.rb
90
84
  - lib/panoptic.rb
91
85
  - lib/panoptic/engine.rb
@@ -1,3 +0,0 @@
1
- <li class="page-item">
2
- <%= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, remote: remote, class: 'page-link' %>
3
- </li>
@@ -1,3 +0,0 @@
1
- <li class='page-item disabled'>
2
- <%= link_to raw(t 'views.pagination.truncate'), '#', class: 'page-link' %>
3
- </li>
@@ -1,3 +0,0 @@
1
- <li class="page-item">
2
- <%= link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, remote: remote, class: 'page-link' %>
3
- </li>
@@ -1,3 +0,0 @@
1
- <li class="page-item">
2
- <%= link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, rel: 'next', remote: remote, class: 'page-link' %>
3
- </li>
@@ -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 %>
@@ -1,3 +0,0 @@
1
- <li class="page-item">
2
- <%= link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, rel: 'prev', remote: remote, class: 'page-link' %>
3
- </li>