karafka-web 0.6.0 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/CHANGELOG.md +22 -1
  4. data/Gemfile.lock +1 -1
  5. data/lib/karafka/web/config.rb +2 -0
  6. data/lib/karafka/web/tracking/consumers/contracts/report.rb +7 -3
  7. data/lib/karafka/web/tracking/consumers/reporter.rb +5 -3
  8. data/lib/karafka/web/tracking/consumers/sampler.rb +2 -1
  9. data/lib/karafka/web/tracking/sampler.rb +5 -0
  10. data/lib/karafka/web/ui/base.rb +6 -2
  11. data/lib/karafka/web/ui/controllers/base.rb +17 -0
  12. data/lib/karafka/web/ui/controllers/cluster.rb +5 -2
  13. data/lib/karafka/web/ui/controllers/consumers.rb +3 -1
  14. data/lib/karafka/web/ui/controllers/errors.rb +19 -6
  15. data/lib/karafka/web/ui/controllers/jobs.rb +3 -1
  16. data/lib/karafka/web/ui/controllers/requests/params.rb +10 -0
  17. data/lib/karafka/web/ui/lib/paginations/base.rb +61 -0
  18. data/lib/karafka/web/ui/lib/paginations/offset_based.rb +96 -0
  19. data/lib/karafka/web/ui/lib/paginations/page_based.rb +70 -0
  20. data/lib/karafka/web/ui/lib/paginations/paginators/arrays.rb +33 -0
  21. data/lib/karafka/web/ui/lib/paginations/paginators/base.rb +23 -0
  22. data/lib/karafka/web/ui/lib/paginations/paginators/partitions.rb +52 -0
  23. data/lib/karafka/web/ui/lib/paginations/paginators/sets.rb +85 -0
  24. data/lib/karafka/web/ui/lib/ttl_cache.rb +74 -0
  25. data/lib/karafka/web/ui/models/cluster_info.rb +59 -0
  26. data/lib/karafka/web/ui/models/message.rb +114 -38
  27. data/lib/karafka/web/ui/models/status.rb +34 -8
  28. data/lib/karafka/web/ui/pro/app.rb +11 -3
  29. data/lib/karafka/web/ui/pro/controllers/consumers.rb +3 -1
  30. data/lib/karafka/web/ui/pro/controllers/dlq.rb +1 -2
  31. data/lib/karafka/web/ui/pro/controllers/errors.rb +43 -10
  32. data/lib/karafka/web/ui/pro/controllers/explorer.rb +52 -7
  33. data/lib/karafka/web/ui/pro/views/consumers/consumer/_metrics.erb +6 -1
  34. data/lib/karafka/web/ui/pro/views/errors/_breadcrumbs.erb +8 -6
  35. data/lib/karafka/web/ui/pro/views/errors/_error.erb +1 -1
  36. data/lib/karafka/web/ui/pro/views/errors/_partition_option.erb +1 -1
  37. data/lib/karafka/web/ui/pro/views/errors/_table.erb +21 -0
  38. data/lib/karafka/web/ui/pro/views/errors/_title_with_select.erb +31 -0
  39. data/lib/karafka/web/ui/pro/views/errors/index.erb +9 -56
  40. data/lib/karafka/web/ui/pro/views/errors/partition.erb +17 -0
  41. data/lib/karafka/web/ui/pro/views/explorer/_breadcrumbs.erb +1 -1
  42. data/lib/karafka/web/ui/pro/views/explorer/_message.erb +8 -2
  43. data/lib/karafka/web/ui/pro/views/explorer/_partition_option.erb +1 -1
  44. data/lib/karafka/web/ui/pro/views/explorer/_topic.erb +1 -1
  45. data/lib/karafka/web/ui/pro/views/explorer/partition/_messages.erb +1 -0
  46. data/lib/karafka/web/ui/pro/views/explorer/partition.erb +1 -1
  47. data/lib/karafka/web/ui/pro/views/explorer/topic/_empty.erb +3 -0
  48. data/lib/karafka/web/ui/pro/views/explorer/topic/_limited.erb +4 -0
  49. data/lib/karafka/web/ui/pro/views/explorer/topic/_partitions.erb +11 -0
  50. data/lib/karafka/web/ui/pro/views/explorer/topic.erb +49 -0
  51. data/lib/karafka/web/ui/pro/views/shared/_navigation.erb +1 -1
  52. data/lib/karafka/web/ui/views/cluster/_partition.erb +1 -1
  53. data/lib/karafka/web/ui/views/errors/_error.erb +1 -1
  54. data/lib/karafka/web/ui/views/shared/_pagination.erb +16 -12
  55. data/lib/karafka/web/ui/views/status/failures/_initial_state.erb +1 -10
  56. data/lib/karafka/web/ui/views/status/info/_components.erb +6 -1
  57. data/lib/karafka/web/ui/views/status/show.erb +6 -1
  58. data/lib/karafka/web/ui/views/status/successes/_connection.erb +1 -0
  59. data/lib/karafka/web/ui/views/status/warnings/_connection.erb +11 -0
  60. data/lib/karafka/web/version.rb +1 -1
  61. data.tar.gz.sig +0 -0
  62. metadata +20 -3
  63. metadata.gz.sig +0 -0
  64. data/lib/karafka/web/ui/lib/paginate_array.rb +0 -38
@@ -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