Fixed frontend speed issues
This commit is contained in:
@@ -441,6 +441,9 @@ class AppBase:
|
|||||||
"Authorization": "Bearer %s" % self.authorization
|
"Authorization": "Bearer %s" % self.authorization
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if not isinstance(infiles, list):
|
||||||
|
infiles = [infiles]
|
||||||
|
|
||||||
create_path = "/api/v1/files/create?execution_id=%s" % full_execution["execution_id"]
|
create_path = "/api/v1/files/create?execution_id=%s" % full_execution["execution_id"]
|
||||||
file_ids = []
|
file_ids = []
|
||||||
for curfile in infiles:
|
for curfile in infiles:
|
||||||
|
|||||||
@@ -6582,6 +6582,9 @@ func verifySwagger(resp http.ResponseWriter, request *http.Request) {
|
|||||||
log.Printf("Failed to increase success execution stats: %s", err)
|
log.Printf("Failed to increase success execution stats: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cacheKey := fmt.Sprintf("workflowapps-sorted")
|
||||||
|
requestCache.Delete(cacheKey)
|
||||||
|
|
||||||
resp.WriteHeader(200)
|
resp.WriteHeader(200)
|
||||||
resp.Write([]byte(fmt.Sprintf(`{"success": true, "id": "%s"}`, api.ID)))
|
resp.Write([]byte(fmt.Sprintf(`{"success": true, "id": "%s"}`, api.ID)))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4332,6 +4332,7 @@ func getApp(ctx context.Context, id string) (*WorkflowApp, error) {
|
|||||||
workflowApp := &WorkflowApp{}
|
workflowApp := &WorkflowApp{}
|
||||||
if err := dbclient.Get(ctx, key, workflowApp); err != nil {
|
if err := dbclient.Get(ctx, key, workflowApp); err != nil {
|
||||||
return &WorkflowApp{}, err
|
return &WorkflowApp{}, err
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return workflowApp, nil
|
return workflowApp, nil
|
||||||
@@ -4918,12 +4919,34 @@ func addAppAuthentication(resp http.ResponseWriter, request *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME: Doens't validate Org
|
||||||
app, err := getApp(ctx, appAuth.App.ID)
|
app, err := getApp(ctx, appAuth.App.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Failed finding app %s while setting auth.", appAuth.App.ID)
|
log.Printf("[WARNING] Failed finding app %s while setting auth. Finding it by looping apps.", appAuth.App.ID)
|
||||||
resp.WriteHeader(409)
|
workflowapps, err := getAllWorkflowApps(ctx, 100)
|
||||||
resp.Write([]byte(fmt.Sprintf(`{"success": false, "reason": "%s"}`, err)))
|
if err != nil {
|
||||||
return
|
resp.WriteHeader(409)
|
||||||
|
resp.Write([]byte(fmt.Sprintf(`{"success": false, "reason": "%s"}`, err)))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
foundIndex := -1
|
||||||
|
for i, workflowapp := range workflowapps {
|
||||||
|
if workflowapp.Name == appAuth.App.Name {
|
||||||
|
foundIndex = i
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if foundIndex >= 0 {
|
||||||
|
log.Printf("[INFO] Found app %s by looping auth", appAuth.App.ID)
|
||||||
|
app = &workflowapps[foundIndex]
|
||||||
|
} else {
|
||||||
|
log.Printf("[ERROR] Failed finding app %s which has auth after looping", appAuth.App.ID)
|
||||||
|
resp.WriteHeader(409)
|
||||||
|
resp.Write([]byte(fmt.Sprintf(`{"success": false, "reason": "%s"}`, err)))
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the items are correct
|
// Check if the items are correct
|
||||||
|
|||||||
@@ -6,11 +6,6 @@ import TextField from '@material-ui/core/TextField';
|
|||||||
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';
|
||||||
|
|
||||||
const hrefStyle = {
|
|
||||||
color: "white",
|
|
||||||
textDecoration: "none"
|
|
||||||
}
|
|
||||||
|
|
||||||
const bodyDivStyle = {
|
const bodyDivStyle = {
|
||||||
margin: "auto",
|
margin: "auto",
|
||||||
marginTop: "100px",
|
marginTop: "100px",
|
||||||
@@ -35,7 +30,7 @@ const useStyles = makeStyles({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const AdminAccount = props => {
|
const AdminAccount = props => {
|
||||||
const { globalUrl, isLoaded, isLoggedIn, setIsLoggedIn, setCookie, } = props;
|
const { globalUrl, isLoaded, isLoggedIn, } = props;
|
||||||
|
|
||||||
const [username, setUsername] = useState("");
|
const [username, setUsername] = useState("");
|
||||||
const [password, setPassword] = useState("");
|
const [password, setPassword] = useState("");
|
||||||
|
|||||||
@@ -2860,7 +2860,7 @@ const AngularWorkflow = (props) => {
|
|||||||
// PARAM FIX - Gonna use the ID field, even though it's a hack
|
// PARAM FIX - Gonna use the ID field, even though it's a hack
|
||||||
const paramcheck = selectedAction.parameters.find(param => param.name === "body")
|
const paramcheck = selectedAction.parameters.find(param => param.name === "body")
|
||||||
if (paramcheck !== undefined) {
|
if (paramcheck !== undefined) {
|
||||||
if (paramcheck["value_replace"] === undefined) {
|
if (paramcheck["value_replace"] === undefined || paramcheck["value_replace"] === null) {
|
||||||
paramcheck["value_replace"] = [{
|
paramcheck["value_replace"] = [{
|
||||||
"key": data.name,
|
"key": data.name,
|
||||||
"value": event.target.value,
|
"value": event.target.value,
|
||||||
@@ -3079,7 +3079,7 @@ const AngularWorkflow = (props) => {
|
|||||||
multiline = true
|
multiline = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.value !== undefined && data.value.startsWith("{") && data.value.endsWith("}")) {
|
if (data.value !== undefined && data.value !== null && data.value.startsWith("{") && data.value.endsWith("}")) {
|
||||||
multiline = true
|
multiline = true
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3090,8 +3090,8 @@ const AngularWorkflow = (props) => {
|
|||||||
|
|
||||||
if (data.name.startsWith("${") && data.name.endsWith("}")) {
|
if (data.name.startsWith("${") && data.name.endsWith("}")) {
|
||||||
const paramcheck = selectedAction.parameters.find(param => param.name === "body")
|
const paramcheck = selectedAction.parameters.find(param => param.name === "body")
|
||||||
if (paramcheck !== undefined) {
|
if (paramcheck !== undefined && paramcheck !== null) {
|
||||||
if (paramcheck["value_replace"] !== undefined) {
|
if (paramcheck["value_replace"] !== undefined && paramcheck["value_replace"] !== null) {
|
||||||
//console.log("IN THE VALUE REPLACE: ", paramcheck["value_replace"])
|
//console.log("IN THE VALUE REPLACE: ", paramcheck["value_replace"])
|
||||||
const subparamindex = paramcheck["value_replace"].findIndex(param => param.key === data.name)
|
const subparamindex = paramcheck["value_replace"].findIndex(param => param.key === data.name)
|
||||||
if (subparamindex !== -1) {
|
if (subparamindex !== -1) {
|
||||||
@@ -6604,7 +6604,7 @@ const AngularWorkflow = (props) => {
|
|||||||
}
|
}
|
||||||
</span>
|
</span>
|
||||||
:
|
:
|
||||||
<div>
|
<div style={{maxHeight: 250, overflowX: "hidden", overflowY: "scroll",}}>
|
||||||
<b>Result</b>
|
<b>Result</b>
|
||||||
{data.result}
|
{data.result}
|
||||||
</div>
|
</div>
|
||||||
@@ -7108,8 +7108,9 @@ const AngularWorkflow = (props) => {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//if (authenticationOption.label === null
|
if (authenticationOption.label === null || authenticationOption.label === undefined) {
|
||||||
// defaultValue={}
|
authenticationOption.label = selectedApp.name+" authentication"
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -341,7 +341,7 @@ const Apps = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var description = data.description
|
var description = data.description
|
||||||
const maxDescLen = 58
|
const maxDescLen = 56
|
||||||
if (description.length > maxDescLen) {
|
if (description.length > maxDescLen) {
|
||||||
description = data.description.slice(0, maxDescLen)+"..."
|
description = data.description.slice(0, maxDescLen)+"..."
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ const inputColor = "#383B40"
|
|||||||
const surfaceColor = "#27292D"
|
const surfaceColor = "#27292D"
|
||||||
|
|
||||||
export const validateJson = (showResult) => {
|
export const validateJson = (showResult) => {
|
||||||
showResult = showResult.split(" None").join(" \"None\"")
|
//showResult = showResult.split(" None").join(" \"None\"")
|
||||||
showResult = showResult.split(" False").join(" false")
|
showResult = showResult.split(" False").join(" false")
|
||||||
showResult = showResult.split(" True").join(" true")
|
showResult = showResult.split(" True").join(" true")
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ const Workflows = (props) => {
|
|||||||
duration: 5000,
|
duration: 5000,
|
||||||
startImmediate: false,
|
startImmediate: false,
|
||||||
callback: () => {
|
callback: () => {
|
||||||
getWorkflowExecution(selectedWorkflow.id)
|
//getWorkflowExecution(selectedWorkflow.id)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -215,7 +215,7 @@ const Workflows = (props) => {
|
|||||||
|
|
||||||
if (responseJson.length > 0){
|
if (responseJson.length > 0){
|
||||||
setSelectedWorkflow(responseJson[0])
|
setSelectedWorkflow(responseJson[0])
|
||||||
getWorkflowExecution(responseJson[0].id)
|
//getWorkflowExecution(responseJson[0].id)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
@@ -330,7 +330,7 @@ const Workflows = (props) => {
|
|||||||
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!")
|
||||||
}
|
}
|
||||||
getWorkflowExecution(workflowid)
|
//getWorkflowExecution(workflowid)
|
||||||
|
|
||||||
return response.json()
|
return response.json()
|
||||||
})
|
})
|
||||||
@@ -520,7 +520,7 @@ const Workflows = (props) => {
|
|||||||
<div style={{flex: "10",}} onClick={() => {
|
<div style={{flex: "10",}} onClick={() => {
|
||||||
if (selectedWorkflow.id !== data.id) {
|
if (selectedWorkflow.id !== data.id) {
|
||||||
setSelectedWorkflow(data)
|
setSelectedWorkflow(data)
|
||||||
getWorkflowExecution(data.id)
|
//getWorkflowExecution(data.id)
|
||||||
}
|
}
|
||||||
}}>
|
}}>
|
||||||
<Typography variant="h6" style={{marginTop: 10, marginBottom: 0, }}>
|
<Typography variant="h6" style={{marginTop: 10, marginBottom: 0, }}>
|
||||||
@@ -577,7 +577,7 @@ const Workflows = (props) => {
|
|||||||
<div style={{display: "flex", flex: 1}} onClick={() => {
|
<div style={{display: "flex", flex: 1}} onClick={() => {
|
||||||
if (selectedWorkflow.id !== data.id) {
|
if (selectedWorkflow.id !== data.id) {
|
||||||
setSelectedWorkflow(data)
|
setSelectedWorkflow(data)
|
||||||
getWorkflowExecution(data.id)
|
//getWorkflowExecution(data.id)
|
||||||
}
|
}
|
||||||
}}>
|
}}>
|
||||||
<Grid item style={{flex: "1", justifyContent: "center", overflow: "hidden", float: "bottom",}}>
|
<Grid item style={{flex: "1", justifyContent: "center", overflow: "hidden", float: "bottom",}}>
|
||||||
@@ -1236,7 +1236,7 @@ const Workflows = (props) => {
|
|||||||
<div style={{flex: "1"}}>
|
<div style={{flex: "1"}}>
|
||||||
<Button color="primary" style={{marginTop: "20px"}} variant="text" onClick={() => {
|
<Button color="primary" style={{marginTop: "20px"}} variant="text" onClick={() => {
|
||||||
alert.info("Refreshing executions");
|
alert.info("Refreshing executions");
|
||||||
getWorkflowExecution(selectedWorkflow.id)
|
//getWorkflowExecution(selectedWorkflow.id)
|
||||||
}}>
|
}}>
|
||||||
<CachedIcon />
|
<CachedIcon />
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
Reference in New Issue
Block a user