Added download as file option to app creator and OpenAPI as a whole

This commit is contained in:
frikky
2022-01-16 04:36:49 +01:00
parent 2b38e9e3a9
commit 581f97be80
7 changed files with 106 additions and 49 deletions
+1
View File
@@ -2820,6 +2820,7 @@ class AppBase:
self.logger.info("[INFO] NO FILES TO HANDLE")
tmp_result = {
"success": True,
"result": newres[0],
"file_ids": file_ids
}
+1 -1
View File
@@ -699,7 +699,7 @@ func getDockerImage(resp http.ResponseWriter, request *http.Request) {
// REBUILDS THE APP
if len(img.ID) == 0 {
if len(img2.ID) == 0 {
workflowapps, err := shuffle.GetAllWorkflowApps(ctx, 0)
workflowapps, err := shuffle.GetAllWorkflowApps(ctx, 0, 0)
log.Printf("[INFO] Getting workflowapps for a rebuild. Got %d with err %#v", len(workflowapps), err)
if err == nil {
imageName := ""
+1 -1
View File
@@ -2,7 +2,7 @@ module main
go 1.15
//replace github.com/shuffle/shuffle-shared => ../../../../git/shuffle-shared
replace github.com/shuffle/shuffle-shared => ../../../../git/shuffle-shared
//replace github.com/frikky/kin-openapi => ../../../../git/kin-openapi
//replace github.com/frikky/go-elasticsearch => ../../../../git/go-elasticsearch
+3 -3
View File
@@ -4075,7 +4075,7 @@ func runInitEs(ctx context.Context) {
// Getting apps to see if we should initialize a test
// FIXME: Isn't this a little backwards?
workflowapps, err := shuffle.GetAllWorkflowApps(ctx, 1000)
workflowapps, err := shuffle.GetAllWorkflowApps(ctx, 1000, 0)
log.Printf("[INFO] Getting and validating workflowapps. Got %d with err %#v", len(workflowapps), err)
// accept any certificate (might be useful for testing)
@@ -4727,7 +4727,7 @@ func runInit(ctx context.Context) {
}
// Getting apps to see if we should initialize a test
workflowapps, err := shuffle.GetAllWorkflowApps(ctx, 1000)
workflowapps, err := shuffle.GetAllWorkflowApps(ctx, 1000, 0)
log.Printf("[INFO] Getting and validating workflowapps. Got %d with err %s", len(workflowapps), err)
if err != nil && len(workflowapps) == 0 {
log.Printf("[WARNING] Failed getting apps (runInit): %s", err)
@@ -5342,7 +5342,7 @@ func migrateDatabase(resp http.ResponseWriter, request *http.Request) {
log.Printf("[DEBUG] Found %d workflows(s) to be migrated", len(workflows))
}
apps, err := shuffle.GetAllWorkflowApps(ctx, 0)
apps, err := shuffle.GetAllWorkflowApps(ctx, 0, 0)
if err != nil {
log.Printf("[ERROR] Failed getting apps: %#v", err)
} else {
+5 -5
View File
@@ -1655,7 +1655,7 @@ func getWorkflowApps(resp http.ResponseWriter, request *http.Request) {
return
}
workflowapps, err := shuffle.GetAllWorkflowApps(ctx, 1000)
workflowapps, err := shuffle.GetAllWorkflowApps(ctx, 1000, 0)
if err != nil {
log.Printf("{WARNING] Failed getting apps (getworkflowapps): %s", err)
resp.WriteHeader(401)
@@ -1753,7 +1753,7 @@ func getSpecificApps(resp http.ResponseWriter, request *http.Request) {
// FIXME - continue the search here with github repos etc.
// Caching might be smart :D
ctx := context.Background()
workflowapps, err := shuffle.GetAllWorkflowApps(ctx, 1000)
workflowapps, err := shuffle.GetAllWorkflowApps(ctx, 1000, 0)
if err != nil {
log.Printf("Error: Failed getting workflowapps: %s", err)
resp.WriteHeader(401)
@@ -2030,7 +2030,7 @@ func handleAppHotloadRequest(resp http.ResponseWriter, request *http.Request) {
func iterateOpenApiGithub(fs billy.Filesystem, dir []os.FileInfo, extra string, onlyname string) error {
ctx := context.Background()
workflowapps, err := shuffle.GetAllWorkflowApps(ctx, 1000)
workflowapps, err := shuffle.GetAllWorkflowApps(ctx, 1000, 0)
appCounter := 0
if err != nil {
log.Printf("Failed to get existing generated apps")
@@ -2329,7 +2329,7 @@ func setNewWorkflowApp(resp http.ResponseWriter, request *http.Request) {
}
ctx := context.Background()
allapps, err := shuffle.GetAllWorkflowApps(ctx, 1000)
allapps, err := shuffle.GetAllWorkflowApps(ctx, 1000, 0)
if err != nil {
log.Printf("Failed getting apps to verify: %s", err)
resp.WriteHeader(401)
@@ -2797,7 +2797,7 @@ func IterateAppGithubFolders(ctx context.Context, fs billy.Filesystem, dir []os.
}
if len(allapps) == 0 {
allapps, err = shuffle.GetAllWorkflowApps(ctx, 0)
allapps, err = shuffle.GetAllWorkflowApps(ctx, 0, 0)
if err != nil {
log.Printf("[WARNING] Failed getting apps to verify: %s", err)
continue