From a0711dd453313a4113f42fb2fb71fc0b0726910d Mon Sep 17 00:00:00 2001 From: Frikky Date: Fri, 17 Nov 2023 05:19:18 +0100 Subject: [PATCH] Fixed a few UI inconsistencies --- frontend/src/components/ParsedAction.jsx | 6 ++ frontend/src/components/RuntimeDebugger.jsx | 84 +++++++++++++++++- frontend/src/views/Admin.jsx | 97 +++++++++++---------- frontend/src/views/AngularWorkflow.jsx | 23 ++++- 4 files changed, 157 insertions(+), 53 deletions(-) diff --git a/frontend/src/components/ParsedAction.jsx b/frontend/src/components/ParsedAction.jsx index c069499f..e10c6e5f 100755 --- a/frontend/src/components/ParsedAction.jsx +++ b/frontend/src/components/ParsedAction.jsx @@ -3409,6 +3409,12 @@ const ParsedAction = (props) => { setSelectedActionEnvironment(env); selectedAction.environment = env.Name; setSelectedAction(selectedAction); + + for (let actionkey in workflow.actions) { + workflow.actions[actionkey].environment = env.Name + } + setWorkflow(workflow) + toast("Set environment for ALL actions to " + env.Name) }} style={{ backgroundColor: theme.palette.inputColor, diff --git a/frontend/src/components/RuntimeDebugger.jsx b/frontend/src/components/RuntimeDebugger.jsx index fa149570..8bb82514 100644 --- a/frontend/src/components/RuntimeDebugger.jsx +++ b/frontend/src/components/RuntimeDebugger.jsx @@ -21,6 +21,7 @@ import theme from '../theme.jsx'; import dayjs from 'dayjs'; import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs' import Pagination from '@mui/material/Pagination'; +import { triggers as alltriggers } from "../views/AngularWorkflow.jsx" import { DatePicker, DateTimePicker, @@ -29,6 +30,7 @@ import { import { OpenInNew as OpenInNewIcon, + PlayArrow as PlayArrowIcon, } from '@mui/icons-material'; import { DataGrid, GridColDef, GridValueGetterParams } from '@mui/x-data-grid' @@ -176,11 +178,42 @@ const RuntimeDebugger = (props) => { } }, []) + const imageSize = 30 const columns: GridColDef[] = [ + { + field: 'execution_source', + headerName: 'Source', + width: 75, + renderCell: (params) => { + var foundSource = + + var source = params.row.execution_source + if (source === "schedule") { + foundSource = schedule + } else if (source === "webhook") { + foundSource = webhook + } else if (source === "subflow" || source.length === 36) { + foundSource = subflow + source = "subflow" + } else { + source = "manual" + } + + return ( + { + //setStatus(params.row.status) + }}> + + {foundSource} + + + ) + }, + }, { field: 'status', headerName: 'Status', - width: 150, + width: 100, renderCell: (params) => ( { setStatus(params.row.status) @@ -208,6 +241,7 @@ const RuntimeDebugger = (props) => { ), }, + { field: 'workflow results', headerName: 'Results', @@ -235,6 +269,52 @@ const RuntimeDebugger = (props) => { ) }, }, + { + field: 'finished', + headerName: 'Finished', + width: 75, + renderCell: (params) => { + var foundItems = 0 + var extraItems = 0 + if (params.row.results !== null && params.row.results !== undefined) { + for (let key in params.row.results) { + if (params.row.results[key].status === "SUCCESS") { + foundItems += 1 + } + } + } + + return ( + { + }}> + {foundItems} + + ) + }, + }, + { + field: 'skipped', + headerName: 'Skipped', + width: 75, + renderCell: (params) => { + var foundItems = 0 + var extraItems = 0 + if (params.row.results !== null && params.row.results !== undefined) { + for (let key in params.row.results) { + if (params.row.results[key].status === "SKIPPED") { + foundItems += 1 + } + } + } + + return ( + { + }}> + {foundItems} + + ) + }, + }, { field: 'startTimestamp', headerName: 'Start time', width: 160, }, { field: 'endTimestamp', headerName: 'End time', width: 160, }, { @@ -288,7 +368,7 @@ const RuntimeDebugger = (props) => { } return ( -
+

Workflow Run Debugger

{ submitSearch(workflowId, status, startTime, endTime, rowCursor, rowsPerPage) diff --git a/frontend/src/views/Admin.jsx b/frontend/src/views/Admin.jsx index 565597cc..1aab3b4c 100755 --- a/frontend/src/views/Admin.jsx +++ b/frontend/src/views/Admin.jsx @@ -3937,21 +3937,21 @@ If you're interested, please let me know a time that works for you, or set up a style={{ minWidth: 125, maxWidth: 125 }} /> + - {environments === undefined || environments === null ? null @@ -3969,20 +3969,20 @@ If you're interested, please let me know a time that works for you, or set up a bgColor = "#1f2023"; } - // Check if there's a notification for it in userdata.priorities - var showCPUAlert = false - var foundIndex = -1 - if (userdata !== undefined && userdata !== null && userdata.priorities !== undefined && userdata.priorities !== null && userdata.priorities.length > 0) { - foundIndex = userdata.priorities.findIndex(prio => prio.name.includes("CPU") && prio.active === true) + // Check if there's a notification for it in userdata.priorities + var showCPUAlert = false + var foundIndex = -1 + if (userdata !== undefined && userdata !== null && userdata.priorities !== undefined && userdata.priorities !== null && userdata.priorities.length > 0) { + foundIndex = userdata.priorities.findIndex(prio => prio.name.includes("CPU") && prio.active === true) - if (foundIndex >= 0 && userdata.priorities[foundIndex].name.endsWith(environment.Name)) { - showCPUAlert = true - } - } + if (foundIndex >= 0 && userdata.priorities[foundIndex].name.endsWith(environment.Name)) { + showCPUAlert = true + } + } - console.log("Show CPU alert: ", showCPUAlert) + //console.log("Show CPU alert: ", showCPUAlert) - const queueSize = isCloud ? -1 : environment.queue !== undefined && environment.queue !== null ? environment.queue < 0 ? 0 : environment.queue > 100 ? ">100" : environment.queue : 0 + const queueSize = environment.queue !== undefined && environment.queue !== null ? environment.queue < 0 ? 0 : environment.queue > 99 ? ">99" : environment.queue : 0 return ( @@ -4069,8 +4069,18 @@ If you're interested, please let me know a time that works for you, or set up a /> + setDefaultEnvironment(environment)} color="primary" > - Make default + Set Default )} - - {isCloud && environment.Name.toLowerCase() === "cloud" ? "Rerun" : "Clear"} +
+ {showCPUAlert === false ? null : diff --git a/frontend/src/views/AngularWorkflow.jsx b/frontend/src/views/AngularWorkflow.jsx index 8133d485..cb973f31 100755 --- a/frontend/src/views/AngularWorkflow.jsx +++ b/frontend/src/views/AngularWorkflow.jsx @@ -395,9 +395,10 @@ const AngularWorkflow = (defaultprops) => { var to_be_copied = ""; const [firstrequest, setFirstrequest] = React.useState(true); const [cystyle] = useState(cytoscapestyle); + const [cy, setCy] = React.useState(); - const [toolsApp, setToolsApp] = React.useState({}); + const [toolsApp, setToolsApp] = React.useState({}); const [currentView, setCurrentView] = React.useState(0); const [triggerAuthentication, setTriggerAuthentication] = React.useState({}); const [triggerFolders, setTriggerFolders] = React.useState([]); @@ -6344,6 +6345,9 @@ const AngularWorkflow = (defaultprops) => { } const fetchRecommendations = (inputWorkflow) => { + //console.log("Disabled recommendations") + //return + const parsedWorkflow = JSON.parse(JSON.stringify(inputWorkflow)) fetch(globalUrl + "/api/v1/workflows/recommend", { @@ -14992,6 +14996,18 @@ const AngularWorkflow = (defaultprops) => { ) : null}
+ {executionData.workflow !== undefined && executionData.workflow !== null && executionData.workflow.actions !== undefined && executionData.workflow.actions !== null && executionData.workflow.actions.length > 0 && executionData.workflow.actions[0].environment !== "Cloud" ? +
+ + Env      + + { + window.open("/admin?tab=environments", "_blank") + }}> + {executionData.workflow.actions[0].environment} + +
+ : null} {executionData.status !== undefined && executionData.status.length > 0 ? (
@@ -15973,8 +15989,9 @@ const AngularWorkflow = (defaultprops) => { cy={(incy) => { // FIXME: There's something specific loading when // you do the first hover of a node. Why is this different? - //console.log("CY: ", incy) - setCy(incy); + + + setCy(incy); }} />