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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +17 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +12 -4
- data/certs/cert.pem +26 -0
- data/karafka-web.gemspec +2 -2
- data/lib/karafka/web/pro/ui/app.rb +75 -0
- data/lib/karafka/web/pro/ui/controllers/commanding_controller.rb +4 -4
- data/lib/karafka/web/pro/ui/controllers/recurring_tasks_controller.rb +131 -0
- data/lib/karafka/web/pro/ui/controllers/scheduled_messages/base_controller.rb +29 -0
- data/lib/karafka/web/pro/ui/controllers/scheduled_messages/explorer_controller.rb +65 -0
- data/lib/karafka/web/pro/ui/controllers/scheduled_messages/schedules_controller.rb +84 -0
- data/lib/karafka/web/pro/ui/views/consumers/_consumer_controls.erb +13 -12
- data/lib/karafka/web/pro/ui/views/explorer/_partition_option.erb +10 -2
- data/lib/karafka/web/pro/ui/views/recurring_tasks/_actions.erb +58 -0
- data/lib/karafka/web/pro/ui/views/recurring_tasks/_batch_actions.erb +45 -0
- data/lib/karafka/web/pro/ui/views/recurring_tasks/_breadcrumbs.erb +22 -0
- data/lib/karafka/web/pro/ui/views/recurring_tasks/_log.erb +26 -0
- data/lib/karafka/web/pro/ui/views/recurring_tasks/_not_active.erb +12 -0
- data/lib/karafka/web/pro/ui/views/recurring_tasks/_tabs.erb +17 -0
- data/lib/karafka/web/pro/ui/views/recurring_tasks/_task.erb +46 -0
- data/lib/karafka/web/pro/ui/views/recurring_tasks/logs.erb +34 -0
- data/lib/karafka/web/pro/ui/views/recurring_tasks/schedule.erb +43 -0
- data/lib/karafka/web/pro/ui/views/scheduled_messages/explorer/_breadcrumbs.erb +30 -0
- data/lib/karafka/web/pro/ui/views/scheduled_messages/explorer/_message.erb +84 -0
- data/lib/karafka/web/pro/ui/views/scheduled_messages/explorer/_messages.erb +28 -0
- data/lib/karafka/web/pro/ui/views/scheduled_messages/explorer/partition.erb +72 -0
- data/lib/karafka/web/pro/ui/views/scheduled_messages/explorer/topic.erb +33 -0
- data/lib/karafka/web/pro/ui/views/scheduled_messages/schedules/_breadcrumbs.erb +21 -0
- data/lib/karafka/web/pro/ui/views/scheduled_messages/schedules/_no_groups.erb +11 -0
- data/lib/karafka/web/pro/ui/views/scheduled_messages/schedules/index.erb +38 -0
- data/lib/karafka/web/pro/ui/views/scheduled_messages/schedules/show.erb +48 -0
- data/lib/karafka/web/pro/ui/views/search/_breadcrumbs.erb +1 -0
- data/lib/karafka/web/pro/ui/views/shared/_navigation.erb +20 -0
- data/lib/karafka/web/pro/ui/views/topics/replication.erb +1 -1
- data/lib/karafka/web/tracking/consumers/listeners/errors.rb +3 -1
- data/lib/karafka/web/ui/base.rb +1 -1
- data/lib/karafka/web/ui/controllers/base_controller.rb +18 -3
- data/lib/karafka/web/ui/helpers/application_helper.rb +29 -8
- data/lib/karafka/web/ui/helpers/paths_helper.rb +18 -0
- data/lib/karafka/web/ui/models/recurring_tasks/log.rb +15 -0
- data/lib/karafka/web/ui/models/recurring_tasks/schedule.rb +75 -0
- data/lib/karafka/web/ui/models/recurring_tasks/task.rb +19 -0
- data/lib/karafka/web/ui/public/javascripts/application.js +1 -1
- data/lib/karafka/web/ui/public/javascripts/application.min.js +7 -7
- data/lib/karafka/web/ui/public/javascripts/application.min.js.br +0 -0
- data/lib/karafka/web/ui/public/javascripts/application.min.js.gz +0 -0
- data/lib/karafka/web/ui/public/javascripts/components/live_poll.js +51 -0
- data/lib/karafka/web/ui/public/stylesheets/application.css +5 -1
- data/lib/karafka/web/ui/public/stylesheets/application.min.css +2 -2
- data/lib/karafka/web/ui/public/stylesheets/application.min.css.br +0 -0
- data/lib/karafka/web/ui/public/stylesheets/application.min.css.gz +0 -0
- data/lib/karafka/web/ui/public/stylesheets/libs/tailwind.css +18 -6
- data/lib/karafka/web/ui/views/dashboard/_ranges_selector.erb +1 -1
- data/lib/karafka/web/ui/views/shared/_breadcrumbs.erb +1 -1
- data/lib/karafka/web/ui/views/shared/_navigation.erb +21 -0
- data/lib/karafka/web/ui/views/shared/icons/_calendar.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_check.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_play.erb +3 -0
- data/lib/karafka/web/ui/views/status/info/_components.erb +48 -11
- data/lib/karafka/web/ui/views/ux/_data_table.erb +34 -4
- data/lib/karafka/web/ui/views/ux/_status_rows.erb +12 -0
- data/lib/karafka/web/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +56 -27
- metadata.gz.sig +0 -0
- data/certs/cert_chain.pem +0 -26
Binary file
|
Binary file
|
@@ -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 }
|