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

marat pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-karavan.git


The following commit(s) were added to refs/heads/main by this push:
     new 5ab0ff8  Fix #509
5ab0ff8 is described below

commit 5ab0ff8ce8263b8d21f05cb450bff28bb12e36ad
Author: Marat Gubaidullin <marat.gubaidul...@gmail.com>
AuthorDate: Tue Nov 1 09:32:32 2022 -0400

    Fix #509
---
 .../src/main/java/org/apache/camel/karavan/model/CamelStatus.java   | 6 +++++-
 karavan-app/src/main/webapp/src/dashboard/DashboardPage.tsx         | 6 ++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git 
a/karavan-app/src/main/java/org/apache/camel/karavan/model/CamelStatus.java 
b/karavan-app/src/main/java/org/apache/camel/karavan/model/CamelStatus.java
index a02adf0..30e6f9b 100644
--- a/karavan-app/src/main/java/org/apache/camel/karavan/model/CamelStatus.java
+++ b/karavan-app/src/main/java/org/apache/camel/karavan/model/CamelStatus.java
@@ -26,7 +26,7 @@ public class CamelStatus {
         DOWN,
         @ProtoEnumValue(number = 1, name = "UP")
         UP,
-        @ProtoEnumValue(number = 2, name = "NA")
+        @ProtoEnumValue(number = 2, name = "N/A")
         NA
     }
 
@@ -36,6 +36,10 @@ public class CamelStatus {
     public CamelStatus(String projectId, String env) {
         this.projectId = projectId;
         this.env = env;
+        this.contextStatus = Status.NA;
+        this.consumerStatus = Status.NA;
+        this.routesStatus = Status.NA;
+        this.registryStatus = Status.NA;
     }
 
     @ProtoFactory
diff --git a/karavan-app/src/main/webapp/src/dashboard/DashboardPage.tsx 
b/karavan-app/src/main/webapp/src/dashboard/DashboardPage.tsx
index f1cade4..9c65bd7 100644
--- a/karavan-app/src/main/webapp/src/dashboard/DashboardPage.tsx
+++ b/karavan-app/src/main/webapp/src/dashboard/DashboardPage.tsx
@@ -302,8 +302,10 @@ export class DashboardPage extends React.Component<Props, 
State> {
                                         <Flex direction={{default: "column"}}>
                                             
{this.getCamelStatusByEnvironments(deployment).map(value => {
                                                 const color = value[1] ? 
(value[1].consumerStatus === "UP" ? "green" : "red") : "grey";
-                                                const icon = value[1] ? 
(value[1].consumerStatus === "UP" ? <UpIcon/> : <DownIcon/>) : undefined;
-                                                const text = value[1] ? 
value[1]?.contextVersion : "???";
+                                                let icon = undefined;
+                                                if (value[1]?.consumerStatus 
=== "UP") icon = <UpIcon/>
+                                                if (value[1]?.consumerStatus 
=== "DOWN") icon = <DownIcon/>
+                                                const text = value[1] && 
value[1]?.contextVersion ? value[1]?.contextVersion : "???";
                                                 return <FlexItem 
key={value[0]}>
                                                     <LabelGroup numLabels={4} 
className="camel-label-group">
                                                         <Label color={color} 
className="table-label" icon={icon}>{text}</Label>

Reply via email to