Sha256: 0903dd48ee84397eedc0583633aa548f632fc37294c652bdeaacb8b1e4b7a2b2

Contents?: true

Size: 1.85 KB

Versions: 10

Compression:

Stored size: 1.85 KB

Contents

# frozen_string_literal: true

# This Karafka component is a Pro component under a commercial license.
# This Karafka component is NOT licensed under LGPL.
#
# All of the commercial components are present in the lib/karafka/pro directory of this
# repository and their usage requires commercial license agreement.
#
# Karafka has also commercial-friendly license, commercial support and commercial components.
#
# By sending a pull request to the pro components, you are agreeing to transfer the copyright of
# your code to Maciej Mensfeld.

module Karafka
  module Web
    module Ui
      module Pro
        module Controllers
          # Errors details controller
          class Errors < Ui::Controllers::Base
            # @param partition_id [Integer] id of the partition of errors we are interested in
            def index(partition_id)
              errors_topic = ::Karafka::Web.config.topics.errors
              @partition_id = partition_id
              @previous_page, @error_messages, @next_page, @partitions_count = \
                Models::Message.page(
                  errors_topic,
                  @partition_id,
                  @params.current_page
                )

              @watermark_offsets = Ui::Models::WatermarkOffsets.find(errors_topic, @partition_id)

              respond
            end

            # Shows given error details
            #
            # @param partition_id [Integer]
            # @param offset [Integer]
            def show(partition_id, offset)
              errors_topic = ::Karafka::Web.config.topics.errors
              @partition_id = partition_id
              @offset = offset
              @error_message = Models::Message.find(
                errors_topic,
                @partition_id,
                @offset
              )

              respond
            end
          end
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
karafka-web-0.6.3 lib/karafka/web/ui/pro/controllers/errors.rb
karafka-web-0.6.1 lib/karafka/web/ui/pro/controllers/errors.rb
karafka-web-0.6.0 lib/karafka/web/ui/pro/controllers/errors.rb
karafka-web-0.5.2 lib/karafka/web/ui/pro/controllers/errors.rb
karafka-web-0.5.1 lib/karafka/web/ui/pro/controllers/errors.rb
karafka-web-0.5.0 lib/karafka/web/ui/pro/controllers/errors.rb
karafka-web-0.4.1 lib/karafka/web/ui/pro/controllers/errors.rb
karafka-web-0.4.0 lib/karafka/web/ui/pro/controllers/errors.rb
karafka-web-0.3.1 lib/karafka/web/ui/pro/controllers/errors.rb
karafka-web-0.3.0 lib/karafka/web/ui/pro/controllers/errors.rb