karafka-web 0.10.0 → 0.10.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/.ruby-version +1 -1
  4. data/CHANGELOG.md +17 -0
  5. data/Gemfile +1 -0
  6. data/Gemfile.lock +12 -4
  7. data/certs/cert.pem +26 -0
  8. data/karafka-web.gemspec +2 -2
  9. data/lib/karafka/web/pro/ui/app.rb +75 -0
  10. data/lib/karafka/web/pro/ui/controllers/commanding_controller.rb +4 -4
  11. data/lib/karafka/web/pro/ui/controllers/recurring_tasks_controller.rb +131 -0
  12. data/lib/karafka/web/pro/ui/controllers/scheduled_messages/base_controller.rb +29 -0
  13. data/lib/karafka/web/pro/ui/controllers/scheduled_messages/explorer_controller.rb +65 -0
  14. data/lib/karafka/web/pro/ui/controllers/scheduled_messages/schedules_controller.rb +84 -0
  15. data/lib/karafka/web/pro/ui/views/consumers/_consumer_controls.erb +13 -12
  16. data/lib/karafka/web/pro/ui/views/explorer/_partition_option.erb +10 -2
  17. data/lib/karafka/web/pro/ui/views/recurring_tasks/_actions.erb +58 -0
  18. data/lib/karafka/web/pro/ui/views/recurring_tasks/_batch_actions.erb +45 -0
  19. data/lib/karafka/web/pro/ui/views/recurring_tasks/_breadcrumbs.erb +22 -0
  20. data/lib/karafka/web/pro/ui/views/recurring_tasks/_log.erb +26 -0
  21. data/lib/karafka/web/pro/ui/views/recurring_tasks/_not_active.erb +12 -0
  22. data/lib/karafka/web/pro/ui/views/recurring_tasks/_tabs.erb +17 -0
  23. data/lib/karafka/web/pro/ui/views/recurring_tasks/_task.erb +46 -0
  24. data/lib/karafka/web/pro/ui/views/recurring_tasks/logs.erb +34 -0
  25. data/lib/karafka/web/pro/ui/views/recurring_tasks/schedule.erb +43 -0
  26. data/lib/karafka/web/pro/ui/views/scheduled_messages/explorer/_breadcrumbs.erb +30 -0
  27. data/lib/karafka/web/pro/ui/views/scheduled_messages/explorer/_message.erb +84 -0
  28. data/lib/karafka/web/pro/ui/views/scheduled_messages/explorer/_messages.erb +28 -0
  29. data/lib/karafka/web/pro/ui/views/scheduled_messages/explorer/partition.erb +72 -0
  30. data/lib/karafka/web/pro/ui/views/scheduled_messages/explorer/topic.erb +33 -0
  31. data/lib/karafka/web/pro/ui/views/scheduled_messages/schedules/_breadcrumbs.erb +21 -0
  32. data/lib/karafka/web/pro/ui/views/scheduled_messages/schedules/_no_groups.erb +11 -0
  33. data/lib/karafka/web/pro/ui/views/scheduled_messages/schedules/index.erb +38 -0
  34. data/lib/karafka/web/pro/ui/views/scheduled_messages/schedules/show.erb +48 -0
  35. data/lib/karafka/web/pro/ui/views/search/_breadcrumbs.erb +1 -0
  36. data/lib/karafka/web/pro/ui/views/shared/_navigation.erb +20 -0
  37. data/lib/karafka/web/pro/ui/views/topics/replication.erb +1 -1
  38. data/lib/karafka/web/tracking/consumers/listeners/errors.rb +3 -1
  39. data/lib/karafka/web/ui/base.rb +1 -1
  40. data/lib/karafka/web/ui/controllers/base_controller.rb +18 -3
  41. data/lib/karafka/web/ui/helpers/application_helper.rb +29 -8
  42. data/lib/karafka/web/ui/helpers/paths_helper.rb +18 -0
  43. data/lib/karafka/web/ui/models/recurring_tasks/log.rb +15 -0
  44. data/lib/karafka/web/ui/models/recurring_tasks/schedule.rb +75 -0
  45. data/lib/karafka/web/ui/models/recurring_tasks/task.rb +19 -0
  46. data/lib/karafka/web/ui/public/javascripts/application.js +1 -1
  47. data/lib/karafka/web/ui/public/javascripts/application.min.js +7 -7
  48. data/lib/karafka/web/ui/public/javascripts/application.min.js.br +0 -0
  49. data/lib/karafka/web/ui/public/javascripts/application.min.js.gz +0 -0
  50. data/lib/karafka/web/ui/public/javascripts/components/live_poll.js +51 -0
  51. data/lib/karafka/web/ui/public/stylesheets/application.css +5 -1
  52. data/lib/karafka/web/ui/public/stylesheets/application.min.css +2 -2
  53. data/lib/karafka/web/ui/public/stylesheets/application.min.css.br +0 -0
  54. data/lib/karafka/web/ui/public/stylesheets/application.min.css.gz +0 -0
  55. data/lib/karafka/web/ui/public/stylesheets/libs/tailwind.css +18 -6
  56. data/lib/karafka/web/ui/views/dashboard/_ranges_selector.erb +1 -1
  57. data/lib/karafka/web/ui/views/shared/_breadcrumbs.erb +1 -1
  58. data/lib/karafka/web/ui/views/shared/_navigation.erb +21 -0
  59. data/lib/karafka/web/ui/views/shared/icons/_calendar.erb +3 -0
  60. data/lib/karafka/web/ui/views/shared/icons/_check.erb +3 -0
  61. data/lib/karafka/web/ui/views/shared/icons/_play.erb +3 -0
  62. data/lib/karafka/web/ui/views/status/info/_components.erb +48 -11
  63. data/lib/karafka/web/ui/views/ux/_data_table.erb +34 -4
  64. data/lib/karafka/web/ui/views/ux/_status_rows.erb +12 -0
  65. data/lib/karafka/web/version.rb +1 -1
  66. data.tar.gz.sig +0 -0
  67. metadata +56 -27
  68. metadata.gz.sig +0 -0
  69. data/certs/cert_chain.pem +0 -26
@@ -9,9 +9,22 @@ var livePollTimer = null;
9
9
  var oldDOM = null;
10
10
  var datePicker = null;
11
11
  var startURL = window.location.href;
12
+ let isHoveringOverClickable = false;
12
13
 
13
14
  // Enable live polling by default on the first visit
14
15
  function initLivePolling() {
16
+ document.addEventListener('mouseover', function(event) {
17
+ if (isElementClickable(event.target)) {
18
+ isHoveringOverClickable = true;
19
+ }
20
+ });
21
+
22
+ document.addEventListener('mouseout', function(event) {
23
+ if (isElementClickable(event.target)) {
24
+ isHoveringOverClickable = false;
25
+ }
26
+ });
27
+
15
28
  var polling = localStorage.karafkaLivePoll;
16
29
 
17
30
  if (polling != undefined) { return }
@@ -19,6 +32,42 @@ function initLivePolling() {
19
32
  localStorage.karafkaLivePoll = "enabled"
20
33
  }
21
34
 
35
+ function isFormActive() {
36
+ // Get the currently focused element
37
+ const activeElement = document.activeElement;
38
+
39
+ // Check if the focused element is a form control
40
+ return ['INPUT', 'TEXTAREA', 'SELECT', 'BUTTON', 'FIELDSET'].includes(activeElement.tagName);
41
+ }
42
+
43
+ function isElementClickable(element) {
44
+ // Check for common clickable elements
45
+ if (element.tagName === 'A' ||
46
+ element.tagName === 'BUTTON' ||
47
+ (element.tagName === 'INPUT' && (element.type === 'button' || element.type === 'submit')) ||
48
+ element.hasAttribute('onclick') ||
49
+ typeof element.onclick === 'function') {
50
+ return true;
51
+ }
52
+
53
+ // Check if the element is a <span> inside a .tab-container
54
+ if (element.tagName === 'SPAN' && element.closest('.tab-container')) {
55
+ return true;
56
+ }
57
+
58
+ // Check if the element is wrapped in a <button>
59
+ if (element.closest('button')) { return true }
60
+
61
+ // Check if element is wrapped with a link
62
+ if (element.closest('a')) { return true }
63
+
64
+ return false;
65
+ }
66
+
67
+ function isUserHoveringOverClickable() {
68
+ return isHoveringOverClickable;
69
+ }
70
+
22
71
  // Check is there is any text selected in the Web-UI
23
72
  // It drives me crazy when I'm selecting things in Sidekiq Web-UI and the page is refreshed
24
73
  // This mitigates this problem for Karafka Web
@@ -44,6 +93,8 @@ function isCollapsingHappening() {
44
93
  // We should not poll and update if we have any text selected and we should not do it as well, when
45
94
  // datetime picker with time selection is present
46
95
  function isPollingPossible(check_url = false){
96
+ if (isFormActive()) { return false }
97
+ if (isUserHoveringOverClickable()) { return false }
47
98
  if (isAnyTextSelected()) { return false }
48
99
  if (isOffsetLookupCalendarVisible()) { return false }
49
100
  if (isAnyModalOpen()) { return false }
@@ -29,5 +29,9 @@ canvas {
29
29
  }
30
30
 
31
31
  table td.commands {
32
- min-width: 120px;
32
+ width: 150px;
33
+ }
34
+
35
+ table td.commands-inline-3 {
36
+ width: 180px
33
37
  }