Fixed a few UI inconsistencies

This commit is contained in:
Frikky
2023-11-17 05:19:18 +01:00
parent d6e37aa3fe
commit a0711dd453
4 changed files with 157 additions and 53 deletions
+6
View File
@@ -3409,6 +3409,12 @@ const ParsedAction = (props) => {
setSelectedActionEnvironment(env); setSelectedActionEnvironment(env);
selectedAction.environment = env.Name; selectedAction.environment = env.Name;
setSelectedAction(selectedAction); 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={{ style={{
backgroundColor: theme.palette.inputColor, backgroundColor: theme.palette.inputColor,
+82 -2
View File
@@ -21,6 +21,7 @@ import theme from '../theme.jsx';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs' import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'
import Pagination from '@mui/material/Pagination'; import Pagination from '@mui/material/Pagination';
import { triggers as alltriggers } from "../views/AngularWorkflow.jsx"
import { import {
DatePicker, DatePicker,
DateTimePicker, DateTimePicker,
@@ -29,6 +30,7 @@ import {
import { import {
OpenInNew as OpenInNewIcon, OpenInNew as OpenInNewIcon,
PlayArrow as PlayArrowIcon,
} from '@mui/icons-material'; } from '@mui/icons-material';
import { DataGrid, GridColDef, GridValueGetterParams } from '@mui/x-data-grid' import { DataGrid, GridColDef, GridValueGetterParams } from '@mui/x-data-grid'
@@ -176,11 +178,42 @@ const RuntimeDebugger = (props) => {
} }
}, []) }, [])
const imageSize = 30
const columns: GridColDef[] = [ const columns: GridColDef[] = [
{
field: 'execution_source',
headerName: 'Source',
width: 75,
renderCell: (params) => {
var foundSource = <PlayArrowIcon style={{color: theme.palette.primary.main, height: imageSize, width: imageSize, }} />
var source = params.row.execution_source
if (source === "schedule") {
foundSource = <img src={alltriggers[1].large_image} alt="schedule" style={{borderRadius: theme.palette.borderRadius, height: imageSize, width: imageSize, }} />
} else if (source === "webhook") {
foundSource = <img src={alltriggers[0].large_image} alt="webhook" style={{borderRadius: theme.palette.borderRadius, height: imageSize, width: imageSize, }} />
} else if (source === "subflow" || source.length === 36) {
foundSource = <img src={alltriggers[4].large_image} alt="subflow" style={{borderRadius: theme.palette.borderRadius, height: imageSize, width: imageSize, }} />
source = "subflow"
} else {
source = "manual"
}
return (
<span style={{}} onClick={() => {
//setStatus(params.row.status)
}}>
<Tooltip title={source} placement="top">
{foundSource}
</Tooltip>
</span>
)
},
},
{ {
field: 'status', field: 'status',
headerName: 'Status', headerName: 'Status',
width: 150, width: 100,
renderCell: (params) => ( renderCell: (params) => (
<span style={{cursor: "pointer", }} onClick={() => { <span style={{cursor: "pointer", }} onClick={() => {
setStatus(params.row.status) setStatus(params.row.status)
@@ -208,6 +241,7 @@ const RuntimeDebugger = (props) => {
</span> </span>
), ),
}, },
{ {
field: 'workflow results', field: 'workflow results',
headerName: '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 (
<span style={{}} onClick={() => {
}}>
{foundItems}
</span>
)
},
},
{
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 (
<span style={{}} onClick={() => {
}}>
{foundItems}
</span>
)
},
},
{ field: 'startTimestamp', headerName: 'Start time', width: 160, }, { field: 'startTimestamp', headerName: 'Start time', width: 160, },
{ field: 'endTimestamp', headerName: 'End time', width: 160, }, { field: 'endTimestamp', headerName: 'End time', width: 160, },
{ {
@@ -288,7 +368,7 @@ const RuntimeDebugger = (props) => {
} }
return ( return (
<div style={{minWidth: 1000, maxWidth: 1000, margin: "auto", }}> <div style={{minWidth: 1150, maxWidth: 1150, margin: "auto", }}>
<h1>Workflow Run Debugger</h1> <h1>Workflow Run Debugger</h1>
<form onSubmit={(e) => { <form onSubmit={(e) => {
submitSearch(workflowId, status, startTime, endTime, rowCursor, rowsPerPage) submitSearch(workflowId, status, startTime, endTime, rowCursor, rowsPerPage)
+49 -48
View File
@@ -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 }} style={{ minWidth: 125, maxWidth: 125 }}
/> />
<ListItemText <ListItemText
primary="Default" primary={"In Queue"}
style={{ minWidth: 125, maxWidth: 125 }} style={{ minWidth: 100, maxWidth: 100 }}
/> />
<ListItemText <ListItemText
primary={isCloud ? "Disabled" : "In Queue"} primary="Default"
style={{ minWidth: 100, maxWidth: 100 }} style={{ minWidth: 150, maxWidth: 150 }}
/>
<ListItemText
primary="Actions"
style={{ minWidth: 200, maxWidth: 200}}
/> />
<ListItemText <ListItemText
primary="Last Edited" primary="Last Edited"
style={{ minWidth: 170, maxWidth: 170 }} style={{ minWidth: 170, maxWidth: 170 }}
/> />
<ListItemText
primary="Actions"
style={{ minWidth: 150, maxWidth: 150 }}
/>
</ListItem> </ListItem>
{environments === undefined || environments === null {environments === undefined || environments === null
? 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"; bgColor = "#1f2023";
} }
// Check if there's a notification for it in userdata.priorities // Check if there's a notification for it in userdata.priorities
var showCPUAlert = false var showCPUAlert = false
var foundIndex = -1 var foundIndex = -1
if (userdata !== undefined && userdata !== null && userdata.priorities !== undefined && userdata.priorities !== null && userdata.priorities.length > 0) { 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) foundIndex = userdata.priorities.findIndex(prio => prio.name.includes("CPU") && prio.active === true)
if (foundIndex >= 0 && userdata.priorities[foundIndex].name.endsWith(environment.Name)) { if (foundIndex >= 0 && userdata.priorities[foundIndex].name.endsWith(environment.Name)) {
showCPUAlert = true 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 ( return (
<span key={index}> <span key={index}>
@@ -4069,8 +4069,18 @@ If you're interested, please let me know a time that works for you, or set up a
/> />
<ListItemText <ListItemText
style={{ style={{
minWidth: 125, minWidth: 100,
maxWidth: 125, maxWidth: 100,
overflow: "hidden",
marginLeft: 10,
}}
primary={queueSize}
/>
<ListItemText
style={{
minWidth: 140,
maxWidth: 140,
overflow: "hidden", overflow: "hidden",
}} }}
primary={environment.default ? "true" : null} primary={environment.default ? "true" : null}
@@ -4082,38 +4092,14 @@ If you're interested, please let me know a time that works for you, or set up a
onClick={() => setDefaultEnvironment(environment)} onClick={() => setDefaultEnvironment(environment)}
color="primary" color="primary"
> >
Make default Set Default
</Button> </Button>
)} )}
</ListItemText> </ListItemText>
<ListItemText <ListItemText
style={{ style={{
minWidth: 100, minWidth: 200,
maxWidth: 100, maxWidth: 200,
overflow: "hidden",
marginLeft: 10,
}}
primary={isCloud ? environment.archived.toString() : queueSize}
/>
<ListItemText
style={{
minWidth: 150,
maxWidth: 150,
overflow: "hidden",
}}
primary={
environment.edited !== undefined &&
environment.edited !== null &&
environment.edited !== 0
? new Date(environment.edited * 1000).toISOString()
: 0
}
/>
<ListItemText
style={{
minWidth: 300,
maxWidth: 300,
overflow: "hidden", overflow: "hidden",
marginLeft: 10, marginLeft: 10,
}} }}
@@ -4145,9 +4131,24 @@ If you're interested, please let me know a time that works for you, or set up a
> >
{isCloud && environment.Name.toLowerCase() === "cloud" ? "Rerun" : "Clear"} {isCloud && environment.Name.toLowerCase() === "cloud" ? "Rerun" : "Clear"}
</Button> </Button>
</ButtonGroup> </ButtonGroup>
</div> </div>
</ListItemText> </ListItemText>
<ListItemText
style={{
minWidth: 150,
maxWidth: 150,
overflow: "hidden",
}}
primary={
environment.edited !== undefined &&
environment.edited !== null &&
environment.edited !== 0
? new Date(environment.edited * 1000).toISOString()
: 0
}
/>
</ListItem> </ListItem>
{showCPUAlert === false ? null : {showCPUAlert === false ? null :
<ListItem key={index+"_cpu"} style={{ backgroundColor: bgColor }}> <ListItem key={index+"_cpu"} style={{ backgroundColor: bgColor }}>
+20 -3
View File
@@ -395,9 +395,10 @@ const AngularWorkflow = (defaultprops) => {
var to_be_copied = ""; var to_be_copied = "";
const [firstrequest, setFirstrequest] = React.useState(true); const [firstrequest, setFirstrequest] = React.useState(true);
const [cystyle] = useState(cytoscapestyle); const [cystyle] = useState(cytoscapestyle);
const [cy, setCy] = React.useState(); const [cy, setCy] = React.useState();
const [toolsApp, setToolsApp] = React.useState({}); const [toolsApp, setToolsApp] = React.useState({});
const [currentView, setCurrentView] = React.useState(0); const [currentView, setCurrentView] = React.useState(0);
const [triggerAuthentication, setTriggerAuthentication] = React.useState({}); const [triggerAuthentication, setTriggerAuthentication] = React.useState({});
const [triggerFolders, setTriggerFolders] = React.useState([]); const [triggerFolders, setTriggerFolders] = React.useState([]);
@@ -6344,6 +6345,9 @@ const AngularWorkflow = (defaultprops) => {
} }
const fetchRecommendations = (inputWorkflow) => { const fetchRecommendations = (inputWorkflow) => {
//console.log("Disabled recommendations")
//return
const parsedWorkflow = JSON.parse(JSON.stringify(inputWorkflow)) const parsedWorkflow = JSON.parse(JSON.stringify(inputWorkflow))
fetch(globalUrl + "/api/v1/workflows/recommend", { fetch(globalUrl + "/api/v1/workflows/recommend", {
@@ -14992,6 +14996,18 @@ const AngularWorkflow = (defaultprops) => {
</Tooltip> </Tooltip>
) : null} ) : null}
</div> </div>
{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" ?
<div style={{ display: "flex", marginLeft: 10, }}>
<Typography variant="body1">
<b>Env &nbsp;&nbsp;&nbsp;&nbsp;</b>
</Typography>
<Typography variant="body1" color="textSecondary" style={{color: "#f85a3e", cursor: "pointer", }} onClick={() => {
window.open("/admin?tab=environments", "_blank")
}}>
{executionData.workflow.actions[0].environment}
</Typography>
</div>
: null}
{executionData.status !== undefined && {executionData.status !== undefined &&
executionData.status.length > 0 ? ( executionData.status.length > 0 ? (
<div style={{ display: "flex", marginLeft: 10, }}> <div style={{ display: "flex", marginLeft: 10, }}>
@@ -15973,8 +15989,9 @@ const AngularWorkflow = (defaultprops) => {
cy={(incy) => { cy={(incy) => {
// FIXME: There's something specific loading when // FIXME: There's something specific loading when
// you do the first hover of a node. Why is this different? // you do the first hover of a node. Why is this different?
//console.log("CY: ", incy)
setCy(incy);
setCy(incy);
}} }}
/> />
</span> </span>