This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch fix/camel-tui-consumers-tab
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/fix/camel-tui-consumers-tab by 
this push:
     new 3e20b3231277 TUI: show DOWN count in red on Health tab label when 
checks are failing
3e20b3231277 is described below

commit 3e20b32312775a17b210e77b9a0295fe71840063
Author: Claus Ibsen <[email protected]>
AuthorDate: Sat May 16 15:10:54 2026 +0200

    TUI: show DOWN count in red on Health tab label when checks are failing
    
    When one or more health checks are DOWN, the Health tab title changes
    from the normal yellow total-count badge to a red '(N DOWN)' indicator,
    giving an immediate at-a-glance signal without needing to open the tab.
    
    Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
---
 .../camel/dsl/jbang/core/commands/tui/CamelMonitor.java    | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/CamelMonitor.java
 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/CamelMonitor.java
index 79134bb09460..670717045870 100644
--- 
a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/CamelMonitor.java
+++ 
b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/CamelMonitor.java
@@ -818,6 +818,8 @@ public class CamelMonitor extends CamelCommand {
         int consumerCount = hasSelection ? sel.consumers.size() : 0;
         int endpointCount = hasSelection ? sel.endpoints.size() : 0;
         int healthCount = hasSelection ? sel.healthChecks.size() : 0;
+        long healthDownCount = hasSelection
+                ? sel.healthChecks.stream().filter(hc -> 
"DOWN".equals(hc.state)).count() : 0;
         int historyCount = hasSelection ? historyEntries.size() : 0;
         boolean hasTraces = hasSelection && !traces.get().isEmpty();
 
@@ -828,7 +830,7 @@ public class CamelMonitor extends CamelCommand {
                         badge(" 3 Routes ", routeCount),
                         badge(" 4 Consumers ", consumerCount),
                         badge(" 5 Endpoints ", endpointCount),
-                        badge(" 6 Health ", healthCount),
+                        badgeHealth(" 6 Health ", healthCount, 
healthDownCount),
                         badge(" 7 History ", historyCount),
                         hasTraces
                                 ? Line.from(Span.raw(" 8 Trace "), 
Span.styled("(*)", Style.EMPTY.fg(Color.YELLOW).bold()),
@@ -2979,6 +2981,16 @@ public class CamelMonitor extends CamelCommand {
         return Cell.from(Span.styled(" ".repeat(leftPad) + text, style));
     }
 
+    private static Line badgeHealth(String label, long total, long down) {
+        if (down > 0) {
+            return Line.from(
+                    Span.raw(label),
+                    Span.styled("(" + down + " DOWN)", 
Style.EMPTY.fg(Color.RED).bold()),
+                    Span.raw(" "));
+        }
+        return badge(label, total);
+    }
+
     private static Line badge(String label, long count) {
         if (count > 0) {
             return Line.from(

Reply via email to