karafka-web 0.10.2 → 0.10.3
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 +2 -3
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +11 -9
- data/config/locales/pro_errors.yml +7 -1
- data/docker-compose.yml +1 -1
- data/karafka-web.gemspec +9 -1
- data/lib/karafka/web/pro/commanding/commands/{probe.rb → trace.rb} +3 -3
- data/lib/karafka/web/pro/commanding/listener.rb +1 -1
- data/lib/karafka/web/pro/commanding/manager.rb +2 -2
- data/lib/karafka/web/pro/commanding.rb +1 -1
- data/lib/karafka/web/pro/loader.rb +4 -2
- data/lib/karafka/web/pro/ui/app.rb +12 -2
- data/lib/karafka/web/pro/ui/controllers/commanding_controller.rb +4 -4
- data/lib/karafka/web/pro/ui/controllers/routing_controller.rb +18 -1
- data/lib/karafka/web/pro/ui/controllers/scheduled_messages/messages_controller.rb +60 -0
- data/lib/karafka/web/pro/ui/lib/branding/config.rb +40 -0
- data/lib/karafka/web/pro/ui/lib/branding/contracts/config.rb +56 -0
- data/lib/karafka/web/pro/ui/lib/branding.rb +36 -0
- data/lib/karafka/web/pro/ui/views/commands/_command.erb +1 -1
- data/lib/karafka/web/pro/ui/views/consumers/_consumer_controls.erb +3 -3
- data/lib/karafka/web/pro/ui/views/consumers/consumer/_commands.erb +4 -4
- data/lib/karafka/web/pro/ui/views/recurring_tasks/_actions.erb +2 -2
- data/lib/karafka/web/pro/ui/views/routing/_consumer_group.erb +2 -0
- data/lib/karafka/web/pro/ui/views/routing/_topic.erb +10 -0
- data/lib/karafka/web/pro/ui/views/scheduled_messages/explorer/_key.erb +9 -0
- data/lib/karafka/web/pro/ui/views/scheduled_messages/explorer/_message.erb +51 -13
- data/lib/karafka/web/pro/ui/views/shared/_navigation.erb +20 -15
- data/lib/karafka/web/pro/ui/views/shared/branding/_label.erb +20 -0
- data/lib/karafka/web/pro/ui/views/shared/branding/_notice.erb +13 -0
- data/lib/karafka/web/ui/helpers/tailwind_helper.rb +5 -4
- data/lib/karafka/web/ui/public/javascripts/application.js +1 -0
- data/lib/karafka/web/ui/public/javascripts/application.min.js +2 -2
- 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/btn_toggle_manager.js +16 -6
- data/lib/karafka/web/ui/public/stylesheets/application.css +21 -0
- data/lib/karafka/web/ui/public/stylesheets/application.min.css +1 -1
- 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 +69 -2
- data/lib/karafka/web/ui/views/layout.erb +5 -2
- data/lib/karafka/web/ui/views/shared/_brand.erb +3 -2
- data/lib/karafka/web/ui/views/shared/_navigation.erb +19 -15
- data/lib/karafka/web/ui/views/shared/alerts/_error.erb +3 -1
- data/lib/karafka/web/ui/views/shared/alerts/_info.erb +1 -1
- data/lib/karafka/web/ui/views/shared/alerts/_primary.erb +3 -1
- data/lib/karafka/web/ui/views/shared/alerts/_secondary.erb +3 -1
- data/lib/karafka/web/ui/views/shared/alerts/_success.erb +3 -1
- data/lib/karafka/web/ui/views/shared/alerts/_warning.erb +3 -1
- data/lib/karafka/web/ui/views/shared/icons/_chevron.erb +4 -0
- data/lib/karafka/web/version.rb +1 -1
- data/package-lock.json +3 -3
- data.tar.gz.sig +0 -0
- metadata +11 -13
- metadata.gz.sig +0 -0
- data/.coditsu/ci.yml +0 -3
- data/.diffend.yml +0 -3
- data/.github/FUNDING.yml +0 -1
- data/.github/ISSUE_TEMPLATE/bug_report.md +0 -50
- data/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- data/.github/workflows/ci.yml +0 -133
- data/.gitignore +0 -71
- data/.rspec +0 -1
- data/.ruby-gemset +0 -1
- data/.ruby-version +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5790e7352a06e0a780810c40aac53e9b5c878a84990c70b28bdc4d49d3ab921d
|
4
|
+
data.tar.gz: e5ef8e226602ad0388b138b676d705f9dbda06363a0001b2c5e483abab9f2bed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a645ae9fbbe73c045562b38f744e923e3bb4ac7be47f5c49dd664a1b61513ab07706348461ef7858d3c5518a0c70c5f31addf66e146cd76e91579590e7baa268
|
7
|
+
data.tar.gz: 4e5a11cd6d5333b1dff7f95856818cbe14a7a7fa172dc5cbf6d4a1409883b862dc97dc9a4799cf247023e12fdaecbae749e2d44647783af770ce3ca0cd95e51c
|
checksums.yaml.gz.sig
CHANGED
@@ -1,3 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
�O�ljJ�F�B�F�R+u��G���������ev����y ~�D�����>�%�LikH��K���}S�[�>k�uM����
|
1
|
+
�Mwi��kT�
|
2
|
+
�͙^�Y� ������$��n��$�"�S����0N���@���e�r�<���xCԟ4&�ݬ#I5����Y��0�Ɓ�
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Karafka Web Changelog
|
2
2
|
|
3
|
+
## 0.10.3 (2024-09-17)
|
4
|
+
- **[Feature]** Introduce ability to brand Web UI with environment (Pro).
|
5
|
+
- [Enhancement] Provide assignment status in the routing (Pro).
|
6
|
+
- [Enhancement] Support schedule cancellation via Web UI.
|
7
|
+
- [Enhancement] Rename "probing" to "tracing" to better reflect what this commanding option does.
|
8
|
+
- [Fix] Fix not working primary and secondary alert styles.
|
9
|
+
|
3
10
|
## 0.10.2 (2024-09-03)
|
4
11
|
- **[Feature]** Support Future Messages management (Pro).
|
5
12
|
- [Enhancement] Do not live-reload when form active.
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
karafka-web (0.10.
|
4
|
+
karafka-web (0.10.3)
|
5
5
|
erubi (~> 1.4)
|
6
6
|
karafka (>= 2.4.10, < 2.5.0)
|
7
7
|
karafka-core (>= 2.4.0, < 2.5.0)
|
@@ -11,20 +11,21 @@ PATH
|
|
11
11
|
GEM
|
12
12
|
remote: https://rubygems.org/
|
13
13
|
specs:
|
14
|
-
activesupport (7.1
|
14
|
+
activesupport (7.2.1)
|
15
15
|
base64
|
16
16
|
bigdecimal
|
17
|
-
concurrent-ruby (~> 1.0, >= 1.
|
17
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
18
18
|
connection_pool (>= 2.2.5)
|
19
19
|
drb
|
20
20
|
i18n (>= 1.6, < 2)
|
21
|
+
logger (>= 1.4.2)
|
21
22
|
minitest (>= 5.1)
|
22
|
-
|
23
|
-
tzinfo (~> 2.0)
|
23
|
+
securerandom (>= 0.3)
|
24
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
24
25
|
base64 (0.2.0)
|
25
26
|
bigdecimal (3.1.8)
|
26
27
|
byebug (11.1.3)
|
27
|
-
concurrent-ruby (1.3.
|
28
|
+
concurrent-ruby (1.3.4)
|
28
29
|
connection_pool (2.4.1)
|
29
30
|
diff-lcs (1.5.1)
|
30
31
|
docile (1.4.0)
|
@@ -32,7 +33,7 @@ GEM
|
|
32
33
|
erubi (1.13.0)
|
33
34
|
et-orbi (1.2.11)
|
34
35
|
tzinfo
|
35
|
-
factory_bot (6.
|
36
|
+
factory_bot (6.5.0)
|
36
37
|
activesupport (>= 5.0.0)
|
37
38
|
ffi (1.17.0)
|
38
39
|
fugit (1.11.1)
|
@@ -52,9 +53,9 @@ GEM
|
|
52
53
|
ffi (~> 1.15)
|
53
54
|
mini_portile2 (~> 2.6)
|
54
55
|
rake (> 12)
|
56
|
+
logger (1.6.1)
|
55
57
|
mini_portile2 (2.8.7)
|
56
|
-
minitest (5.
|
57
|
-
mutex_m (0.2.0)
|
58
|
+
minitest (5.25.1)
|
58
59
|
ostruct (0.6.0)
|
59
60
|
raabro (1.4.0)
|
60
61
|
rack (3.1.4)
|
@@ -79,6 +80,7 @@ GEM
|
|
79
80
|
diff-lcs (>= 1.2.0, < 2.0)
|
80
81
|
rspec-support (~> 3.13.0)
|
81
82
|
rspec-support (3.13.1)
|
83
|
+
securerandom (0.3.1)
|
82
84
|
simplecov (0.22.0)
|
83
85
|
docile (~> 1.1)
|
84
86
|
simplecov-html (~> 0.11)
|
@@ -2,21 +2,27 @@ en:
|
|
2
2
|
validations:
|
3
3
|
config:
|
4
4
|
missing: needs to be present
|
5
|
+
key_must_be_a_symbol: All keys under the kafka settings scope need to be symbols
|
5
6
|
|
6
7
|
commanding.active_format: needs to be either true or false
|
7
8
|
commanding.consumer_group_format: 'needs to be a string with a Kafka accepted format'
|
8
9
|
commanding.max_wait_time_format: needs to be an integer bigger than 0
|
9
10
|
commanding.pause_timeout_format: needs to be an integer bigger than 0
|
10
|
-
key_must_be_a_symbol: All keys under the kafka settings scope need to be symbols
|
11
11
|
commanding.kafka_format: needs to be a filled hash
|
12
|
+
|
12
13
|
ui.search.matchers_must_have_name_and_call: 'must respond to #name and its instance to #call'
|
13
14
|
ui.search.matchers_format: must be an array with matchers
|
14
15
|
ui.search.matchers_name_must_be_valid: all matchers names must be non-empty strings
|
15
16
|
ui.search.limits_format: all limits need to be integers bigger than 0
|
16
17
|
ui.search.timeout_format: must be at least 1 ms
|
18
|
+
|
17
19
|
ui.policies.messages_format: cannot be nil
|
18
20
|
ui.policies.requests_format: cannot be nil
|
19
21
|
|
22
|
+
ui.branding.type_format: 'must be :info, :error, :warning, :success, :primary or :secondary'
|
23
|
+
ui.branding.label_format: must be false or non-empty string
|
24
|
+
ui.branding.notice_format: must be false or non-empty string
|
25
|
+
|
20
26
|
search_form:
|
21
27
|
missing: needs to be present
|
22
28
|
timestamp_key_must_be_large_enough: 'must be a Kafka message timestamp with ms precision'
|
data/docker-compose.yml
CHANGED
data/karafka-web.gemspec
CHANGED
@@ -31,10 +31,18 @@ Gem::Specification.new do |spec|
|
|
31
31
|
end
|
32
32
|
|
33
33
|
spec.cert_chain = %w[certs/cert.pem]
|
34
|
-
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(spec)/}) }
|
35
34
|
spec.executables = %w[karafka-web]
|
36
35
|
spec.require_paths = %w[lib]
|
37
36
|
|
37
|
+
spec.files = `git ls-files -z`
|
38
|
+
.split("\x0")
|
39
|
+
.reject { |f| f.match(%r{^(spec)/}) }
|
40
|
+
.reject { |f| f.include?('.github') }
|
41
|
+
.reject { |f| f.start_with?('.') }
|
42
|
+
.reject { |f| f.end_with?('.map') }
|
43
|
+
|
44
|
+
p spec.files.select { |a| a.include?('.map')}
|
45
|
+
|
38
46
|
spec.metadata = {
|
39
47
|
'funding_uri' => 'https://karafka.io/#become-pro',
|
40
48
|
'homepage_uri' => 'https://karafka.io',
|
@@ -19,8 +19,8 @@ module Karafka
|
|
19
19
|
module Commands
|
20
20
|
# Collects all backtraces from the available Ruby threads and publishes their details
|
21
21
|
# back to Kafka for debug.
|
22
|
-
class
|
23
|
-
# Runs
|
22
|
+
class Trace < Base
|
23
|
+
# Runs tracing and publishes result back to Kafka
|
24
24
|
def call
|
25
25
|
threads = {}
|
26
26
|
|
@@ -31,7 +31,7 @@ module Karafka
|
|
31
31
|
t_d[:backtrace] = (thread.backtrace || ['<no backtrace available>']).join("\n")
|
32
32
|
end
|
33
33
|
|
34
|
-
Dispatcher.result(threads, process_id, '
|
34
|
+
Dispatcher.result(threads, process_id, 'trace')
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
@@ -16,7 +16,7 @@ module Karafka
|
|
16
16
|
module Pro
|
17
17
|
# Namespace for things related to consumers commanding (management)
|
18
18
|
#
|
19
|
-
# This feature allows for basic of consumers. They can be stopped, moved to quiet or
|
19
|
+
# This feature allows for basic of consumers. They can be stopped, moved to quiet or traced
|
20
20
|
# via the Web UI
|
21
21
|
module Commanding
|
22
22
|
# Wrapper around the Pro Iterator that yields messages with commands when needed for
|
@@ -16,7 +16,7 @@ module Karafka
|
|
16
16
|
module Pro
|
17
17
|
# Namespace for things related to consumers commanding (management)
|
18
18
|
#
|
19
|
-
# This feature allows for basic of consumers. They can be stopped, moved to quiet or
|
19
|
+
# This feature allows for basic of consumers. They can be stopped, moved to quiet or traced
|
20
20
|
# via the Web UI
|
21
21
|
module Commanding
|
22
22
|
class << self
|
@@ -28,8 +28,9 @@ module Karafka
|
|
28
28
|
|
29
29
|
# Expand UI config with extra search capabilities settings
|
30
30
|
config.ui.instance_eval do
|
31
|
-
setting(:
|
31
|
+
setting(:branding, default: Ui::Lib::Branding::Config.config)
|
32
32
|
setting(:policies, default: Ui::Lib::Policies::Config.config)
|
33
|
+
setting(:search, default: Ui::Lib::Search::Config.config)
|
33
34
|
end
|
34
35
|
end
|
35
36
|
|
@@ -38,8 +39,9 @@ module Karafka
|
|
38
39
|
# @param config [Karafka::Core::Configurable::Node]
|
39
40
|
def post_setup_all(config)
|
40
41
|
Commanding.post_setup(config)
|
41
|
-
Ui::Lib::
|
42
|
+
Ui::Lib::Branding.post_setup(config)
|
42
43
|
Ui::Lib::Policies.post_setup(config)
|
44
|
+
Ui::Lib::Search.post_setup(config)
|
43
45
|
end
|
44
46
|
end
|
45
47
|
end
|
@@ -126,8 +126,8 @@ module Karafka
|
|
126
126
|
end
|
127
127
|
|
128
128
|
r.on String do |process_id|
|
129
|
-
r.post '
|
130
|
-
controller.
|
129
|
+
r.post 'trace' do
|
130
|
+
controller.trace(process_id)
|
131
131
|
end
|
132
132
|
|
133
133
|
r.post 'quiet' do
|
@@ -302,6 +302,16 @@ module Karafka
|
|
302
302
|
end
|
303
303
|
end
|
304
304
|
|
305
|
+
r.on 'messages' do
|
306
|
+
controller = Controllers::ScheduledMessages::MessagesController.new(params)
|
307
|
+
|
308
|
+
r.post(
|
309
|
+
String, Integer, Integer, 'cancel'
|
310
|
+
) do |topic_id, partition_id, message_offset|
|
311
|
+
controller.cancel(topic_id, partition_id, message_offset)
|
312
|
+
end
|
313
|
+
end
|
314
|
+
|
305
315
|
r.get do
|
306
316
|
r.redirect root_path('scheduled_messages/schedules')
|
307
317
|
end
|
@@ -19,15 +19,15 @@ module Karafka
|
|
19
19
|
# Controller responsible for handling requests that should trigger some action on the
|
20
20
|
# consumers.
|
21
21
|
class CommandingController < BaseController
|
22
|
-
# Dispatches the
|
22
|
+
# Dispatches the trace request to a given process
|
23
23
|
#
|
24
24
|
# @param process_id [String]
|
25
|
-
def
|
26
|
-
command(:
|
25
|
+
def trace(process_id)
|
26
|
+
command(:trace, process_id)
|
27
27
|
|
28
28
|
redirect(
|
29
29
|
:back,
|
30
|
-
success: dispatched_to_one(:
|
30
|
+
success: dispatched_to_one(:trace, process_id)
|
31
31
|
)
|
32
32
|
end
|
33
33
|
|
@@ -28,11 +28,28 @@ module Karafka
|
|
28
28
|
detect_patterns_routes
|
29
29
|
|
30
30
|
@routes = Karafka::App.routes
|
31
|
-
|
32
31
|
@routes.each do |consumer_group|
|
33
32
|
refine(consumer_group.topics)
|
34
33
|
end
|
35
34
|
|
35
|
+
current_state = Models::ConsumersState.current
|
36
|
+
@assigned = Hash.new { |h, k| h[k] = Set.new }
|
37
|
+
|
38
|
+
# If there are active processes, we can use their data to mark certain topics as
|
39
|
+
# assigned. This does not cover the full scope as some partitions may be assigned
|
40
|
+
# and some not, but provides general overview
|
41
|
+
if current_state
|
42
|
+
Models::Processes.active(current_state).each do |process|
|
43
|
+
process.consumer_groups.each do |consumer_group|
|
44
|
+
consumer_group.subscription_groups.each do |subscription_group|
|
45
|
+
subscription_group.topics.each do |topic|
|
46
|
+
@assigned[consumer_group.id.to_s] << topic.name
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
36
53
|
render
|
37
54
|
end
|
38
55
|
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# This Karafka component is a Pro component under a commercial license.
|
4
|
+
# This Karafka component is NOT licensed under LGPL.
|
5
|
+
#
|
6
|
+
# All of the commercial components are present in the lib/karafka/pro directory of this
|
7
|
+
# repository and their usage requires commercial license agreement.
|
8
|
+
#
|
9
|
+
# Karafka has also commercial-friendly license, commercial support and commercial components.
|
10
|
+
#
|
11
|
+
# By sending a pull request to the pro components, you are agreeing to transfer the copyright of
|
12
|
+
# your code to Maciej Mensfeld.
|
13
|
+
|
14
|
+
module Karafka
|
15
|
+
module Web
|
16
|
+
module Pro
|
17
|
+
module Ui
|
18
|
+
module Controllers
|
19
|
+
module ScheduledMessages
|
20
|
+
# Provides management of schedules related messages
|
21
|
+
class MessagesController < BaseController
|
22
|
+
# Generates a cancel request for a given schedule message
|
23
|
+
# @param topic_id [String]
|
24
|
+
# @param partition_id [Integer]
|
25
|
+
# @param message_offset [Integer]
|
26
|
+
def cancel(topic_id, partition_id, message_offset)
|
27
|
+
# Fetches the message we want to cancel to get its key
|
28
|
+
scheduled_message = Karafka::Admin.read_topic(
|
29
|
+
topic_id,
|
30
|
+
partition_id,
|
31
|
+
1,
|
32
|
+
message_offset
|
33
|
+
).first
|
34
|
+
|
35
|
+
cancel_message = ::Karafka::Pro::ScheduledMessages.cancel(
|
36
|
+
key: scheduled_message.key,
|
37
|
+
envelope: {
|
38
|
+
topic: topic_id,
|
39
|
+
partition: partition_id
|
40
|
+
}
|
41
|
+
)
|
42
|
+
|
43
|
+
Karafka::Web.producer.produce_sync(cancel_message)
|
44
|
+
|
45
|
+
redirect(
|
46
|
+
:back,
|
47
|
+
success: <<~MESSAGE
|
48
|
+
A scheduled message with offset #{message_offset}
|
49
|
+
from #{topic_id} partition #{partition_id}
|
50
|
+
had a cancel request message successfully created.
|
51
|
+
MESSAGE
|
52
|
+
)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# This Karafka component is a Pro component under a commercial license.
|
4
|
+
# This Karafka component is NOT licensed under LGPL.
|
5
|
+
#
|
6
|
+
# All of the commercial components are present in the lib/karafka/pro directory of this
|
7
|
+
# repository and their usage requires commercial license agreement.
|
8
|
+
#
|
9
|
+
# Karafka has also commercial-friendly license, commercial support and commercial components.
|
10
|
+
#
|
11
|
+
# By sending a pull request to the pro components, you are agreeing to transfer the copyright of
|
12
|
+
# your code to Maciej Mensfeld.
|
13
|
+
|
14
|
+
module Karafka
|
15
|
+
module Web
|
16
|
+
module Pro
|
17
|
+
module Ui
|
18
|
+
module Lib
|
19
|
+
module Branding
|
20
|
+
# Extra configuration for pro UI branding feature
|
21
|
+
class Config
|
22
|
+
extend ::Karafka::Core::Configurable
|
23
|
+
|
24
|
+
# Type of styling aligned with Daisy. info, error, warning, success, primary
|
25
|
+
setting :type, default: :info
|
26
|
+
|
27
|
+
# String label with env name. Will be displayed below the logo
|
28
|
+
setting :label, default: false
|
29
|
+
|
30
|
+
# Additional wide alert notice to highlight extra details. Nothing if false
|
31
|
+
setting :notice, default: false
|
32
|
+
|
33
|
+
configure
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# This Karafka component is a Pro component under a commercial license.
|
4
|
+
# This Karafka component is NOT licensed under LGPL.
|
5
|
+
#
|
6
|
+
# All of the commercial components are present in the lib/karafka/pro directory of this
|
7
|
+
# repository and their usage requires commercial license agreement.
|
8
|
+
#
|
9
|
+
# Karafka has also commercial-friendly license, commercial support and commercial components.
|
10
|
+
#
|
11
|
+
# By sending a pull request to the pro components, you are agreeing to transfer the copyright of
|
12
|
+
# your code to Maciej Mensfeld.
|
13
|
+
|
14
|
+
module Karafka
|
15
|
+
module Web
|
16
|
+
module Pro
|
17
|
+
module Ui
|
18
|
+
module Lib
|
19
|
+
module Branding
|
20
|
+
# Contracts for checking branding related setup
|
21
|
+
module Contracts
|
22
|
+
# Makes sure, all the expected UI branding config is defined as it should be
|
23
|
+
class Config < ::Karafka::Contracts::Base
|
24
|
+
configure do |config|
|
25
|
+
config.error_messages = YAML.safe_load(
|
26
|
+
File.read(
|
27
|
+
File.join(Karafka::Web.gem_root, 'config', 'locales', 'pro_errors.yml')
|
28
|
+
)
|
29
|
+
).fetch('en').fetch('validations').fetch('config')
|
30
|
+
end
|
31
|
+
|
32
|
+
nested(:ui) do
|
33
|
+
nested(:branding) do
|
34
|
+
required(:type) do |val|
|
35
|
+
# Type of branding style wrapping needs to align with what we support
|
36
|
+
# in other places
|
37
|
+
::Karafka::Web::Ui::Helpers::TailwindHelper::TYPES.include?(val)
|
38
|
+
end
|
39
|
+
|
40
|
+
required(:label) do |val|
|
41
|
+
val == false || (val.is_a?(String) && val.size.positive?)
|
42
|
+
end
|
43
|
+
|
44
|
+
required(:notice) do |val|
|
45
|
+
val == false || (val.is_a?(String) && val.size.positive?)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# This Karafka component is a Pro component under a commercial license.
|
4
|
+
# This Karafka component is NOT licensed under LGPL.
|
5
|
+
#
|
6
|
+
# All of the commercial components are present in the lib/karafka/pro directory of this
|
7
|
+
# repository and their usage requires commercial license agreement.
|
8
|
+
#
|
9
|
+
# Karafka has also commercial-friendly license, commercial support and commercial components.
|
10
|
+
#
|
11
|
+
# By sending a pull request to the pro components, you are agreeing to transfer the copyright of
|
12
|
+
# your code to Maciej Mensfeld.
|
13
|
+
|
14
|
+
module Karafka
|
15
|
+
module Web
|
16
|
+
module Pro
|
17
|
+
module Ui
|
18
|
+
module Lib
|
19
|
+
# Namespace for UI branding related stuff
|
20
|
+
# Branding allows users to set an extra label and notice per env so users won't be
|
21
|
+
# confused by dev vs prod etc.
|
22
|
+
module Branding
|
23
|
+
class << self
|
24
|
+
# Validates that the UI branding config is correct
|
25
|
+
#
|
26
|
+
# @param config [Karafka::Core::Configurable::Node] web config
|
27
|
+
def post_setup(config)
|
28
|
+
Branding::Contracts::Config.new.validate!(config.to_h)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -45,11 +45,11 @@
|
|
45
45
|
|
46
46
|
<td class="commands-inline-3">
|
47
47
|
<%
|
48
|
-
|
48
|
+
trace_path = root_path('commanding', process.id, 'trace')
|
49
49
|
disabled_class = process.status != 'stopped' ? '' : 'btn-disabled'
|
50
50
|
%>
|
51
|
-
<form action="<%=
|
52
|
-
<%== csrf_tag(
|
51
|
+
<form action="<%= trace_path %>" method="post" class="inline" title="Trace">
|
52
|
+
<%== csrf_tag(trace_path) %>
|
53
53
|
|
54
54
|
<button type="submit" class="btn btn-info btn-sm <%= disabled_class %>">
|
55
55
|
<%== icon(:gear) %>
|
@@ -1,21 +1,21 @@
|
|
1
1
|
<% if Karafka::Web.config.commanding.active && !process.tags.include?('embedded') %>
|
2
2
|
<div class="col-span-12 flex justify-end space-x-2 mb-6">
|
3
3
|
<%
|
4
|
-
|
4
|
+
trace_path = root_path('commanding', process.id, 'trace')
|
5
5
|
disabled_class = process.status != 'stopped' ? '' : 'btn-disabled'
|
6
6
|
%>
|
7
7
|
<form
|
8
|
-
action="<%=
|
8
|
+
action="<%= trace_path %>"
|
9
9
|
method="post"
|
10
10
|
class="inline-flex items-center"
|
11
11
|
>
|
12
|
-
<%== csrf_tag(
|
12
|
+
<%== csrf_tag(trace_path) %>
|
13
13
|
<button
|
14
14
|
type="submit"
|
15
15
|
class="btn btn-info btn-sm <%= disabled_class %>"
|
16
16
|
>
|
17
17
|
<%== icon(:gear) %>
|
18
|
-
|
18
|
+
Trace
|
19
19
|
</button>
|
20
20
|
</form>
|
21
21
|
|
@@ -30,7 +30,7 @@
|
|
30
30
|
<%== csrf_tag(enable_path) %>
|
31
31
|
<button
|
32
32
|
type="submit"
|
33
|
-
class="btn btn-success btn-sm
|
33
|
+
class="btn btn-success btn-sm <%= disabled_class %>"
|
34
34
|
>
|
35
35
|
<%== icon(:check) %>
|
36
36
|
</button>
|
@@ -50,7 +50,7 @@
|
|
50
50
|
<%== csrf_tag(disable_path) %>
|
51
51
|
<button
|
52
52
|
type="submit"
|
53
|
-
class="btn btn-warning btn-sm
|
53
|
+
class="btn btn-warning btn-sm <%= disabled_class %>"
|
54
54
|
|
55
55
|
>
|
56
56
|
<%== icon(:pause) %>
|
@@ -10,6 +10,7 @@
|
|
10
10
|
<th>Subscription group</th>
|
11
11
|
<th><%== sort_link('Topic', :name) %></th>
|
12
12
|
<th>Type</th>
|
13
|
+
<th>Assigned</th>
|
13
14
|
<th><%== sort_link(:active?) %></th>
|
14
15
|
<th></th>
|
15
16
|
</tr>
|
@@ -21,6 +22,7 @@
|
|
21
22
|
'routing/topic',
|
22
23
|
locals: {
|
23
24
|
subscription_group: topic.subscription_group,
|
25
|
+
consumer_group: consumer_group.id,
|
24
26
|
topic: topic
|
25
27
|
}
|
26
28
|
)
|
@@ -20,6 +20,16 @@
|
|
20
20
|
<% end %>
|
21
21
|
</td>
|
22
22
|
|
23
|
+
<td>
|
24
|
+
<% assigned = @assigned[consumer_group].include?(topic.name) %>
|
25
|
+
|
26
|
+
<% if assigned %>
|
27
|
+
<%== badge_success assigned %>
|
28
|
+
<% else %>
|
29
|
+
<%== badge_secondary assigned %>
|
30
|
+
<% end %>
|
31
|
+
</td>
|
32
|
+
|
23
33
|
<td>
|
24
34
|
<% if topic.active? %>
|
25
35
|
<%== badge_success topic.active? %>
|