diff --git a/CHANGELOG.md b/CHANGELOG.md index 54e5427c..bc060c73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - **[Feature]** Introduce ability to download raw payloads. - **[Feature]** Introduce ability to download deserialized message payload as JSON. - [Enhancement] Update order of topics creation for the setup of Web to support zero-downtime setup of Web in running Karafka projects. +- [Enhancement] Add space delimiter to counters numbers to make them look better. - [Fix] Fix a case where charts aggregated data would not include all topics. - [Fix] Make sure, that most recent per partition data for Health is never overwritten by an old state from a previous partition owner. - [Fix] Cache assets for 1 year instead of 7 days. diff --git a/lib/karafka/web/ui/helpers/application_helper.rb b/lib/karafka/web/ui/helpers/application_helper.rb index 503617d2..a4ad9c9c 100644 --- a/lib/karafka/web/ui/helpers/application_helper.rb +++ b/lib/karafka/web/ui/helpers/application_helper.rb @@ -101,12 +101,13 @@ def format_memory(mem_kb) # Converts number to a more friendly delimiter based version # @param number [Numeric] + # @param delimiter [String] delimiter (comma by default) # @return [String] number with delimiter - def number_with_delimiter(number) + def number_with_delimiter(number, delimiter = ',') return '' unless number parts = number.to_s.to_str.split('.') - parts[0].gsub!(/(\d)(?=(\d\d\d)+(?!\d))/, '\1,') + parts[0].gsub!(/(\d)(?=(\d\d\d)+(?!\d))/, "\\1#{delimiter}") parts.join('.') end diff --git a/lib/karafka/web/ui/pro/views/consumers/_counters.erb b/lib/karafka/web/ui/pro/views/consumers/_counters.erb index f78aedaf..1989e064 100644 --- a/lib/karafka/web/ui/pro/views/consumers/_counters.erb +++ b/lib/karafka/web/ui/pro/views/consumers/_counters.erb @@ -6,40 +6,56 @@