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 8eecca53 Karavan in Docker for #817
8eecca53 is described below

commit 8eecca53d44f55ea57a012263d2595baa33036ff
Author: Marat Gubaidullin <[email protected]>
AuthorDate: Wed Sep 6 14:17:34 2023 -0400

    Karavan in Docker for #817
---
 karavan-web/docker/Dockerfile.devmode                            | 2 +-
 karavan-web/karavan-app/src/main/webui/src/api/ProjectStore.ts   | 6 +++---
 .../karavan-app/src/main/webui/src/project/build/BuildStatus.tsx | 9 +++------
 3 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/karavan-web/docker/Dockerfile.devmode 
b/karavan-web/docker/Dockerfile.devmode
index 144ee1f6..ff387637 100644
--- a/karavan-web/docker/Dockerfile.devmode
+++ b/karavan-web/docker/Dockerfile.devmode
@@ -21,7 +21,7 @@ RUN curl -Ls https://sh.jbang.dev | bash -s - app setup \
     && apk update && apk add git \
     && mkdir -p $CODE_DIR \
     && jbang trust add  --quiet  https://github.com/apache/camel \
-    && jbang app install camel@apache/camel
+    && jbang app install camel@apache/camel \
     && jbang config set cache-evict never
 
 EXPOSE 8080
diff --git a/karavan-web/karavan-app/src/main/webui/src/api/ProjectStore.ts 
b/karavan-web/karavan-app/src/main/webui/src/api/ProjectStore.ts
index b8c064a5..5c162c08 100644
--- a/karavan-web/karavan-app/src/main/webui/src/api/ProjectStore.ts
+++ b/karavan-web/karavan-app/src/main/webui/src/api/ProjectStore.ts
@@ -272,7 +272,7 @@ interface LogState {
     currentLine: number;
     setCurrentLine: (currentLine: number) => void;
     showLog: boolean,
-    setShowLog: (showLog: boolean) => void;
+    setShowLog: (showLog: boolean, type: 'container' | 'build' | 'none', 
podName: string) => void;
     type: 'container' | 'build' | 'none',
     setType: (type: 'container' | 'build' | 'none') => void,
 }
@@ -300,8 +300,8 @@ export const useLogStore = 
createWithEqualityFn<LogState>((set) => ({
         set((state: LogState) => ({currentLine: currentLine}))
     },
     showLog: false,
-    setShowLog: (showLog: boolean) => {
-        set(() => ({showLog: showLog}));
+    setShowLog: (showLog: boolean, type: 'container' | 'build' | 'none', 
podName: string) => {
+        set(() => ({showLog: showLog, type: type, podName: podName}));
     },
     type: "none",
     setType: (type: 'container' | 'build' | 'none') =>  {
diff --git 
a/karavan-web/karavan-app/src/main/webui/src/project/build/BuildStatus.tsx 
b/karavan-web/karavan-app/src/main/webui/src/project/build/BuildStatus.tsx
index b757ac75..c5802145 100644
--- a/karavan-web/karavan-app/src/main/webui/src/project/build/BuildStatus.tsx
+++ b/karavan-web/karavan-app/src/main/webui/src/project/build/BuildStatus.tsx
@@ -25,6 +25,7 @@ interface Props {
 export function BuildStatus (props: Props) {
 
     const [project] = useProjectStore((s) => [s.project], shallow);
+    const [setShowLog] = useLogStore((s) => [s.setShowLog], shallow);
     const [containers, deployments, camels, pipelineStatuses] =
         useStatusesStore((s) => [s.containers, s.deployments, s.camels, 
s.pipelineStatuses], shallow);
     const [isPushing, setIsPushing] = useState<boolean>(false);
@@ -60,6 +61,7 @@ export function BuildStatus (props: Props) {
 
     function build() {
         setIsBuilding(true);
+        setShowLog(false,'build', '')
         KaravanApi.buildProject(project, env, res => {
             if (res.status === 200 || res.status === 201) {
                 setIsBuilding(false);
@@ -72,7 +74,6 @@ export function BuildStatus (props: Props) {
     function rollout() {
         setIsRolling(true);
         KaravanApi.rolloutDeployment(project.projectId, env, res => {
-            console.log(res)
             if (res.status === 200 || res.status === 201) {
                 setIsRolling(false);
             } else {
@@ -165,11 +166,7 @@ export function BuildStatus (props: Props) {
                                         <Label icon={ready ? <UpIcon/> : 
<DownIcon/>} color={ready ? "green" : "red"}>
                                             <Button variant="link" 
className="labeled-button"
                                                     onClick={e => {
-                                                        useLogStore.setState({
-                                                            showLog: true,
-                                                            type: 'container',
-                                                            podName: 
pod.containerName
-                                                        });
+                                                        
setShowLog(true,'container', pod.containerName);
                                                     }}>
                                                 {pod.containerName}
                                             </Button>

Reply via email to