From 5b85b04edbb8487cbc1f8b4b7162913db9321816 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Mon, 4 Mar 2024 00:05:19 -0300 Subject: [PATCH] Update GenericNode and flowStore --- .../src/CustomNodes/GenericNode/index.tsx | 46 +++++++++++-------- src/frontend/src/stores/flowStore.ts | 5 +- 2 files changed, 29 insertions(+), 22 deletions(-) diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index a7126fff7..094791a26 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -9,6 +9,7 @@ import Loading from "../../components/ui/loading"; import { Textarea } from "../../components/ui/textarea"; import Xmark from "../../components/ui/xmark"; import { + RUN_TIMESTAMP_PREFIX, STATUS_BUILD, STATUS_BUILDING, priorityFields, @@ -105,7 +106,7 @@ export default function GenericNode({ if (duration === undefined) { return ""; } else { - return `Duration: ${duration}`; + return `${duration}`; } }; const durationString = getDurationString(validationStatus?.data.duration); @@ -493,14 +494,32 @@ export default function GenericNode({ ) : !validationStatus ? ( {STATUS_BUILD} ) : ( -
- {typeof validationStatus.params === "string" - ? `${durationString}\n${validationStatus.params}` - .split("\n") - .map((line, index) => ( -
{line}
- )) - : durationString} +
+
+ {lastRunTime && ( +
+
{RUN_TIMESTAMP_PREFIX}
+
+ {lastRunTime} +
+
+ )} +
+
+
Duration:
+
+ {validationStatus?.data.duration} +
+
+
+ + Output + + {validationStatus?.params + .split("\n") + .map((line, index) => ( +
{line}
+ ))}
) } @@ -725,15 +744,6 @@ export default function GenericNode({ showNode={showNode} /> )} -
- {lastRunTime && ( -
- {lastRunTime.split("\n").map((line, index) => ( -
{line}
- ))} -
- )} -
)} diff --git a/src/frontend/src/stores/flowStore.ts b/src/frontend/src/stores/flowStore.ts index f27acbcdc..44aade7bd 100644 --- a/src/frontend/src/stores/flowStore.ts +++ b/src/frontend/src/stores/flowStore.ts @@ -13,7 +13,6 @@ import { FLOW_BUILD_SUCCESS_ALERT, MISSED_ERROR_ALERT, } from "../constants/alerts_constants"; -import { RUN_TIMESTAMP_PREFIX } from "../constants/constants"; import { BuildStatus } from "../constants/enums"; import { getFlowPool } from "../controllers/API"; import { VertexBuildTypeAPI } from "../types/api"; @@ -558,9 +557,7 @@ const useFlowStore = create((set, get) => ({ }; if (status == BuildStatus.BUILT) { const timestamp_string = new Date(Date.now()).toLocaleString(); - newFlowBuildStatus[ - id - ].timestamp = `${RUN_TIMESTAMP_PREFIX} ${timestamp_string}`; + newFlowBuildStatus[id].timestamp = timestamp_string; } console.log("updateBuildStatus", newFlowBuildStatus); });