karafka-web 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +3 -5
- data/CHANGELOG.md +12 -0
- data/Gemfile.lock +1 -1
- data/lib/karafka/web/config.rb +2 -0
- data/lib/karafka/web/tracking/consumers/reporter.rb +5 -3
- data/lib/karafka/web/ui/base.rb +6 -2
- data/lib/karafka/web/ui/controllers/base.rb +17 -0
- data/lib/karafka/web/ui/controllers/cluster.rb +5 -2
- data/lib/karafka/web/ui/controllers/consumers.rb +3 -1
- data/lib/karafka/web/ui/controllers/errors.rb +19 -6
- data/lib/karafka/web/ui/controllers/jobs.rb +3 -1
- data/lib/karafka/web/ui/controllers/requests/params.rb +10 -0
- data/lib/karafka/web/ui/lib/paginations/base.rb +61 -0
- data/lib/karafka/web/ui/lib/paginations/offset_based.rb +96 -0
- data/lib/karafka/web/ui/lib/paginations/page_based.rb +70 -0
- data/lib/karafka/web/ui/lib/paginations/paginators/arrays.rb +33 -0
- data/lib/karafka/web/ui/lib/paginations/paginators/base.rb +23 -0
- data/lib/karafka/web/ui/lib/paginations/paginators/partitions.rb +52 -0
- data/lib/karafka/web/ui/lib/paginations/paginators/sets.rb +85 -0
- data/lib/karafka/web/ui/lib/ttl_cache.rb +74 -0
- data/lib/karafka/web/ui/models/cluster_info.rb +59 -0
- data/lib/karafka/web/ui/models/message.rb +114 -38
- data/lib/karafka/web/ui/models/status.rb +3 -1
- data/lib/karafka/web/ui/pro/app.rb +11 -3
- data/lib/karafka/web/ui/pro/controllers/consumers.rb +3 -1
- data/lib/karafka/web/ui/pro/controllers/dlq.rb +1 -2
- data/lib/karafka/web/ui/pro/controllers/errors.rb +43 -10
- data/lib/karafka/web/ui/pro/controllers/explorer.rb +52 -7
- data/lib/karafka/web/ui/pro/views/errors/_breadcrumbs.erb +8 -6
- data/lib/karafka/web/ui/pro/views/errors/_error.erb +1 -1
- data/lib/karafka/web/ui/pro/views/errors/_partition_option.erb +1 -1
- data/lib/karafka/web/ui/pro/views/errors/_table.erb +21 -0
- data/lib/karafka/web/ui/pro/views/errors/_title_with_select.erb +31 -0
- data/lib/karafka/web/ui/pro/views/errors/index.erb +9 -56
- data/lib/karafka/web/ui/pro/views/errors/partition.erb +17 -0
- data/lib/karafka/web/ui/pro/views/explorer/_breadcrumbs.erb +1 -1
- data/lib/karafka/web/ui/pro/views/explorer/_message.erb +8 -2
- data/lib/karafka/web/ui/pro/views/explorer/_partition_option.erb +1 -1
- data/lib/karafka/web/ui/pro/views/explorer/_topic.erb +1 -1
- data/lib/karafka/web/ui/pro/views/explorer/partition/_messages.erb +1 -0
- data/lib/karafka/web/ui/pro/views/explorer/partition.erb +1 -1
- data/lib/karafka/web/ui/pro/views/explorer/topic/_empty.erb +3 -0
- data/lib/karafka/web/ui/pro/views/explorer/topic/_limited.erb +4 -0
- data/lib/karafka/web/ui/pro/views/explorer/topic/_partitions.erb +11 -0
- data/lib/karafka/web/ui/pro/views/explorer/topic.erb +49 -0
- data/lib/karafka/web/ui/pro/views/shared/_navigation.erb +1 -1
- data/lib/karafka/web/ui/views/cluster/_partition.erb +1 -1
- data/lib/karafka/web/ui/views/errors/_error.erb +1 -1
- data/lib/karafka/web/ui/views/shared/_pagination.erb +16 -12
- data/lib/karafka/web/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +18 -3
- metadata.gz.sig +0 -0
- data/lib/karafka/web/ui/lib/paginate_array.rb +0 -38
@@ -1,65 +1,18 @@
|
|
1
|
-
|
2
|
-
<div class="row">
|
3
|
-
<div class="col">
|
4
|
-
<h3>
|
5
|
-
Errors
|
6
|
-
</h3>
|
7
|
-
</div>
|
8
|
-
|
9
|
-
<div class="col">
|
10
|
-
<div class="col-auto text-end">
|
11
|
-
<label class="col-form-label">Partition</label>
|
12
|
-
</div>
|
13
|
-
</div>
|
14
|
-
|
15
|
-
<div class="col pt-1 mb-0 pb-0">
|
16
|
-
<div class="col-auto">
|
17
|
-
<select class="form-select form-select-sm mb-0 form-control" id="current-partition">
|
18
|
-
<%==
|
19
|
-
each_partial(
|
20
|
-
@partitions_count.times.to_a,
|
21
|
-
'errors/partition_option',
|
22
|
-
local: :partition
|
23
|
-
)
|
24
|
-
%>
|
25
|
-
</select>
|
26
|
-
</div>
|
27
|
-
</div>
|
28
|
-
</div>
|
29
|
-
|
30
|
-
<hr>
|
31
|
-
</div>
|
1
|
+
<%== partial('errors/title_with_select') %>
|
32
2
|
|
33
3
|
<div class="container">
|
34
4
|
<div class="row mb-5">
|
35
5
|
<div class="col-sm-12">
|
36
|
-
<%== partial('explorer/
|
6
|
+
<%== partial('explorer/topic/partitions') %>
|
7
|
+
|
8
|
+
<% if @limited %>
|
9
|
+
<%== partial('explorer/topic/limited') %>
|
10
|
+
<% end %>
|
37
11
|
|
38
|
-
<% if @
|
39
|
-
<%== partial '
|
40
|
-
<% elsif @watermark_offsets.cleaned? %>
|
41
|
-
<%== partial 'errors/cleaned' %>
|
12
|
+
<% if @error_messages.empty? && params.current_page == 1 %>
|
13
|
+
<%== partial 'explorer/topic/empty' %>
|
42
14
|
<% else %>
|
43
|
-
|
44
|
-
<thead>
|
45
|
-
<tr class="align-middle">
|
46
|
-
<th>Origin</th>
|
47
|
-
<th>Process name</th>
|
48
|
-
<th>Error</th>
|
49
|
-
<th>Occurred at</th>
|
50
|
-
<th></th>
|
51
|
-
</tr>
|
52
|
-
</thead>
|
53
|
-
<tbody>
|
54
|
-
<%==
|
55
|
-
each_partial(
|
56
|
-
@error_messages,
|
57
|
-
'errors/error',
|
58
|
-
local: :error_msg
|
59
|
-
)
|
60
|
-
%>
|
61
|
-
</tbody>
|
62
|
-
</table>
|
15
|
+
<%== partial 'errors/table' %>
|
63
16
|
<% end %>
|
64
17
|
</div>
|
65
18
|
</div>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<%== partial('errors/title_with_select') %>
|
2
|
+
|
3
|
+
<div class="container">
|
4
|
+
<div class="row mb-5">
|
5
|
+
<div class="col-sm-12">
|
6
|
+
<%== partial('explorer/partition/watermark_offsets') %>
|
7
|
+
|
8
|
+
<% if @watermark_offsets.empty? %>
|
9
|
+
<%== partial 'errors/no_errors' %>
|
10
|
+
<% elsif @watermark_offsets.cleaned? %>
|
11
|
+
<%== partial 'errors/cleaned' %>
|
12
|
+
<% else %>
|
13
|
+
<%== partial 'errors/table' %>
|
14
|
+
<% end %>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
</div>
|
@@ -1,7 +1,10 @@
|
|
1
|
-
<% if message.is_a?(
|
1
|
+
<% if message.is_a?(Array) %>
|
2
2
|
<tr>
|
3
3
|
<td class="text-muted">
|
4
|
-
<%= message %>
|
4
|
+
<%= message[0] %>
|
5
|
+
</td>
|
6
|
+
<td class="text-muted">
|
7
|
+
<%= message[1] %>
|
5
8
|
</td>
|
6
9
|
<td colspan="3" class="text-center text-muted">
|
7
10
|
This message has either been removed or compacted and is no longer available.
|
@@ -9,6 +12,9 @@
|
|
9
12
|
</tr>
|
10
13
|
<% else %>
|
11
14
|
<tr>
|
15
|
+
<td>
|
16
|
+
<%= message.partition %>
|
17
|
+
</td>
|
12
18
|
<td>
|
13
19
|
<%= message.offset %>
|
14
20
|
</td>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<div class="card" >
|
3
3
|
<div class="card-body p-2">
|
4
4
|
<p class="card-text mb-0 p-2">
|
5
|
-
<a href="<%= root_path('explorer', topic[:topic_name]
|
5
|
+
<a href="<%= root_path('explorer', topic[:topic_name]) %>">
|
6
6
|
<%= topic[:topic_name] %> /
|
7
7
|
<%= topic[:partition_count] %>
|
8
8
|
</a>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<p class="text-end mb-4">
|
2
|
+
Partitions:
|
3
|
+
<span class="badge bg-secondary mt-1 mb-1">
|
4
|
+
total: <%= @partitions_count %>
|
5
|
+
</span>
|
6
|
+
|
7
|
+
<span class="badge bg-secondary mt-1 mb-1">
|
8
|
+
visible:
|
9
|
+
<%= [@active_partitions.first, @active_partitions.last].uniq.join(' to ') %>
|
10
|
+
</span>
|
11
|
+
</p>
|
@@ -0,0 +1,49 @@
|
|
1
|
+
<div class="container mb-4">
|
2
|
+
<div class="row">
|
3
|
+
<div class="col">
|
4
|
+
<h3>
|
5
|
+
<%= @topic_id %>
|
6
|
+
</h3>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<div class="col">
|
10
|
+
<div class="col-auto text-end">
|
11
|
+
<label class="col-form-label">Partition</label>
|
12
|
+
</div>
|
13
|
+
</div>
|
14
|
+
|
15
|
+
<div class="col pt-1 mb-0 pb-0">
|
16
|
+
<div class="col-auto">
|
17
|
+
<select class="form-select form-select-sm mb-0 form-control" id="current-partition">
|
18
|
+
<%==
|
19
|
+
each_partial(
|
20
|
+
[nil] + @partitions_count.times.to_a,
|
21
|
+
'explorer/partition_option',
|
22
|
+
local: :partition
|
23
|
+
)
|
24
|
+
%>
|
25
|
+
</select>
|
26
|
+
</div>
|
27
|
+
</div>
|
28
|
+
</div>
|
29
|
+
|
30
|
+
<hr>
|
31
|
+
</div>
|
32
|
+
|
33
|
+
<div class="container">
|
34
|
+
<div class="row mb-5">
|
35
|
+
<div class="col-sm-12">
|
36
|
+
<%== partial('explorer/topic/partitions') %>
|
37
|
+
|
38
|
+
<% if @limited %>
|
39
|
+
<%== partial('explorer/topic/limited') %>
|
40
|
+
<% end %>
|
41
|
+
|
42
|
+
<% if @messages.empty? && params.current_page == 1 %>
|
43
|
+
<%== partial 'explorer/topic/empty' %>
|
44
|
+
<% else %>
|
45
|
+
<%== partial('explorer/partition/messages') %>
|
46
|
+
<% end %>
|
47
|
+
</div>
|
48
|
+
</div>
|
49
|
+
</div>
|
@@ -31,7 +31,7 @@
|
|
31
31
|
</a>
|
32
32
|
</li>
|
33
33
|
<li class="nav-item ms-3">
|
34
|
-
<a class="nav-link <%= nav_class(start_with: '/errors') %>" href="<%= root_path('errors
|
34
|
+
<a class="nav-link <%= nav_class(start_with: '/errors') %>" href="<%= root_path('errors') %>">
|
35
35
|
Errors
|
36
36
|
</a>
|
37
37
|
</li>
|
@@ -1,28 +1,32 @@
|
|
1
|
-
<% if @
|
1
|
+
<% if @pagination && @pagination.paginate? %>
|
2
2
|
<div id="pagination" class="container mb-5">
|
3
3
|
<div class="row">
|
4
4
|
<nav>
|
5
5
|
<ul class="pagination justify-content-center">
|
6
|
-
<li class="page-item <%= 'disabled'
|
7
|
-
<a class="page-link" href="<%= current_path(
|
6
|
+
<li class="page-item <%= 'disabled' unless @pagination.first_offset? %>">
|
7
|
+
<a class="page-link" href="<%= current_path(@pagination.offset_key => @pagination.first_offset) %>">
|
8
8
|
<span>«</span>
|
9
9
|
</a>
|
10
10
|
</li>
|
11
11
|
|
12
|
-
<li class="page-item <%= 'disabled'
|
13
|
-
<a class="page-link" href="<%= current_path(
|
12
|
+
<li class="page-item <%= 'disabled' unless @pagination.previous_offset? %>">
|
13
|
+
<a class="page-link" href="<%= current_path(@pagination.offset_key => @pagination.previous_offset) %>">
|
14
14
|
<span>‹ Prev</span>
|
15
15
|
</a>
|
16
16
|
</li>
|
17
17
|
|
18
|
-
|
19
|
-
<
|
20
|
-
<
|
21
|
-
|
22
|
-
|
18
|
+
<% if @pagination.current_offset? %>
|
19
|
+
<li class="page-item active disabled">
|
20
|
+
<a class="page-link" href="<%= current_path(@pagination.offset_key => @pagination.current_offset) %>">
|
21
|
+
<span>
|
22
|
+
<%= @pagination.current_label %>
|
23
|
+
</span>
|
24
|
+
</a>
|
25
|
+
</li>
|
26
|
+
<% end %>
|
23
27
|
|
24
|
-
<li class="page-item <%= 'disabled' unless @
|
25
|
-
<a class="page-link" href="<%= current_path(
|
28
|
+
<li class="page-item <%= 'disabled' unless @pagination.next_offset? %>">
|
29
|
+
<a class="page-link" href="<%= current_path(@pagination.offset_key => @pagination.next_offset) %>">
|
26
30
|
<span>Next ›</span>
|
27
31
|
</a>
|
28
32
|
</li>
|
data/lib/karafka/web/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: karafka-web
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maciej Mensfeld
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
Qf04B9ceLUaC4fPVEz10FyobjaFoY4i32xRto3XnrzeAgfEe4swLq8bQsR3w/EF3
|
36
36
|
MGU0FeSV2Yj7Xc2x/7BzLK8xQn5l7Yy75iPF+KP3vVmDHnNl
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2023-
|
38
|
+
date: 2023-07-22 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: erubi
|
@@ -218,7 +218,15 @@ files:
|
|
218
218
|
- lib/karafka/web/ui/controllers/status.rb
|
219
219
|
- lib/karafka/web/ui/helpers/application_helper.rb
|
220
220
|
- lib/karafka/web/ui/lib/hash_proxy.rb
|
221
|
-
- lib/karafka/web/ui/lib/
|
221
|
+
- lib/karafka/web/ui/lib/paginations/base.rb
|
222
|
+
- lib/karafka/web/ui/lib/paginations/offset_based.rb
|
223
|
+
- lib/karafka/web/ui/lib/paginations/page_based.rb
|
224
|
+
- lib/karafka/web/ui/lib/paginations/paginators/arrays.rb
|
225
|
+
- lib/karafka/web/ui/lib/paginations/paginators/base.rb
|
226
|
+
- lib/karafka/web/ui/lib/paginations/paginators/partitions.rb
|
227
|
+
- lib/karafka/web/ui/lib/paginations/paginators/sets.rb
|
228
|
+
- lib/karafka/web/ui/lib/ttl_cache.rb
|
229
|
+
- lib/karafka/web/ui/models/cluster_info.rb
|
222
230
|
- lib/karafka/web/ui/models/consumer_group.rb
|
223
231
|
- lib/karafka/web/ui/models/counters.rb
|
224
232
|
- lib/karafka/web/ui/models/health.rb
|
@@ -264,7 +272,10 @@ files:
|
|
264
272
|
- lib/karafka/web/ui/pro/views/errors/_breadcrumbs.erb
|
265
273
|
- lib/karafka/web/ui/pro/views/errors/_error.erb
|
266
274
|
- lib/karafka/web/ui/pro/views/errors/_partition_option.erb
|
275
|
+
- lib/karafka/web/ui/pro/views/errors/_table.erb
|
276
|
+
- lib/karafka/web/ui/pro/views/errors/_title_with_select.erb
|
267
277
|
- lib/karafka/web/ui/pro/views/errors/index.erb
|
278
|
+
- lib/karafka/web/ui/pro/views/errors/partition.erb
|
268
279
|
- lib/karafka/web/ui/pro/views/errors/show.erb
|
269
280
|
- lib/karafka/web/ui/pro/views/explorer/_breadcrumbs.erb
|
270
281
|
- lib/karafka/web/ui/pro/views/explorer/_detail.erb
|
@@ -280,6 +291,10 @@ files:
|
|
280
291
|
- lib/karafka/web/ui/pro/views/explorer/partition/_messages.erb
|
281
292
|
- lib/karafka/web/ui/pro/views/explorer/partition/_watermark_offsets.erb
|
282
293
|
- lib/karafka/web/ui/pro/views/explorer/show.erb
|
294
|
+
- lib/karafka/web/ui/pro/views/explorer/topic.erb
|
295
|
+
- lib/karafka/web/ui/pro/views/explorer/topic/_empty.erb
|
296
|
+
- lib/karafka/web/ui/pro/views/explorer/topic/_limited.erb
|
297
|
+
- lib/karafka/web/ui/pro/views/explorer/topic/_partitions.erb
|
283
298
|
- lib/karafka/web/ui/pro/views/health/_breadcrumbs.erb
|
284
299
|
- lib/karafka/web/ui/pro/views/health/_partition.erb
|
285
300
|
- lib/karafka/web/ui/pro/views/health/index.erb
|
metadata.gz.sig
CHANGED
Binary file
|
@@ -1,38 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Karafka
|
4
|
-
module Web
|
5
|
-
module Ui
|
6
|
-
module Lib
|
7
|
-
# A simple wrapper for paginating array related data structures
|
8
|
-
class PaginateArray
|
9
|
-
# @param array [Array] array we want to paginate
|
10
|
-
# @param current_page [Integer] page we want to be on
|
11
|
-
# @return [Array<Array, <Integer, nil>>] Array with two elements: first is the array with
|
12
|
-
# data of the given page and second is the next page number of nil in case there is
|
13
|
-
# no next page (end of data)
|
14
|
-
def call(array, current_page)
|
15
|
-
slices = array.each_slice(per_page).to_a
|
16
|
-
|
17
|
-
current_data = slices[current_page - 1] || []
|
18
|
-
|
19
|
-
if slices.count >= current_page - 1 && current_data.size >= per_page
|
20
|
-
next_page = current_page + 1
|
21
|
-
else
|
22
|
-
next_page = nil
|
23
|
-
end
|
24
|
-
|
25
|
-
[current_data, next_page]
|
26
|
-
end
|
27
|
-
|
28
|
-
private
|
29
|
-
|
30
|
-
# @return [Integer] how many elements should we display in the UI
|
31
|
-
def per_page
|
32
|
-
::Karafka::Web.config.ui.per_page
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|