karafka-web 0.9.0 → 0.10.0.beta1
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/.github/workflows/ci.yml +30 -0
- data/.gitignore +2 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +88 -1
- data/Gemfile +1 -0
- data/Gemfile.lock +30 -25
- data/LICENSE +1 -1
- data/bin/build_assets +51 -0
- data/bin/release +6 -0
- data/config/locales/pro_errors.yml +18 -0
- data/docker-compose.yml +1 -1
- data/gulpfile.js +73 -0
- data/karafka-web.gemspec +2 -2
- data/lib/karafka/web/config.rb +9 -10
- data/lib/karafka/web/contracts/base.rb +2 -0
- data/lib/karafka/web/contracts/config.rb +2 -1
- data/lib/karafka/web/errors.rb +12 -0
- data/lib/karafka/web/inflector.rb +1 -1
- data/lib/karafka/web/management/actions/enable.rb +11 -0
- data/lib/karafka/web/management/migrations/consumers_metrics/0_set_initial.rb +39 -0
- data/lib/karafka/web/management/migrations/consumers_metrics/1699543515_fill_missing_received_and_sent_bytes.rb +28 -0
- data/lib/karafka/web/management/migrations/consumers_metrics/1700234522_introduce_waiting.rb +26 -0
- data/lib/karafka/web/management/migrations/consumers_metrics/1700234522_remove_processing.rb +26 -0
- data/lib/karafka/web/management/migrations/consumers_metrics/1704722380_split_listeners_into_active_and_paused.rb +38 -0
- data/lib/karafka/web/management/migrations/consumers_metrics/1706607960_introduce_lag_total.rb +40 -0
- data/lib/karafka/web/management/migrations/consumers_metrics/1706611396_rename_lag_total_to_lag_hybrid.rb +38 -0
- data/lib/karafka/web/management/migrations/consumers_metrics/1716218393_populate_jobs_metrics.rb +26 -0
- data/lib/karafka/web/management/migrations/consumers_states/0_set_initial.rb +46 -0
- data/lib/karafka/web/management/migrations/consumers_states/1699543515_fill_missing_received_and_sent_bytes.rb +25 -0
- data/lib/karafka/web/management/migrations/consumers_states/1700234522_introduce_waiting.rb +22 -0
- data/lib/karafka/web/management/migrations/consumers_states/1700234522_remove_processing.rb +22 -0
- data/lib/karafka/web/management/migrations/consumers_states/1704722380_split_listeners_into_active_and_paused.rb +34 -0
- data/lib/karafka/web/management/migrations/consumers_states/1706607960_introduce_lag_total.rb +24 -0
- data/lib/karafka/web/management/migrations/consumers_states/1706611396_rename_lag_total_to_lag_hybrid.rb +23 -0
- data/lib/karafka/web/management/migrations/consumers_states/1716218393_add_jobs_counter.rb +24 -0
- data/lib/karafka/web/management/migrator.rb +5 -5
- data/lib/karafka/web/pro/commanding/commands/base.rb +8 -0
- data/lib/karafka/web/pro/commanding/commands/quiet.rb +4 -1
- data/lib/karafka/web/pro/commanding/commands/stop.rb +4 -1
- data/lib/karafka/web/pro/loader.rb +8 -0
- data/lib/karafka/web/pro/ui/app.rb +44 -7
- data/lib/karafka/web/pro/ui/controllers/dlq_controller.rb +1 -1
- data/lib/karafka/web/pro/ui/controllers/errors_controller.rb +1 -0
- data/lib/karafka/web/pro/ui/controllers/explorer_controller.rb +6 -14
- data/lib/karafka/web/pro/ui/controllers/messages_controller.rb +5 -4
- data/lib/karafka/web/pro/ui/controllers/search_controller.rb +73 -0
- data/lib/karafka/web/pro/ui/controllers/support_controller.rb +26 -0
- data/lib/karafka/web/pro/ui/controllers/topics_controller.rb +31 -0
- data/lib/karafka/web/pro/ui/controllers/ux_controller.rb +26 -0
- data/lib/karafka/web/pro/ui/lib/policies/config.rb +39 -0
- data/lib/karafka/web/pro/ui/lib/policies/contracts/config.rb +46 -0
- data/lib/karafka/web/pro/ui/lib/policies/messages.rb +76 -0
- data/lib/karafka/web/pro/ui/lib/policies/requests.rb +36 -0
- data/lib/karafka/web/pro/ui/lib/policies.rb +34 -0
- data/lib/karafka/web/pro/ui/lib/safe_runner.rb +98 -0
- data/lib/karafka/web/pro/ui/lib/search/config.rb +53 -0
- data/lib/karafka/web/pro/ui/lib/search/contracts/config.rb +101 -0
- data/lib/karafka/web/pro/ui/lib/search/contracts/form.rb +111 -0
- data/lib/karafka/web/pro/ui/lib/search/matchers/base.rb +59 -0
- data/lib/karafka/web/pro/ui/lib/search/matchers/raw_header_includes.rb +57 -0
- data/lib/karafka/web/pro/ui/lib/search/matchers/raw_key_includes.rb +41 -0
- data/lib/karafka/web/pro/ui/lib/search/matchers/raw_payload_includes.rb +45 -0
- data/lib/karafka/web/pro/ui/lib/search/normalizer.rb +47 -0
- data/lib/karafka/web/pro/ui/lib/search/runner.rb +230 -0
- data/lib/karafka/web/pro/ui/lib/search.rb +36 -0
- data/lib/karafka/web/pro/ui/views/cluster/_breadcrumbs.erb +4 -4
- data/lib/karafka/web/pro/ui/views/cluster/_tabs.erb +14 -24
- data/lib/karafka/web/pro/ui/views/cluster/index.erb +20 -22
- data/lib/karafka/web/pro/ui/views/cluster/show.erb +21 -25
- data/lib/karafka/web/pro/ui/views/commands/_backtrace.erb +4 -19
- data/lib/karafka/web/pro/ui/views/commands/_breadcrumbs.erb +3 -3
- data/lib/karafka/web/pro/ui/views/commands/_command.erb +6 -6
- data/lib/karafka/web/pro/ui/views/commands/_command_details.erb +1 -11
- data/lib/karafka/web/pro/ui/views/commands/_incompatible_schema.erb +3 -14
- data/lib/karafka/web/pro/ui/views/commands/_metadata.erb +33 -42
- data/lib/karafka/web/pro/ui/views/commands/_table.erb +9 -3
- data/lib/karafka/web/pro/ui/views/commands/index.erb +18 -12
- data/lib/karafka/web/pro/ui/views/commands/show.erb +24 -29
- data/lib/karafka/web/pro/ui/views/consumers/_breadcrumbs.erb +8 -8
- data/lib/karafka/web/pro/ui/views/consumers/_consumer.erb +13 -23
- data/lib/karafka/web/pro/ui/views/consumers/_consumer_controls.erb +51 -35
- data/lib/karafka/web/pro/ui/views/consumers/_consumer_performance.erb +1 -1
- data/lib/karafka/web/pro/ui/views/consumers/_tabs.erb +28 -30
- data/lib/karafka/web/pro/ui/views/consumers/consumer/_commands.erb +68 -28
- data/lib/karafka/web/pro/ui/views/consumers/consumer/_job.erb +1 -1
- data/lib/karafka/web/pro/ui/views/consumers/consumer/_metrics.erb +114 -133
- data/lib/karafka/web/pro/ui/views/consumers/consumer/_partition.erb +4 -4
- data/lib/karafka/web/pro/ui/views/consumers/consumer/_stopped.erb +6 -9
- data/lib/karafka/web/pro/ui/views/consumers/consumer/_subscription_group.erb +116 -126
- data/lib/karafka/web/pro/ui/views/consumers/consumer/_tabs.erb +26 -31
- data/lib/karafka/web/pro/ui/views/consumers/controls.erb +53 -57
- data/lib/karafka/web/pro/ui/views/consumers/details.erb +4 -17
- data/lib/karafka/web/pro/ui/views/consumers/index.erb +31 -34
- data/lib/karafka/web/pro/ui/views/consumers/pending_jobs.erb +41 -46
- data/lib/karafka/web/pro/ui/views/consumers/performance.erb +43 -47
- data/lib/karafka/web/pro/ui/views/consumers/running_jobs.erb +41 -46
- data/lib/karafka/web/pro/ui/views/consumers/subscriptions.erb +14 -17
- data/lib/karafka/web/pro/ui/views/dashboard/index.erb +67 -76
- data/lib/karafka/web/pro/ui/views/dlq/_breadcrumbs.erb +1 -1
- data/lib/karafka/web/pro/ui/views/dlq/_no_topics.erb +1 -7
- data/lib/karafka/web/pro/ui/views/dlq/_topic.erb +7 -10
- data/lib/karafka/web/pro/ui/views/dlq/index.erb +8 -10
- data/lib/karafka/web/pro/ui/views/errors/_breadcrumbs.erb +3 -3
- data/lib/karafka/web/pro/ui/views/errors/_error.erb +8 -5
- data/lib/karafka/web/pro/ui/views/errors/_selector.erb +12 -0
- data/lib/karafka/web/pro/ui/views/errors/_table.erb +5 -4
- data/lib/karafka/web/pro/ui/views/errors/index.erb +50 -15
- data/lib/karafka/web/pro/ui/views/errors/partition.erb +61 -14
- data/lib/karafka/web/pro/ui/views/errors/show.erb +28 -46
- data/lib/karafka/web/pro/ui/views/explorer/_breadcrumbs.erb +11 -3
- data/lib/karafka/web/pro/ui/views/explorer/_failed_deserialization.erb +8 -3
- data/lib/karafka/web/pro/ui/views/explorer/_message.erb +12 -6
- data/lib/karafka/web/pro/ui/views/explorer/_no_topics.erb +1 -5
- data/lib/karafka/web/pro/ui/views/explorer/_selector.erb +12 -0
- data/lib/karafka/web/pro/ui/views/explorer/_topic.erb +6 -8
- data/lib/karafka/web/pro/ui/views/explorer/index.erb +13 -15
- data/lib/karafka/web/pro/ui/views/explorer/message/_metadata.erb +68 -32
- data/lib/karafka/web/pro/ui/views/explorer/message/_payload.erb +17 -16
- data/lib/karafka/web/pro/ui/views/explorer/message/_resources_utilization.erb +127 -0
- data/lib/karafka/web/pro/ui/views/explorer/message/_too_big_to_be_displayed.erb +20 -0
- data/lib/karafka/web/pro/ui/views/explorer/messages/_detail.erb +1 -1
- data/lib/karafka/web/pro/ui/views/explorer/partition/_cleaned.erb +3 -5
- data/lib/karafka/web/pro/ui/views/explorer/partition/_empty.erb +3 -5
- data/lib/karafka/web/pro/ui/views/explorer/partition/_messages.erb +6 -3
- data/lib/karafka/web/pro/ui/views/explorer/partition.erb +67 -46
- data/lib/karafka/web/pro/ui/views/explorer/show.erb +85 -21
- data/lib/karafka/web/pro/ui/views/explorer/topic/_actions.erb +27 -0
- data/lib/karafka/web/pro/ui/views/explorer/topic/_empty.erb +3 -5
- data/lib/karafka/web/pro/ui/views/explorer/topic/_limited.erb +8 -10
- data/lib/karafka/web/pro/ui/views/explorer/topic.erb +24 -44
- data/lib/karafka/web/pro/ui/views/health/_breadcrumbs.erb +7 -7
- data/lib/karafka/web/pro/ui/views/health/_no_data.erb +1 -7
- data/lib/karafka/web/pro/ui/views/health/_partition.erb +3 -3
- data/lib/karafka/web/pro/ui/views/health/_partition_lags.erb +3 -3
- data/lib/karafka/web/pro/ui/views/health/_partition_offset.erb +2 -2
- data/lib/karafka/web/pro/ui/views/health/_partition_times.erb +3 -7
- data/lib/karafka/web/pro/ui/views/health/_table_metadata.erb +8 -0
- data/lib/karafka/web/pro/ui/views/health/_tabs.erb +32 -49
- data/lib/karafka/web/pro/ui/views/health/changes.erb +51 -51
- data/lib/karafka/web/pro/ui/views/health/cluster_lags.erb +28 -41
- data/lib/karafka/web/pro/ui/views/health/lags.erb +52 -52
- data/lib/karafka/web/pro/ui/views/health/offsets.erb +55 -55
- data/lib/karafka/web/pro/ui/views/health/overview.erb +60 -60
- data/lib/karafka/web/pro/ui/views/jobs/_job.erb +1 -1
- data/lib/karafka/web/pro/ui/views/jobs/_no_jobs.erb +1 -7
- data/lib/karafka/web/pro/ui/views/jobs/pending.erb +36 -38
- data/lib/karafka/web/pro/ui/views/jobs/running.erb +36 -38
- data/lib/karafka/web/pro/ui/views/routing/_consumer_group.erb +7 -12
- data/lib/karafka/web/pro/ui/views/routing/_topic.erb +13 -11
- data/lib/karafka/web/pro/ui/views/routing/index.erb +7 -9
- data/lib/karafka/web/pro/ui/views/routing/show.erb +41 -33
- data/lib/karafka/web/pro/ui/views/search/_fix_errors.erb +3 -0
- data/lib/karafka/web/pro/ui/views/search/_metadata.erb +71 -0
- data/lib/karafka/web/pro/ui/views/search/_no_results.erb +3 -0
- data/lib/karafka/web/pro/ui/views/search/_no_search_criteria.erb +5 -0
- data/lib/karafka/web/pro/ui/views/search/_search_criteria.erb +37 -0
- data/lib/karafka/web/pro/ui/views/search/_search_modal.erb +139 -0
- data/lib/karafka/web/pro/ui/views/search/_timeout.erb +3 -0
- data/lib/karafka/web/pro/ui/views/search/index.erb +29 -0
- data/lib/karafka/web/pro/ui/views/shared/_navigation.erb +80 -28
- data/lib/karafka/web/pro/ui/views/topics/_breadcrumbs.erb +14 -6
- data/lib/karafka/web/pro/ui/views/topics/_partition_offsets.erb +10 -0
- data/lib/karafka/web/pro/ui/views/topics/_tabs.erb +26 -32
- data/lib/karafka/web/pro/ui/views/topics/_topic.erb +7 -10
- data/lib/karafka/web/pro/ui/views/topics/config.erb +21 -25
- data/lib/karafka/web/pro/ui/views/topics/distribution/_badges.erb +10 -5
- data/lib/karafka/web/pro/ui/views/topics/distribution/_chart.erb +3 -1
- data/lib/karafka/web/pro/ui/views/topics/distribution/_limited.erb +1 -1
- data/lib/karafka/web/pro/ui/views/topics/distribution.erb +34 -39
- data/lib/karafka/web/pro/ui/views/topics/index.erb +13 -15
- data/lib/karafka/web/pro/ui/views/topics/offsets.erb +24 -0
- data/lib/karafka/web/pro/ui/views/topics/replication.erb +20 -24
- data/lib/karafka/web/processing/consumers/aggregators/metrics.rb +1 -1
- data/lib/karafka/web/processing/consumers/aggregators/state.rb +1 -1
- data/lib/karafka/web/processing/consumers/contracts/aggregated_stats.rb +1 -0
- data/lib/karafka/web/tracking/consumers/contracts/report.rb +6 -0
- data/lib/karafka/web/tracking/consumers/listeners/connections.rb +8 -6
- data/lib/karafka/web/tracking/consumers/listeners/processing.rb +2 -0
- data/lib/karafka/web/tracking/consumers/listeners/tags.rb +1 -1
- data/lib/karafka/web/tracking/consumers/reporter.rb +6 -8
- data/lib/karafka/web/tracking/consumers/sampler.rb +16 -5
- data/lib/karafka/web/ui/app.rb +20 -1
- data/lib/karafka/web/ui/base.rb +26 -20
- data/lib/karafka/web/ui/controllers/base_controller.rb +7 -5
- data/lib/karafka/web/ui/controllers/dashboard_controller.rb +8 -0
- data/lib/karafka/web/ui/controllers/requests/params.rb +16 -2
- data/lib/karafka/web/ui/controllers/support_controller.rb +17 -0
- data/lib/karafka/web/ui/controllers/ux_controller.rb +17 -0
- data/lib/karafka/web/ui/helpers/application_helper.rb +75 -42
- data/lib/karafka/web/ui/helpers/paths_helper.rb +24 -0
- data/lib/karafka/web/ui/helpers/tailwind_helper.rb +90 -0
- data/lib/karafka/web/ui/lib/sorter.rb +1 -1
- data/lib/karafka/web/ui/models/metrics/aggregated.rb +1 -0
- data/lib/karafka/web/ui/models/metrics/charts/topics.rb +36 -20
- data/lib/karafka/web/ui/models/status.rb +28 -1
- data/lib/karafka/web/ui/public/images/calendar.svg +3 -0
- data/lib/karafka/web/ui/public/javascripts/application.js +39 -15
- data/lib/karafka/web/ui/public/javascripts/application.min.js +64 -0
- 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/charts/types/line.js +41 -9
- data/lib/karafka/web/ui/public/javascripts/components/btn_toggle_manager.js +37 -0
- data/lib/karafka/web/ui/public/javascripts/{live_poll.js → components/live_poll.js} +44 -8
- data/lib/karafka/web/ui/public/javascripts/{offset_datetime.js → components/offset_datetime.js} +1 -1
- data/lib/karafka/web/ui/public/javascripts/components/search.js +102 -0
- data/lib/karafka/web/ui/public/javascripts/components/tabs_manager.js +84 -0
- data/lib/karafka/web/ui/public/javascripts/components/theme_manager.js +59 -0
- data/lib/karafka/web/ui/public/javascripts/components/turbo_tracker.js +30 -0
- data/lib/karafka/web/ui/public/javascripts/libs/datepicker.js +2 -2
- data/lib/karafka/web/ui/public/javascripts/libs/turbo.js +6618 -0
- data/lib/karafka/web/ui/public/stylesheets/application.css +16 -113
- data/lib/karafka/web/ui/public/stylesheets/application.min.css +13 -0
- 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/highlight_dark.min.css +8 -0
- data/lib/karafka/web/ui/public/stylesheets/libs/highlight_dark.min.css.br +0 -0
- data/lib/karafka/web/ui/public/stylesheets/libs/highlight_dark.min.css.gz +0 -0
- data/lib/karafka/web/ui/public/stylesheets/libs/highlight_light.min.css.br +0 -0
- data/lib/karafka/web/ui/public/stylesheets/libs/highlight_light.min.css.gz +0 -0
- data/lib/karafka/web/ui/public/stylesheets/libs/tailwind.css +391 -0
- data/lib/karafka/web/ui/views/cluster/_breadcrumbs.erb +3 -3
- data/lib/karafka/web/ui/views/cluster/_tabs.erb +14 -24
- data/lib/karafka/web/ui/views/cluster/brokers.erb +20 -22
- data/lib/karafka/web/ui/views/cluster/replication.erb +28 -32
- data/lib/karafka/web/ui/views/consumers/_assignments_badges.erb +1 -1
- data/lib/karafka/web/ui/views/consumers/_breadcrumbs.erb +5 -0
- data/lib/karafka/web/ui/views/consumers/_consumer.erb +10 -14
- data/lib/karafka/web/ui/views/consumers/_no_consumers.erb +2 -8
- data/lib/karafka/web/ui/views/consumers/_summary.erb +34 -45
- data/lib/karafka/web/ui/views/consumers/_tabs.erb +35 -0
- data/lib/karafka/web/ui/views/consumers/index.erb +31 -33
- data/lib/karafka/web/ui/views/dashboard/_counters.erb +76 -0
- data/lib/karafka/web/ui/views/dashboard/_feature_pro.erb +6 -2
- data/lib/karafka/web/ui/views/dashboard/_not_enough_data.erb +3 -15
- data/lib/karafka/web/ui/views/dashboard/_ranges_selector.erb +12 -12
- data/lib/karafka/web/ui/views/dashboard/index.erb +78 -52
- data/lib/karafka/web/ui/views/errors/_breadcrumbs.erb +2 -2
- data/lib/karafka/web/ui/views/errors/_detail.erb +1 -3
- data/lib/karafka/web/ui/views/errors/_error.erb +3 -5
- data/lib/karafka/web/ui/views/errors/index.erb +34 -44
- data/lib/karafka/web/ui/views/errors/show.erb +29 -47
- data/lib/karafka/web/ui/views/jobs/_breadcrumbs.erb +3 -3
- data/lib/karafka/web/ui/views/jobs/_job.erb +1 -1
- data/lib/karafka/web/ui/views/jobs/_no_jobs.erb +1 -7
- data/lib/karafka/web/ui/views/jobs/_tabs.erb +14 -24
- data/lib/karafka/web/ui/views/jobs/pending.erb +30 -32
- data/lib/karafka/web/ui/views/jobs/running.erb +30 -32
- data/lib/karafka/web/ui/views/layout.erb +37 -21
- data/lib/karafka/web/ui/views/routing/_breadcrumbs.erb +2 -2
- data/lib/karafka/web/ui/views/routing/_consumer_group.erb +7 -12
- data/lib/karafka/web/ui/views/routing/_topic.erb +3 -5
- data/lib/karafka/web/ui/views/routing/index.erb +7 -9
- data/lib/karafka/web/ui/views/routing/show.erb +30 -22
- data/lib/karafka/web/ui/views/shared/_become_pro.erb +8 -8
- data/lib/karafka/web/ui/views/shared/_brand.erb +2 -2
- data/lib/karafka/web/ui/views/shared/_breadcrumbs.erb +23 -0
- data/lib/karafka/web/ui/views/shared/_content.erb +2 -28
- data/lib/karafka/web/ui/views/shared/_controls.erb +15 -0
- data/lib/karafka/web/ui/views/shared/_flashes.erb +5 -7
- data/lib/karafka/web/ui/views/shared/_header.erb +14 -19
- data/lib/karafka/web/ui/views/shared/_navigation.erb +84 -28
- data/lib/karafka/web/ui/views/shared/_no_paginated_data.erb +5 -9
- data/lib/karafka/web/ui/views/shared/_pagination.erb +11 -11
- data/lib/karafka/web/ui/views/shared/_tab_nav.erb +4 -5
- data/lib/karafka/web/ui/views/shared/_title.erb +5 -0
- data/lib/karafka/web/ui/views/shared/alerts/_box_error.erb +15 -0
- data/lib/karafka/web/ui/views/shared/alerts/_box_info.erb +15 -0
- data/lib/karafka/web/ui/views/shared/alerts/_box_primary.erb +15 -0
- data/lib/karafka/web/ui/views/shared/alerts/_box_secondary.erb +15 -0
- data/lib/karafka/web/ui/views/shared/alerts/_box_success.erb +15 -0
- data/lib/karafka/web/ui/views/shared/alerts/_box_warning.erb +15 -0
- data/lib/karafka/web/ui/views/shared/alerts/_error.erb +4 -0
- data/lib/karafka/web/ui/views/shared/alerts/_info.erb +5 -2
- data/lib/karafka/web/ui/views/shared/alerts/_primary.erb +4 -0
- data/lib/karafka/web/ui/views/shared/alerts/_secondary.erb +4 -0
- data/lib/karafka/web/ui/views/shared/alerts/_success.erb +4 -0
- data/lib/karafka/web/ui/views/shared/alerts/_warning.erb +4 -0
- data/lib/karafka/web/ui/views/shared/charts/_line.erb +1 -1
- data/lib/karafka/web/ui/views/shared/exceptions/not_allowed.erb +14 -19
- data/lib/karafka/web/ui/views/shared/exceptions/not_found.erb +16 -21
- data/lib/karafka/web/ui/views/shared/exceptions/pro_only.erb +16 -28
- data/lib/karafka/web/ui/views/shared/icons/_arrow_down_on_square.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_arrow_down_tray.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_arrow_on_squares.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_arrow_path_rounded.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_arrow_uturn_right.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_arrows_right_left.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_blocks.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_book_open.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_bug.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_burger.erb +14 -0
- data/lib/karafka/web/ui/views/shared/icons/_calendar_days.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_chart_bar.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_check_badge.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_check_circle.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_circle_stack.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_cpu.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_document_glass.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_exclamation_triangle.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_eye.erb +4 -0
- data/lib/karafka/web/ui/views/shared/icons/_gear.erb +4 -0
- data/lib/karafka/web/ui/views/shared/icons/_github.erb +13 -0
- data/lib/karafka/web/ui/views/shared/icons/_globe.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_heart.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_home.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_info_circle.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_lifebuoy.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_light_bulb.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_list_bullets.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_magnifying_glass.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_moon.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_offices.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_pause.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_pause_circle.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_play_circle.erb +4 -0
- data/lib/karafka/web/ui/views/shared/icons/_question_circle.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_queue_list.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_refresh.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_slack.erb +16 -0
- data/lib/karafka/web/ui/views/shared/icons/_stop.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_sun.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_x_circle.erb +3 -0
- data/lib/karafka/web/ui/views/shared/icons/_x_mark.erb +3 -0
- data/lib/karafka/web/ui/views/status/_breadcrumbs.erb +1 -1
- data/lib/karafka/web/ui/views/status/_failure.erb +2 -13
- data/lib/karafka/web/ui/views/status/_halted.erb +2 -10
- data/lib/karafka/web/ui/views/status/_info.erb +2 -13
- data/lib/karafka/web/ui/views/status/_success.erb +2 -10
- data/lib/karafka/web/ui/views/status/_warning.erb +2 -13
- data/lib/karafka/web/ui/views/status/failures/_connection.erb +2 -2
- data/lib/karafka/web/ui/views/status/failures/_consumers_reports.erb +3 -3
- data/lib/karafka/web/ui/views/status/failures/_consumers_reports_schema_state.erb +4 -4
- data/lib/karafka/web/ui/views/status/failures/_enabled.erb +2 -2
- data/lib/karafka/web/ui/views/status/failures/_initial_consumers_metrics.erb +6 -6
- data/lib/karafka/web/ui/views/status/failures/_initial_consumers_state.erb +6 -6
- data/lib/karafka/web/ui/views/status/failures/_live_reporting.erb +2 -2
- data/lib/karafka/web/ui/views/status/failures/_materializing_lag.erb +11 -0
- data/lib/karafka/web/ui/views/status/failures/_partitions.erb +3 -3
- data/lib/karafka/web/ui/views/status/failures/_state_calculation.erb +2 -2
- data/lib/karafka/web/ui/views/status/failures/_topics.erb +3 -3
- data/lib/karafka/web/ui/views/status/info/_components.erb +14 -41
- data/lib/karafka/web/ui/views/status/show.erb +165 -154
- data/lib/karafka/web/ui/views/status/warnings/_connection.erb +3 -3
- data/lib/karafka/web/ui/views/status/warnings/_pro_subscription.erb +2 -2
- data/lib/karafka/web/ui/views/status/warnings/_replication.erb +2 -2
- data/lib/karafka/web/ui/views/status/warnings/_routing_topics_presence.erb +1 -1
- data/lib/karafka/web/ui/views/support/_breadcrumbs.erb +5 -0
- data/lib/karafka/web/ui/views/support/show.erb +71 -0
- data/lib/karafka/web/ui/views/ux/_alerts.erb +25 -0
- data/lib/karafka/web/ui/views/ux/_badges.erb +21 -0
- data/lib/karafka/web/ui/views/ux/_breadcrumbs.erb +5 -0
- data/lib/karafka/web/ui/views/ux/_buttons.erb +47 -0
- data/lib/karafka/web/ui/views/ux/_card_detail.erb +15 -0
- data/lib/karafka/web/ui/views/ux/_card_metric.erb +123 -0
- data/lib/karafka/web/ui/views/ux/_card_summary.erb +72 -0
- data/lib/karafka/web/ui/views/ux/_card_support.erb +39 -0
- data/lib/karafka/web/ui/views/ux/_code.erb +9 -0
- data/lib/karafka/web/ui/views/ux/_data_table.erb +52 -0
- data/lib/karafka/web/ui/views/ux/_headers.erb +2 -0
- data/lib/karafka/web/ui/views/ux/_icons.erb +9 -0
- data/lib/karafka/web/ui/views/ux/_pagination.erb +32 -0
- data/lib/karafka/web/ui/views/ux/_row_table.erb +52 -0
- data/lib/karafka/web/ui/views/ux/_status_rows.erb +53 -0
- data/lib/karafka/web/ui/views/ux/_tabs.erb +14 -0
- data/lib/karafka/web/ui/views/ux/_text.erb +2 -0
- data/lib/karafka/web/ui/views/ux/_topic_tiles.erb +42 -0
- data/lib/karafka/web/ui/views/ux/show.erb +19 -0
- data/lib/karafka/web/version.rb +1 -1
- data/lib/karafka/web.rb +2 -0
- data/package-lock.json +4158 -0
- data/package.json +15 -0
- data/postcss.config.js +6 -0
- data/tailwind.config.js +16 -0
- data.tar.gz.sig +0 -0
- metadata +172 -47
- metadata.gz.sig +0 -0
- data/lib/karafka/web/management/migrations/0_set_initial_consumers_metrics.rb +0 -36
- data/lib/karafka/web/management/migrations/0_set_initial_consumers_state.rb +0 -43
- data/lib/karafka/web/management/migrations/1699543515_fill_missing_received_and_sent_bytes_in_consumers_metrics.rb +0 -26
- data/lib/karafka/web/management/migrations/1699543515_fill_missing_received_and_sent_bytes_in_consumers_state.rb +0 -23
- data/lib/karafka/web/management/migrations/1700234522_introduce_waiting_in_consumers_metrics.rb +0 -24
- data/lib/karafka/web/management/migrations/1700234522_introduce_waiting_in_consumers_state.rb +0 -20
- data/lib/karafka/web/management/migrations/1700234522_remove_processing_from_consumers_metrics.rb +0 -24
- data/lib/karafka/web/management/migrations/1700234522_remove_processing_from_consumers_state.rb +0 -20
- data/lib/karafka/web/management/migrations/1704722380_split_listeners_into_active_and_paused_in_metrics.rb +0 -36
- data/lib/karafka/web/management/migrations/1704722380_split_listeners_into_active_and_paused_in_states.rb +0 -32
- data/lib/karafka/web/management/migrations/1706607960_introduce_lag_total_in_metrics.rb +0 -38
- data/lib/karafka/web/management/migrations/1706607960_introduce_lag_total_in_states.rb +0 -22
- data/lib/karafka/web/management/migrations/1706611396_rename_lag_total_to_lag_hybrid_in_metrics.rb +0 -36
- data/lib/karafka/web/management/migrations/1706611396_rename_lag_total_to_lag_hybrid_in_states.rb +0 -21
- data/lib/karafka/web/pro/ui/views/cluster/brokers.erb +0 -27
- data/lib/karafka/web/pro/ui/views/commands/_details.erb +0 -26
- data/lib/karafka/web/pro/ui/views/consumers/_counters.erb +0 -72
- data/lib/karafka/web/pro/ui/views/consumers/consumer/_title.erb +0 -5
- data/lib/karafka/web/pro/ui/views/errors/_title_with_select.erb +0 -31
- data/lib/karafka/web/pro/ui/views/explorer/message/_message_actions.erb +0 -18
- data/lib/karafka/web/pro/ui/views/explorer/message/_payload_actions.erb +0 -19
- data/lib/karafka/web/pro/ui/views/explorer/partition/_details.erb +0 -35
- data/lib/karafka/web/pro/ui/views/explorer/topic/_details.erb +0 -23
- data/lib/karafka/web/pro/ui/views/health/_consumer_group_header.erb +0 -14
- data/lib/karafka/web/ui/controllers/responses/deny.rb +0 -15
- data/lib/karafka/web/ui/helpers/alerts_helper.rb +0 -23
- data/lib/karafka/web/ui/lib/safe_runner.rb +0 -59
- data/lib/karafka/web/ui/models/visibility_filter.rb +0 -49
- data/lib/karafka/web/ui/public/javascripts/libs/bootstrap.min.js +0 -6
- data/lib/karafka/web/ui/public/javascripts/tabs_manager.js +0 -57
- data/lib/karafka/web/ui/public/stylesheets/libs/bootstrap.min.css +0 -6
- data/lib/karafka/web/ui/views/consumers/_counters.erb +0 -62
- data/lib/karafka/web/ui/views/errors/_watermark_offsets.erb +0 -10
- data/lib/karafka/web/ui/views/shared/_feature_pro.erb +0 -4
- data/lib/karafka/web/ui/views/shared/_footer.erb +0 -22
- data/lib/karafka/web/ui/views/shared/_live_poll.erb +0 -7
- /data/lib/karafka/web/management/migrations/{0_base.rb → base.rb} +0 -0
- /data/lib/karafka/web/ui/public/javascripts/{charts.js → components/charts.js} +0 -0
- /data/lib/karafka/web/ui/public/stylesheets/libs/{highlight.min.css → highlight_light.min.css} +0 -0
Binary file
|
Binary file
|
@@ -3,6 +3,30 @@ class LineChartsManager {
|
|
3
3
|
this.datasetStateManager = new DatasetStateManager();
|
4
4
|
}
|
5
5
|
|
6
|
+
getLegendHeightPercentage(chart) {
|
7
|
+
const chartArea = chart.chartArea;
|
8
|
+
const chartHeight = chart.height;
|
9
|
+
const legendHeight = chartHeight - (chartArea.bottom - chartArea.top);
|
10
|
+
const legendHeightPercentage = (legendHeight / chartHeight) * 100;
|
11
|
+
return Math.round(legendHeightPercentage);
|
12
|
+
}
|
13
|
+
|
14
|
+
afterRenderPlugin() {
|
15
|
+
const self = this
|
16
|
+
|
17
|
+
return {
|
18
|
+
id: 'afterRender',
|
19
|
+
afterRender: function(chart) {
|
20
|
+
var legendHeightPercentage = self.getLegendHeightPercentage(chart);
|
21
|
+
const element = document.getElementById(chart.canvas.id);
|
22
|
+
|
23
|
+
if (legendHeightPercentage > 50 && element.parentElement.style.height == '') {
|
24
|
+
element.parentElement.style.height = '400px'
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
6
30
|
refreshAndRender(doc, isRefresh = false) {
|
7
31
|
const charts = (isRefresh ? doc : document).querySelectorAll('.chartjs-line');
|
8
32
|
|
@@ -31,7 +55,8 @@ class LineChartsManager {
|
|
31
55
|
data: value,
|
32
56
|
label: key,
|
33
57
|
hidden: disabledSets.includes(index),
|
34
|
-
borderWidth: 2.5
|
58
|
+
borderWidth: 2.5,
|
59
|
+
pointHitRadius: 10
|
35
60
|
});
|
36
61
|
});
|
37
62
|
|
@@ -47,6 +72,14 @@ class LineChartsManager {
|
|
47
72
|
}
|
48
73
|
|
49
74
|
render(handler, labels, data, yPrecision, labelTypeY) {
|
75
|
+
var tooltip_mode = null
|
76
|
+
|
77
|
+
if (data.length > 10) {
|
78
|
+
tooltip_mode = 'point'
|
79
|
+
} else {
|
80
|
+
tooltip_mode = 'x'
|
81
|
+
}
|
82
|
+
|
50
83
|
new Chart(handler, {
|
51
84
|
type: 'line',
|
52
85
|
data: {
|
@@ -65,14 +98,7 @@ class LineChartsManager {
|
|
65
98
|
axis: 'x',
|
66
99
|
intersect: false
|
67
100
|
},
|
68
|
-
hover: {
|
69
|
-
intersect: false
|
70
|
-
},
|
71
101
|
animation: false,
|
72
|
-
animations: {
|
73
|
-
colors: false,
|
74
|
-
x: false
|
75
|
-
},
|
76
102
|
transitions: {
|
77
103
|
active: {
|
78
104
|
animation: {
|
@@ -101,6 +127,11 @@ class LineChartsManager {
|
|
101
127
|
}
|
102
128
|
},
|
103
129
|
tooltip: {
|
130
|
+
mode: tooltip_mode,
|
131
|
+
filter: function (tooltipItem, currentIndex, tooltipItems) {
|
132
|
+
// Display at most 10 elements in the legend
|
133
|
+
return currentIndex < 10
|
134
|
+
},
|
104
135
|
callbacks: {
|
105
136
|
label: function(tooltipItem) {
|
106
137
|
return DataFormattingUtils.formatTooltip(labelTypeY, tooltipItem);
|
@@ -137,7 +168,8 @@ class LineChartsManager {
|
|
137
168
|
mode: 'index',
|
138
169
|
intersect: false,
|
139
170
|
}
|
140
|
-
}
|
171
|
+
},
|
172
|
+
plugins: [this.afterRenderPlugin()]
|
141
173
|
});
|
142
174
|
}
|
143
175
|
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
class BtnToggleManager {
|
2
|
+
constructor() {
|
3
|
+
this.init();
|
4
|
+
}
|
5
|
+
|
6
|
+
init() {
|
7
|
+
document.querySelectorAll('.btn-toggle').forEach(button => {
|
8
|
+
const targetId = button.getAttribute('data-toggle-target');
|
9
|
+
const targetElement = document.getElementById(targetId);
|
10
|
+
|
11
|
+
if (!targetElement) return;
|
12
|
+
|
13
|
+
// Establish initial state from local storage or based on visibility
|
14
|
+
this.restoreVisibility(button, targetElement);
|
15
|
+
|
16
|
+
// Add event listener to toggle visibility
|
17
|
+
button.addEventListener('click', () => {
|
18
|
+
const isVisible = !targetElement.classList.contains('hidden');
|
19
|
+
targetElement.classList.toggle('hidden');
|
20
|
+
button.classList.toggle('active', !isVisible);
|
21
|
+
this.saveVisibility(targetId, !isVisible);
|
22
|
+
});
|
23
|
+
});
|
24
|
+
}
|
25
|
+
|
26
|
+
saveVisibility(targetId, isVisible) {
|
27
|
+
localStorage.setItem(targetId + '_visibility', isVisible);
|
28
|
+
}
|
29
|
+
|
30
|
+
restoreVisibility(button, targetElement) {
|
31
|
+
const storedVisibility = localStorage.getItem(targetElement.id + '_visibility');
|
32
|
+
const isVisible = storedVisibility ? (storedVisibility === 'true') : !targetElement.classList.contains('hidden');
|
33
|
+
|
34
|
+
targetElement.classList.toggle('hidden', !isVisible);
|
35
|
+
button.classList.toggle('active', isVisible);
|
36
|
+
}
|
37
|
+
}
|
@@ -8,6 +8,16 @@
|
|
8
8
|
var livePollTimer = null;
|
9
9
|
var oldDOM = null;
|
10
10
|
var datePicker = null;
|
11
|
+
var startURL = window.location.href;
|
12
|
+
|
13
|
+
// Enable live polling by default on the first visit
|
14
|
+
function initLivePolling() {
|
15
|
+
var polling = localStorage.karafkaLivePoll;
|
16
|
+
|
17
|
+
if (polling != undefined) { return }
|
18
|
+
|
19
|
+
localStorage.karafkaLivePoll = "enabled"
|
20
|
+
}
|
11
21
|
|
12
22
|
// Check is there is any text selected in the Web-UI
|
13
23
|
// It drives me crazy when I'm selecting things in Sidekiq Web-UI and the page is refreshed
|
@@ -24,15 +34,37 @@ function isAnyTextSelected() {
|
|
24
34
|
return(text != "");
|
25
35
|
}
|
26
36
|
|
37
|
+
// If anything is collapsing at a given moment we should not update because it would cause weird
|
38
|
+
// glitches in the UI
|
39
|
+
function isCollapsingHappening() {
|
40
|
+
const collapsingElements = document.querySelectorAll('.collapsing');
|
41
|
+
return collapsingElements.length > 0;
|
42
|
+
}
|
43
|
+
|
27
44
|
// We should not poll and update if we have any text selected and we should not do it as well, when
|
28
45
|
// datetime picker with time selection is present
|
29
|
-
function isPollingPossible(){
|
46
|
+
function isPollingPossible(check_url = false){
|
30
47
|
if (isAnyTextSelected()) { return false }
|
31
48
|
if (isOffsetLookupCalendarVisible()) { return false }
|
49
|
+
if (isAnyModalOpen()) { return false }
|
50
|
+
if (isCollapsingHappening()) { return false }
|
51
|
+
if (isTurboOperating()) { return false }
|
52
|
+
if (check_url && (startURL != window.location.href)) { return false }
|
32
53
|
|
33
54
|
return true
|
34
55
|
}
|
35
56
|
|
57
|
+
// We should not poll and update when a modal is open. Otherwise it would be replaced and hidden.
|
58
|
+
function isAnyModalOpen(){
|
59
|
+
const modals = document.querySelectorAll('dialog'); // Select all <dialog> elements
|
60
|
+
for (let modal of modals) {
|
61
|
+
if (modal.open) {
|
62
|
+
return true; // A modal is open
|
63
|
+
}
|
64
|
+
}
|
65
|
+
return false; // No modals are open
|
66
|
+
}
|
67
|
+
|
36
68
|
function bindPollingButtonClick() {
|
37
69
|
var selector = document.getElementById("live-poll");
|
38
70
|
|
@@ -61,13 +93,11 @@ function setLivePollButton() {
|
|
61
93
|
if (selector == null) { return }
|
62
94
|
|
63
95
|
if (localStorage.karafkaLivePoll == "enabled") {
|
64
|
-
selector.
|
65
|
-
selector.classList.
|
66
|
-
selector.classList.remove("btn-secondary");
|
96
|
+
selector.classList.add('text-base-content')
|
97
|
+
selector.classList.remove("text-gray-500");
|
67
98
|
} else {
|
68
|
-
selector.
|
69
|
-
selector.classList.
|
70
|
-
selector.classList.remove("btn-success");
|
99
|
+
selector.classList.add("text-gray-500")
|
100
|
+
selector.classList.remove('text-base-content');
|
71
101
|
}
|
72
102
|
}
|
73
103
|
|
@@ -79,6 +109,10 @@ function checkResponse(resp) {
|
|
79
109
|
}
|
80
110
|
|
81
111
|
function refreshPage(text) {
|
112
|
+
// Do not refresh page if during the request something has change that should prevent us from
|
113
|
+
// refreshing.
|
114
|
+
if (!isPollingPossible()) { return false }
|
115
|
+
|
82
116
|
var parser = new DOMParser();
|
83
117
|
var new_doc = parser.parseFromString(text, "text/html");
|
84
118
|
var new_content = new_doc.getElementById('content');
|
@@ -132,11 +166,13 @@ function livePollCallback() {
|
|
132
166
|
clearTimeout(livePollTimer);
|
133
167
|
livePollTimer = null;
|
134
168
|
|
135
|
-
if (!isPollingPossible()) {
|
169
|
+
if (!isPollingPossible(false)) {
|
136
170
|
setPollingListener();
|
137
171
|
return;
|
138
172
|
}
|
139
173
|
|
174
|
+
startURL = window.location.href
|
175
|
+
|
140
176
|
fetch(window.location.href)
|
141
177
|
.then(checkResponse)
|
142
178
|
.then(resp => resp.text())
|
data/lib/karafka/web/ui/public/javascripts/{offset_datetime.js → components/offset_datetime.js}
RENAMED
@@ -21,7 +21,7 @@ function loadOffsetLookupDatePicker() {
|
|
21
21
|
onSelect: ({ date, datepicker, formattedDate }) => {
|
22
22
|
// Make sure that date-time selection does not fill the picker button value
|
23
23
|
// we want to preserve this
|
24
|
-
document.getElementById('offset-lookup-datepicker').value = "
|
24
|
+
document.getElementById('offset-lookup-datepicker').value = ""
|
25
25
|
},
|
26
26
|
onShow: function(){
|
27
27
|
offsetLookupDatePicker.selectDate((new Date).getTime())
|
@@ -0,0 +1,102 @@
|
|
1
|
+
// code for handling the search modal
|
2
|
+
|
3
|
+
class SearchModalManager {
|
4
|
+
constructor() {
|
5
|
+
this.init();
|
6
|
+
}
|
7
|
+
|
8
|
+
init() {
|
9
|
+
var offsetValueInput = document.getElementById('offset-input');
|
10
|
+
|
11
|
+
// do not manage anything when we are not in the search page
|
12
|
+
if (!offsetValueInput) { return false }
|
13
|
+
|
14
|
+
var offsetTimestampInput = document.getElementById('offset-timestamp-input');
|
15
|
+
var offsetRadios = document.querySelectorAll('input[name="search[offset_type]"]');
|
16
|
+
var noSearchCriteria = document.getElementById('no-search-criteria');
|
17
|
+
var searchFormErrors = document.getElementById('search-form-errors');
|
18
|
+
|
19
|
+
// When user selects appropriate offset lookup setting, make proper inputs editable or not
|
20
|
+
offsetRadios.forEach(function(radio) {
|
21
|
+
radio.addEventListener('change', function() {
|
22
|
+
offsetValueInput.disabled = !document.getElementById('offset-value').checked;
|
23
|
+
offsetValueInput.required = document.getElementById('offset-value').checked;
|
24
|
+
offsetTimestampInput.disabled = !document.getElementById('offset-timestamp').checked;
|
25
|
+
offsetTimestampInput.required = document.getElementById('offset-timestamp').checked
|
26
|
+
});
|
27
|
+
});
|
28
|
+
|
29
|
+
offsetValueInput.disabled = !document.getElementById('offset-value').checked;
|
30
|
+
offsetValueInput.required = document.getElementById('offset-value').checked;
|
31
|
+
offsetTimestampInput.disabled = !document.getElementById('offset-timestamp').checked;
|
32
|
+
offsetTimestampInput.required = document.getElementById('offset-timestamp').checked
|
33
|
+
|
34
|
+
document.getElementById('show-search-modal').addEventListener('click', function () {
|
35
|
+
var searchModal = document.getElementById('messages_search_modal');
|
36
|
+
|
37
|
+
searchModal.showModal();
|
38
|
+
|
39
|
+
var firstTextInput = document.querySelector('#messages_search_modal input[type="text"]');
|
40
|
+
if (firstTextInput) {
|
41
|
+
firstTextInput.focus();
|
42
|
+
}
|
43
|
+
});
|
44
|
+
|
45
|
+
if (noSearchCriteria || searchFormErrors) {
|
46
|
+
var searchModal = document.getElementById('messages_search_modal');
|
47
|
+
|
48
|
+
searchModal.showModal();
|
49
|
+
var firstTextInput = document.querySelector('#messages_search_modal input[type="text"]');
|
50
|
+
if (firstTextInput) {
|
51
|
+
firstTextInput.focus();
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
55
|
+
}
|
56
|
+
|
57
|
+
class SearchMetadataVisibilityManager {
|
58
|
+
constructor() {
|
59
|
+
this.storageKey = 'karafkaSearchMetadataVisibility';
|
60
|
+
this.metadataElement = document.getElementById('search-metadata-details');
|
61
|
+
this.toggleButton = document.getElementById('toggle-search-metadata');
|
62
|
+
|
63
|
+
// do nothing if search metadata is not present
|
64
|
+
if (!this.metadataElement) { return }
|
65
|
+
|
66
|
+
this.init();
|
67
|
+
}
|
68
|
+
|
69
|
+
init() {
|
70
|
+
this.restoreVisibility();
|
71
|
+
|
72
|
+
self = this;
|
73
|
+
|
74
|
+
var toggleButton = document.getElementById('toggle-search-metadata');
|
75
|
+
|
76
|
+
toggleButton.addEventListener('click', function () {
|
77
|
+
var metadata = document.getElementById('search-metadata-details')
|
78
|
+
metadata.classList.toggle('hidden');
|
79
|
+
toggleButton.classList.toggle('active')
|
80
|
+
|
81
|
+
self.saveVisibility(!metadata.classList.contains('hidden'))
|
82
|
+
});
|
83
|
+
}
|
84
|
+
|
85
|
+
readVisibility() {
|
86
|
+
return localStorage.getItem(this.storageKey) === 'true';
|
87
|
+
}
|
88
|
+
|
89
|
+
saveVisibility(isVisible) {
|
90
|
+
localStorage.setItem(this.storageKey, isVisible);
|
91
|
+
}
|
92
|
+
|
93
|
+
restoreVisibility() {
|
94
|
+
const isVisible = this.readVisibility();
|
95
|
+
|
96
|
+
|
97
|
+
if (isVisible) {
|
98
|
+
document.getElementById('toggle-search-metadata').classList.add('active')
|
99
|
+
document.getElementById('search-metadata-details').classList.remove('hidden');
|
100
|
+
}
|
101
|
+
}
|
102
|
+
}
|
@@ -0,0 +1,84 @@
|
|
1
|
+
class TabsManager {
|
2
|
+
constructor() {
|
3
|
+
this.storageKey = 'karafkaActiveTabsv2';
|
4
|
+
}
|
5
|
+
|
6
|
+
// Reads the active tabs from local storage
|
7
|
+
readAllActiveTabs() {
|
8
|
+
const rawActiveTabs = localStorage.getItem(this.storageKey);
|
9
|
+
return rawActiveTabs ? JSON.parse(rawActiveTabs) : {};
|
10
|
+
}
|
11
|
+
|
12
|
+
// Saves the active tabs to local storage
|
13
|
+
saveAllActiveTabs(data) {
|
14
|
+
localStorage.setItem(this.storageKey, JSON.stringify(data));
|
15
|
+
}
|
16
|
+
|
17
|
+
// Saves the current state of active tabs
|
18
|
+
saveCurrentActiveTabs() {
|
19
|
+
const activeTabs = document.querySelectorAll('.inline-tabs > .active');
|
20
|
+
const url = window.location.href.split('?')[0];
|
21
|
+
let currentActiveTabs = [];
|
22
|
+
let allTabs = this.readAllActiveTabs();
|
23
|
+
|
24
|
+
activeTabs.forEach(activeTab => {
|
25
|
+
currentActiveTabs.push(activeTab.id);
|
26
|
+
});
|
27
|
+
|
28
|
+
allTabs[url] = currentActiveTabs;
|
29
|
+
this.saveAllActiveTabs(allTabs);
|
30
|
+
}
|
31
|
+
|
32
|
+
// Sets the active tabs based on stored data
|
33
|
+
setActiveTabs() {
|
34
|
+
const url = window.location.href.split('?')[0];
|
35
|
+
const allTabs = this.readAllActiveTabs();
|
36
|
+
var activeTabs = allTabs[url];
|
37
|
+
|
38
|
+
if (!activeTabs) {
|
39
|
+
activeTabs = Array.from(document.querySelectorAll('.inline-tabs > .active')).map(tab => tab.id);
|
40
|
+
}
|
41
|
+
|
42
|
+
if (activeTabs) {
|
43
|
+
activeTabs.forEach(activeTabId => {
|
44
|
+
const tabElement = document.getElementById(activeTabId);
|
45
|
+
|
46
|
+
if (tabElement) {
|
47
|
+
const parent = tabElement.parentElement;
|
48
|
+
|
49
|
+
// Remove 'active' class from all sibling elements
|
50
|
+
parent.querySelectorAll('.custom-tab').forEach(function(sibling) {
|
51
|
+
sibling.classList.remove('active');
|
52
|
+
});
|
53
|
+
|
54
|
+
tabElement.classList.add('active')
|
55
|
+
var content = document.getElementById(tabElement.getAttribute('data-target'))
|
56
|
+
content.classList.remove('hidden')
|
57
|
+
}
|
58
|
+
});
|
59
|
+
}
|
60
|
+
}
|
61
|
+
|
62
|
+
// Initializes tab management and event listeners
|
63
|
+
manageTabs() {
|
64
|
+
this.setActiveTabs();
|
65
|
+
var self = this;
|
66
|
+
|
67
|
+
document.querySelectorAll('.inline-tabs > .custom-tab').forEach(function(button) {
|
68
|
+
button.addEventListener('click', function(event) {
|
69
|
+
const parent = this.parentElement;
|
70
|
+
|
71
|
+
// Remove 'active' class from all sibling elements
|
72
|
+
parent.querySelectorAll('.custom-tab').forEach(function(sibling) {
|
73
|
+
sibling.classList.remove('active');
|
74
|
+
var target = sibling.getAttribute('data-target')
|
75
|
+
document.getElementById(target).classList.add('hidden')
|
76
|
+
});
|
77
|
+
|
78
|
+
this.classList.add('active');
|
79
|
+
self.saveCurrentActiveTabs();
|
80
|
+
self.setActiveTabs()
|
81
|
+
});
|
82
|
+
});
|
83
|
+
}
|
84
|
+
}
|
@@ -0,0 +1,59 @@
|
|
1
|
+
class ThemeManager {
|
2
|
+
constructor() {
|
3
|
+
this.themeSelectorButton = document.getElementById('theme-selector');
|
4
|
+
this.themeSelectorLight = document.getElementById('theme-selector-light');
|
5
|
+
this.themeSelectorDark = document.getElementById('theme-selector-dark');
|
6
|
+
this.init();
|
7
|
+
}
|
8
|
+
|
9
|
+
init() {
|
10
|
+
this.lightThemeLink = document.getElementById('highlight-light');
|
11
|
+
this.darkThemeLink = document.getElementById('highlight-dark');
|
12
|
+
|
13
|
+
if (!this.lightThemeLink || !this.darkThemeLink || !this.themeSelectorButton) {
|
14
|
+
console.error('Theme CSS links or theme selector button not found');
|
15
|
+
return;
|
16
|
+
}
|
17
|
+
|
18
|
+
this.restoreTheme();
|
19
|
+
|
20
|
+
this.themeSelectorButton.addEventListener('click', () => {
|
21
|
+
this.toggleTheme();
|
22
|
+
});
|
23
|
+
}
|
24
|
+
|
25
|
+
setTheme(theme) {
|
26
|
+
document.documentElement.setAttribute('data-theme', theme);
|
27
|
+
if (theme === 'dark') {
|
28
|
+
this.lightThemeLink.disabled = true;
|
29
|
+
this.darkThemeLink.disabled = false;
|
30
|
+
this.themeSelectorLight.classList.add('hidden');
|
31
|
+
this.themeSelectorDark.classList.remove('hidden');
|
32
|
+
} else {
|
33
|
+
this.lightThemeLink.disabled = false;
|
34
|
+
this.darkThemeLink.disabled = true;
|
35
|
+
this.themeSelectorLight.classList.remove('hidden');
|
36
|
+
this.themeSelectorDark.classList.add('hidden');
|
37
|
+
}
|
38
|
+
localStorage.setItem('theme', theme);
|
39
|
+
}
|
40
|
+
|
41
|
+
toggleTheme() {
|
42
|
+
const currentTheme = document.documentElement.getAttribute('data-theme');
|
43
|
+
const newTheme = currentTheme === 'dark' ? 'corporate' : 'dark';
|
44
|
+
this.setTheme(newTheme);
|
45
|
+
}
|
46
|
+
|
47
|
+
restoreTheme() {
|
48
|
+
const storedTheme = localStorage.getItem('theme');
|
49
|
+
const theme = storedTheme ? storedTheme : (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'corporate');
|
50
|
+
this.setTheme(theme);
|
51
|
+
|
52
|
+
// Listen for system color scheme changes
|
53
|
+
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', e => {
|
54
|
+
if (!localStorage.getItem('theme')) {
|
55
|
+
this.setTheme(e.matches ? 'dark' : 'corporate');
|
56
|
+
}
|
57
|
+
});
|
58
|
+
}
|
59
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
let turboIsOperating = false;
|
2
|
+
|
3
|
+
// Listen for Turbo events to manage the state
|
4
|
+
document.addEventListener('turbo:visit', function() {
|
5
|
+
turboIsOperating = true;
|
6
|
+
});
|
7
|
+
|
8
|
+
document.addEventListener('turbo:before-fetch-request', function() {
|
9
|
+
turboIsOperating = true;
|
10
|
+
});
|
11
|
+
|
12
|
+
document.addEventListener('turbo:before-fetch-response', function() {
|
13
|
+
turboIsOperating = true;
|
14
|
+
});
|
15
|
+
|
16
|
+
document.addEventListener('turbo:load', function() {
|
17
|
+
turboIsOperating = false;
|
18
|
+
});
|
19
|
+
|
20
|
+
document.addEventListener('turbo:frame-load', function() {
|
21
|
+
turboIsOperating = false;
|
22
|
+
});
|
23
|
+
|
24
|
+
document.addEventListener('turbo:frame-render', function() {
|
25
|
+
turboIsOperating = false;
|
26
|
+
});
|
27
|
+
|
28
|
+
function isTurboOperating() {
|
29
|
+
return turboIsOperating;
|
30
|
+
}
|