Fixed left sidebar tabbing and sizing
This commit is contained in:
+68
-140
@@ -10,6 +10,8 @@ import Drawer from '@material-ui/core/Drawer';
|
|||||||
import Button from '@material-ui/core/Button';
|
import Button from '@material-ui/core/Button';
|
||||||
import Paper from '@material-ui/core/Paper';
|
import Paper from '@material-ui/core/Paper';
|
||||||
import Grid from '@material-ui/core/Grid';
|
import Grid from '@material-ui/core/Grid';
|
||||||
|
import Tabs from '@material-ui/core/Tabs';
|
||||||
|
import Tab from '@material-ui/core/Tab';
|
||||||
import ButtonBase from '@material-ui/core/ButtonBase';
|
import ButtonBase from '@material-ui/core/ButtonBase';
|
||||||
import Tooltip from '@material-ui/core/Tooltip';
|
import Tooltip from '@material-ui/core/Tooltip';
|
||||||
import Select from '@material-ui/core/Select';
|
import Select from '@material-ui/core/Select';
|
||||||
@@ -100,7 +102,7 @@ const AngularWorkflow = (props) => {
|
|||||||
const [cy, setCy] = React.useState()
|
const [cy, setCy] = React.useState()
|
||||||
|
|
||||||
const [appSearch, setAppSearch] = React.useState("")
|
const [appSearch, setAppSearch] = React.useState("")
|
||||||
const [currentView, setCurrentView] = React.useState("apps")
|
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([])
|
||||||
|
|
||||||
@@ -164,9 +166,6 @@ const AngularWorkflow = (props) => {
|
|||||||
|
|
||||||
const [lastSaved, setLastSaved] = React.useState(true)
|
const [lastSaved, setLastSaved] = React.useState(true)
|
||||||
|
|
||||||
const [AppsHoverColor, setAppsHoverColor] = useState(hoverOutColor);
|
|
||||||
const [VariablesHoverColor, setVariablesHoverColor] = useState(hoverOutColor);
|
|
||||||
const [HookHoverColor, setHookHoverColor] = useState(hoverOutColor);
|
|
||||||
const [appAdded, setAppAdded] = useState(false)
|
const [appAdded, setAppAdded] = useState(false)
|
||||||
const [update, setUpdate] = useState("");
|
const [update, setUpdate] = useState("");
|
||||||
const [workflowExecutions, setWorkflowExecutions] = React.useState([]);
|
const [workflowExecutions, setWorkflowExecutions] = React.useState([]);
|
||||||
@@ -549,68 +548,6 @@ const AngularWorkflow = (props) => {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
const executeWorkflowWebsocket = () => {
|
|
||||||
if (!lastSaved) {
|
|
||||||
//alert.error("You might have forgotten to save before executing.")
|
|
||||||
console.log("FIXME: Might have forgotten to save before executing.")
|
|
||||||
}
|
|
||||||
|
|
||||||
var returncheck = monitorUpdates()
|
|
||||||
if (!returncheck) {
|
|
||||||
alert.error("No startnode set.")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
setVisited([])
|
|
||||||
setExecutionRunning(true)
|
|
||||||
setExecutionRequest({})
|
|
||||||
|
|
||||||
var curelements = cy.elements()
|
|
||||||
for (var i = 0; i < curelements.length; i++) {
|
|
||||||
curelements[i].addClass("not-executing-highlight")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (executionText.length > 0) {
|
|
||||||
alert.success("Starting execution with argument "+executionText)
|
|
||||||
} else {
|
|
||||||
alert.success("Starting execution")
|
|
||||||
}
|
|
||||||
|
|
||||||
const data = {"execution_argument": executionText}
|
|
||||||
fetch(globalUrl+"/api/v1/workflows/"+props.match.params.key+"/execute_fs", {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
'Accept': 'application/json',
|
|
||||||
},
|
|
||||||
credentials: "include",
|
|
||||||
body: JSON.stringify(data),
|
|
||||||
})
|
|
||||||
.then((response) => {
|
|
||||||
if (response.status !== 200) {
|
|
||||||
console.log("Status not 200 for WORKFLOW EXECUTION :O!")
|
|
||||||
}
|
|
||||||
|
|
||||||
return response.json()
|
|
||||||
})
|
|
||||||
.then((responseJson) => {
|
|
||||||
if (!responseJson.success) {
|
|
||||||
alert.error("Failed to start: "+responseJson.reason)
|
|
||||||
stop()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
setExecutionRequest({
|
|
||||||
"execution_id": responseJson.execution_id,
|
|
||||||
"authorization": responseJson.authorization,
|
|
||||||
})
|
|
||||||
setExecutingNodes([workflow.start])
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
alert.error(error.toString())
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const executeWorkflow = () => {
|
const executeWorkflow = () => {
|
||||||
if (!lastSaved) {
|
if (!lastSaved) {
|
||||||
//alert.error("You might have forgotten to save before executing.")
|
//alert.error("You might have forgotten to save before executing.")
|
||||||
@@ -641,14 +578,14 @@ const AngularWorkflow = (props) => {
|
|||||||
|
|
||||||
const data = {"execution_argument": executionText, "start": workflow.start}
|
const data = {"execution_argument": executionText, "start": workflow.start}
|
||||||
fetch(globalUrl+"/api/v1/workflows/"+props.match.params.key+"/execute", {
|
fetch(globalUrl+"/api/v1/workflows/"+props.match.params.key+"/execute", {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json',
|
'Accept': 'application/json',
|
||||||
},
|
},
|
||||||
credentials: "include",
|
credentials: "include",
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
})
|
})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
if (response.status !== 200) {
|
if (response.status !== 200) {
|
||||||
console.log("Status not 200 for WORKFLOW EXECUTION :O!")
|
console.log("Status not 200 for WORKFLOW EXECUTION :O!")
|
||||||
@@ -1437,16 +1374,17 @@ const AngularWorkflow = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const appViewStyle = {
|
const appViewStyle = {
|
||||||
marginLeft: "5px",
|
marginLeft: 5,
|
||||||
marginRight: "5px",
|
marginRight: 5,
|
||||||
display: "flex",
|
display: "flex",
|
||||||
flexDirection: "column",
|
flexDirection: "column",
|
||||||
|
height: "100%",
|
||||||
}
|
}
|
||||||
|
|
||||||
const scrollStyle = {
|
const scrollStyle = {
|
||||||
marginTop: "10px",
|
marginTop: 10,
|
||||||
overflow: "scroll",
|
overflow: "scroll",
|
||||||
height: "66vh",
|
height: "100%",
|
||||||
overflowX: "auto",
|
overflowX: "auto",
|
||||||
overflowY: "auto",
|
overflowY: "auto",
|
||||||
}
|
}
|
||||||
@@ -1463,36 +1401,6 @@ const AngularWorkflow = (props) => {
|
|||||||
display: "flex",
|
display: "flex",
|
||||||
}
|
}
|
||||||
|
|
||||||
// All this is stupid lmao
|
|
||||||
const handleHookHover = () => {
|
|
||||||
setHookHoverColor(hoverColor)
|
|
||||||
setAppsHoverColor(hoverOutColor)
|
|
||||||
setVariablesHoverColor(hoverOutColor)
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleHookHoverOut = () => {
|
|
||||||
setHookHoverColor(hoverOutColor)
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleAppsHover = () => {
|
|
||||||
setAppsHoverColor(hoverColor)
|
|
||||||
setHookHoverColor(hoverOutColor)
|
|
||||||
setVariablesHoverColor(hoverOutColor)
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleAppsHoverOut = () => {
|
|
||||||
setAppsHoverColor(hoverOutColor)
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleVariablesHover = () => {
|
|
||||||
setVariablesHoverColor(hoverColor)
|
|
||||||
setHookHoverColor(hoverOutColor)
|
|
||||||
setAppsHoverColor(hoverOutColor)
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleVariablesHoverOut = () => {
|
|
||||||
setVariablesHoverColor(hoverOutColor)
|
|
||||||
}
|
|
||||||
|
|
||||||
const paperVariableStyle = {
|
const paperVariableStyle = {
|
||||||
minHeight: "50px",
|
minHeight: "50px",
|
||||||
@@ -1614,57 +1522,77 @@ const AngularWorkflow = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const curTab = 0
|
||||||
|
const handleSetTab = (event, newValue) => {
|
||||||
|
setCurrentView(newValue)
|
||||||
|
}
|
||||||
|
|
||||||
const HandleLeftView = () => {
|
const HandleLeftView = () => {
|
||||||
// Defaults to apps.
|
// Defaults to apps.
|
||||||
var thisview = <AppView />
|
var thisview = <AppView />
|
||||||
if (currentView === "triggers") {
|
if (currentView === 1) {
|
||||||
thisview = <TriggersView />
|
thisview = <TriggersView />
|
||||||
} else if (currentView === "variables") {
|
} else if (currentView === 2) {
|
||||||
thisview = <VariablesView />
|
thisview = <VariablesView />
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const tabStyle = {
|
||||||
|
maxWidth: leftBarSize/3,
|
||||||
|
minWidth: leftBarSize/3,
|
||||||
|
flex: 1,
|
||||||
|
textTransform: "none",
|
||||||
|
}
|
||||||
|
|
||||||
|
const iconStyle = {
|
||||||
|
marginTop: 3,
|
||||||
|
marginRight: 5,
|
||||||
|
}
|
||||||
|
|
||||||
return(
|
return(
|
||||||
<div>
|
<div>
|
||||||
<Divider style={{marginTop: 10, height: 1, width: "100%", backgroundColor: "rgb(91, 96, 100)"}}/>
|
<div style={{minHeight: bodyHeight-appBarSize-50, maxHeight: bodyHeight-appBarSize-50}}>
|
||||||
<div style={{minHeight: bodyHeight-appBarSize-150, maxHeight: bodyHeight-appBarSize-100}}>
|
|
||||||
{thisview}
|
{thisview}
|
||||||
</div>
|
</div>
|
||||||
<div style={{bottom: 0, left: 0}}>
|
<Divider style={{backgroundColor: "rgb(91, 96, 100)"}}/>
|
||||||
<Divider style={{marginBottom: "10px", marginTop: "10px", height: "1px", width: "100%", backgroundColor: "rgb(91, 96, 100)"}}/>
|
<Tabs
|
||||||
<div style={{display: "flex"}}>
|
value={currentView}
|
||||||
<div style={{flex: "1", marginLeft: "10px", marginTop: "10px", color: AppsHoverColor, cursor: "pointer", textAlign: "center"}} onMouseOver={handleAppsHover} onMouseOut={handleAppsHoverOut} onClick={() => {setCurrentView("apps")}}>
|
indicatorColor="primary"
|
||||||
<Grid container direction="row" alignItems="center">
|
textColor="white"
|
||||||
<Grid item>
|
onChange={handleSetTab}
|
||||||
<AppsIcon style={{marginTop: "3px", marginRight: "5px"}} />
|
aria-label="Left sidebar tab"
|
||||||
</Grid>
|
>
|
||||||
|
<Tab label={
|
||||||
|
<Grid container direction="row" alignItems="center">
|
||||||
<Grid item>
|
<Grid item>
|
||||||
Apps
|
<AppsIcon style={iconStyle} />
|
||||||
</Grid>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</div>
|
<Grid item>
|
||||||
<div style={{flex: "1", marginLeft: "10px", marginTop: "10px", color: HookHoverColor, cursor: "pointer"}} onMouseOver={handleHookHover} onMouseOut={handleHookHoverOut} onClick={() => {setCurrentView("triggers")}}>
|
Apps
|
||||||
<Grid container direction="row" alignItems="center">
|
</Grid>
|
||||||
<Grid item>
|
</Grid>
|
||||||
<ScheduleIcon style={{marginTop: "3px", marginRight: "5px"}} />
|
} style={tabStyle} />
|
||||||
</Grid>
|
<Tab label={
|
||||||
|
<Grid container direction="row" alignItems="center">
|
||||||
<Grid item>
|
<Grid item>
|
||||||
Triggers
|
<ScheduleIcon style={iconStyle} />
|
||||||
</Grid>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</div>
|
<Grid item>
|
||||||
<div style={{flex: "1", marginLeft: "10px", marginTop: "10px", color: VariablesHoverColor, cursor: "pointer"}} onMouseOver={handleVariablesHover} onMouseOut={handleVariablesHoverOut} onClick={() => {setCurrentView("variables")}}>
|
Triggers
|
||||||
<Grid container direction="row" alignItems="center">
|
</Grid>
|
||||||
<Grid item>
|
</Grid>
|
||||||
<FavoriteBorderIcon style={{marginTop: "3px", marginRight: "5px"}} />
|
} style={tabStyle} />
|
||||||
</Grid>
|
<Tab label={
|
||||||
|
<Grid container direction="row" alignItems="center">
|
||||||
<Grid item>
|
<Grid item>
|
||||||
Variables
|
<FavoriteBorderIcon style={iconStyle} />
|
||||||
</Grid>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</div>
|
<Grid item>
|
||||||
</div>
|
Variables
|
||||||
</div>
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
}style={tabStyle} />
|
||||||
|
</Tabs>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -2018,8 +1946,8 @@ const AngularWorkflow = (props) => {
|
|||||||
|
|
||||||
const appScrollStyle = {
|
const appScrollStyle = {
|
||||||
overflow: "scroll",
|
overflow: "scroll",
|
||||||
maxHeight: bodyHeight-appBarSize-150,
|
maxHeight: bodyHeight-appBarSize-55,
|
||||||
minHeight: bodyHeight-appBarSize-150,
|
minHeight: bodyHeight-appBarSize-55,
|
||||||
overflowY: "auto",
|
overflowY: "auto",
|
||||||
overflowX: "hidden",
|
overflowX: "hidden",
|
||||||
}
|
}
|
||||||
@@ -2075,6 +2003,7 @@ const AngularWorkflow = (props) => {
|
|||||||
<Draggable
|
<Draggable
|
||||||
onDrag={(e) => {handleAppDrag(e, app)}}
|
onDrag={(e) => {handleAppDrag(e, app)}}
|
||||||
onStop={(e) => {handleDragStop(e, app)}}
|
onStop={(e) => {handleDragStop(e, app)}}
|
||||||
|
key={app.id}
|
||||||
dragging={false}
|
dragging={false}
|
||||||
position={{
|
position={{
|
||||||
x: 0,
|
x: 0,
|
||||||
@@ -2438,7 +2367,7 @@ const AngularWorkflow = (props) => {
|
|||||||
} else if (data.variant === "WORKFLOW_VARIABLE") {
|
} else if (data.variant === "WORKFLOW_VARIABLE") {
|
||||||
varcolor = "#f85a3e"
|
varcolor = "#f85a3e"
|
||||||
if (workflow.workflow_variables === null || workflow.workflow_variables === undefined || workflow.workflow_variables.length === 0) {
|
if (workflow.workflow_variables === null || workflow.workflow_variables === undefined || workflow.workflow_variables.length === 0) {
|
||||||
setCurrentView("variables")
|
setCurrentView(2)
|
||||||
datafield =
|
datafield =
|
||||||
<div>
|
<div>
|
||||||
<div>
|
<div>
|
||||||
@@ -2944,7 +2873,7 @@ const AngularWorkflow = (props) => {
|
|||||||
} else if (data.variant === "WORKFLOW_VARIABLE") {
|
} else if (data.variant === "WORKFLOW_VARIABLE") {
|
||||||
varcolor = "#f85a3e"
|
varcolor = "#f85a3e"
|
||||||
if (workflow.workflow_variables === null || workflow.workflow_variables === undefined || workflow.workflow_variables.length === 0) {
|
if (workflow.workflow_variables === null || workflow.workflow_variables === undefined || workflow.workflow_variables.length === 0) {
|
||||||
setCurrentView("variables")
|
setCurrentView(2)
|
||||||
datafield =
|
datafield =
|
||||||
<div>
|
<div>
|
||||||
<div>
|
<div>
|
||||||
@@ -4621,7 +4550,6 @@ const AngularWorkflow = (props) => {
|
|||||||
<RightSideBar />
|
<RightSideBar />
|
||||||
<BottomCytoscapeBar />
|
<BottomCytoscapeBar />
|
||||||
<TopCytoscapeBar />
|
<TopCytoscapeBar />
|
||||||
<NoActionsBar />
|
|
||||||
</div>
|
</div>
|
||||||
:
|
:
|
||||||
<div style={{color: "white"}}>
|
<div style={{color: "white"}}>
|
||||||
|
|||||||
Reference in New Issue
Block a user