Class: Karafka::Web::Pro::Ui::Controllers::ClusterController

Inherits:
BaseController show all
Defined in:
lib/karafka/web/pro/ui/controllers/cluster_controller.rb

Overview

Cluster details controller

Constant Summary

Constants inherited from Ui::Controllers::BaseController

Ui::Controllers::BaseController::Models

Instance Attribute Summary

Attributes inherited from Ui::Controllers::BaseController

#params, #session

Instance Method Summary collapse

Methods included from Lib::Filtering

included, key

Methods inherited from Ui::Controllers::BaseController

#cache, #initialize

Methods included from Ui::Controllers::Requests::Hookable

included, #run_after_hooks, #run_before_hooks

Constructor Details

This class inherits a constructor from Karafka::Web::Ui::Controllers::BaseController

Instance Method Details

#indexObject

Lists available brokers in the cluster



68
69
70
71
72
# File 'lib/karafka/web/pro/ui/controllers/cluster_controller.rb', line 68

def index
  @brokers = filter(sort(Models::Broker.all))

  render
end

#replicationObject

List partitions replication details (same as OSS, plus Pro filtering)



86
87
88
89
90
91
92
93
94
95
# File 'lib/karafka/web/pro/ui/controllers/cluster_controller.rb', line 86

def replication
  @partitions, last_page = Paginators::Arrays.call(
    filter(sort(replication_partitions)),
    @params.current_page
  )

  paginate(@params.current_page, !last_page)

  render
end

#show(broker_id) ⇒ Object

Displays selected broker configuration

Parameters:

  • broker_id (String)


77
78
79
80
81
82
83
# File 'lib/karafka/web/pro/ui/controllers/cluster_controller.rb', line 77

def show(broker_id)
  @broker = Models::Broker.find(broker_id)

  @configs = filter(sort(@broker.configs))

  render
end