Added initial hybrid proxy setup
This commit is contained in:
@@ -727,7 +727,7 @@ class AppBase:
|
|||||||
parsedvalue = json.loads(allvalues["value"])
|
parsedvalue = json.loads(allvalues["value"])
|
||||||
allvalues["value"] = parsedvalue
|
allvalues["value"] = parsedvalue
|
||||||
except:
|
except:
|
||||||
print("Parsing of value as JSON failed")
|
print("Parsing of value as JSON failed. Continue anyway!")
|
||||||
|
|
||||||
return allvalues
|
return allvalues
|
||||||
except:
|
except:
|
||||||
@@ -1377,7 +1377,10 @@ class AppBase:
|
|||||||
cachedata = self.get_cache(actual_key)
|
cachedata = self.get_cache(actual_key)
|
||||||
print("CACHE: %s" % cachedata)
|
print("CACHE: %s" % cachedata)
|
||||||
parsersplit.pop(1)
|
parsersplit.pop(1)
|
||||||
baseresult = cachedata
|
try:
|
||||||
|
baseresult = json.dumps(cachedata)
|
||||||
|
except json.decoder.JSONDecodeError as e:
|
||||||
|
print("Failed json dumping: %s" % e)
|
||||||
|
|
||||||
#returndata = str(baseresult)+str(appendresult)
|
#returndata = str(baseresult)+str(appendresult)
|
||||||
else:
|
else:
|
||||||
|
|||||||
+26
-3
@@ -2106,7 +2106,11 @@ func executeCloudAction(action shuffle.CloudSyncJob, apikey string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
client := &http.Client{}
|
transport := http.DefaultTransport.(*http.Transport).Clone()
|
||||||
|
client := &http.Client{
|
||||||
|
Transport: transport,
|
||||||
|
}
|
||||||
|
|
||||||
syncUrl := fmt.Sprintf("%s/api/v1/cloud/sync/handle_action", syncUrl)
|
syncUrl := fmt.Sprintf("%s/api/v1/cloud/sync/handle_action", syncUrl)
|
||||||
req, err := http.NewRequest(
|
req, err := http.NewRequest(
|
||||||
"POST",
|
"POST",
|
||||||
@@ -3828,6 +3832,22 @@ func remoteOrgJobHandler(org shuffle.Org, interval int) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func runInitCloudSetup() {
|
||||||
|
action := shuffle.CloudSyncJob{
|
||||||
|
Type: "setup",
|
||||||
|
Action: "init",
|
||||||
|
OrgId: "",
|
||||||
|
PrimaryItemId: "",
|
||||||
|
}
|
||||||
|
|
||||||
|
err := executeCloudAction(action, "")
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("[INFO] Failed initial setup: %s", err)
|
||||||
|
} else {
|
||||||
|
log.Printf("[INFO] Ran initial setup!")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func runInitEs(ctx context.Context) {
|
func runInitEs(ctx context.Context) {
|
||||||
log.Printf("[DEBUG] Starting INIT setup (ES)")
|
log.Printf("[DEBUG] Starting INIT setup (ES)")
|
||||||
|
|
||||||
@@ -3842,7 +3862,8 @@ func runInitEs(ctx context.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("Error getting organizations: %s", err)
|
log.Printf("[DEBUG] Error getting organizations: %s", err)
|
||||||
|
runInitCloudSetup()
|
||||||
} else {
|
} else {
|
||||||
// Add all users to it
|
// Add all users to it
|
||||||
if len(activeOrgs) == 1 {
|
if len(activeOrgs) == 1 {
|
||||||
@@ -3850,7 +3871,9 @@ func runInitEs(ctx context.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(activeOrgs) == 0 {
|
if len(activeOrgs) == 0 {
|
||||||
log.Printf(`No orgs. Setting NEW org "default"`)
|
log.Printf(`[DEBUG] No orgs. Setting NEW org "default"`)
|
||||||
|
runInitCloudSetup()
|
||||||
|
|
||||||
//orgSetupName := "default"
|
//orgSetupName := "default"
|
||||||
//orgId := uuid.NewV4().String()
|
//orgId := uuid.NewV4().String()
|
||||||
//newOrg := shuffle.Org{
|
//newOrg := shuffle.Org{
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ const Admin = (props) => {
|
|||||||
// Need to wait because query in ES is too fast
|
// Need to wait because query in ES is too fast
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
getAppAuthentication()
|
getAppAuthentication()
|
||||||
}, 500)
|
}, 1000)
|
||||||
alert.success("Successfully deleted authentication!")
|
alert.success("Successfully deleted authentication!")
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
@@ -228,7 +228,7 @@ const Admin = (props) => {
|
|||||||
.then((responseJson) => {
|
.then((responseJson) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
handleGetOrg(org_id)
|
handleGetOrg(org_id)
|
||||||
}, 500)
|
}, 1000)
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
alert.error("Err: " + error.toString())
|
alert.error("Err: " + error.toString())
|
||||||
@@ -356,7 +356,7 @@ const Admin = (props) => {
|
|||||||
setSelectedUserModalOpen(false)
|
setSelectedUserModalOpen(false)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
getAppAuthentication()
|
getAppAuthentication()
|
||||||
}, 500)
|
}, 1000)
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
@@ -514,7 +514,7 @@ const Admin = (props) => {
|
|||||||
setModalOpen(false)
|
setModalOpen(false)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
getUsers()
|
getUsers()
|
||||||
}, 500)
|
}, 1000)
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
@@ -549,7 +549,7 @@ const Admin = (props) => {
|
|||||||
setModalOpen(false)
|
setModalOpen(false)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
getUsers()
|
getUsers()
|
||||||
}, 500)
|
}, 1000)
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -308,7 +308,7 @@ const AngularWorkflow = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (param.name === "startnode" && outersub.id !== undefined) {
|
if (param.name === "startnode" && outersub.id !== undefined) {
|
||||||
console.log("SHOULD SET STARTNODE: ", outersub)
|
console.log("SHOULD SET STARTNODE IN SUBFLOW SELECTION: ", outersub)
|
||||||
const innernode = outersub.actions.find(action => action.id === param.value)
|
const innernode = outersub.actions.find(action => action.id === param.value)
|
||||||
console.log("FOUND NODE: ", innernode)
|
console.log("FOUND NODE: ", innernode)
|
||||||
if (innernode !== undefined && subworkflowStartnode.id !== innernode.id) {
|
if (innernode !== undefined && subworkflowStartnode.id !== innernode.id) {
|
||||||
|
|||||||
@@ -531,7 +531,7 @@ const Workflows = (props) => {
|
|||||||
deleteWorkflow(selectedWorkflowId)
|
deleteWorkflow(selectedWorkflowId)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
getAvailableWorkflows()
|
getAvailableWorkflows()
|
||||||
}, 500)
|
}, 1000)
|
||||||
}
|
}
|
||||||
setDeleteModalOpen(false)
|
setDeleteModalOpen(false)
|
||||||
}} color="primary">
|
}} color="primary">
|
||||||
@@ -1491,7 +1491,7 @@ const Workflows = (props) => {
|
|||||||
// Update :)
|
// Update :)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
getAvailableWorkflows()
|
getAvailableWorkflows()
|
||||||
}, 500)
|
}, 1000)
|
||||||
setImportLoading(false)
|
setImportLoading(false)
|
||||||
} else {
|
} else {
|
||||||
alert.info("Successfully changed basic info for workflow")
|
alert.info("Successfully changed basic info for workflow")
|
||||||
|
|||||||
Reference in New Issue
Block a user