Added copy feature for JSON objects
This commit is contained in:
@@ -202,7 +202,7 @@ func buildImageMemory(fs billy.Filesystem, tags []string, dockerfileFolder strin
|
||||
tw := tar.NewWriter(buf)
|
||||
defer tw.Close()
|
||||
|
||||
log.Printf("Setting up memory build structure for folder: %s", dockerfileFolder)
|
||||
log.Printf("[INFO] Setting up memory build structure for folder: %s", dockerfileFolder)
|
||||
err = getParsedTarMemory(fs, tw, dockerfileFolder, "")
|
||||
if err != nil {
|
||||
log.Printf("Tar issue: %s", err)
|
||||
@@ -230,7 +230,7 @@ func buildImageMemory(fs billy.Filesystem, tags []string, dockerfileFolder strin
|
||||
}
|
||||
|
||||
// Build the actual image
|
||||
log.Printf("Building %s. This may take up to a few minutes.", dockerfileFolder)
|
||||
log.Printf("[INFO] Building %s. This may take up to a few minutes.", dockerfileFolder)
|
||||
imageBuildResponse, err := client.ImageBuild(
|
||||
ctx,
|
||||
dockerFileTarReader,
|
||||
@@ -713,7 +713,7 @@ func handleStartHookDocker(resp http.ResponseWriter, request *http.Request) {
|
||||
}
|
||||
|
||||
// FIXME - get some real data?
|
||||
log.Printf("Successfully started %s-%s on port %s with filepath %s", image, fileId, port, filepath)
|
||||
log.Printf("[INFO] Successfully started %s-%s on port %s with filepath %s", image, fileId, port, filepath)
|
||||
resp.WriteHeader(200)
|
||||
resp.Write([]byte(`{"success": true, "message": "Started webhook"}`))
|
||||
return
|
||||
|
||||
@@ -5776,23 +5776,23 @@ func iterateAppGithubFolders(fs billy.Filesystem, dir []os.FileInfo, extra strin
|
||||
log.Printf("Failed image build memory: %s", err)
|
||||
} else {
|
||||
if len(item.Tags) > 0 {
|
||||
log.Printf("Successfully built image %s", item.Tags[0])
|
||||
log.Printf("[INFO] Successfully built image %s", item.Tags[0])
|
||||
} else {
|
||||
log.Printf("Successfully built Docker image")
|
||||
log.Printf("[INFO] Successfully built Docker image")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
log.Printf("Starting build of %d skipped docker images", len(buildLaterList))
|
||||
log.Printf("[INFO] Starting build of %d skipped docker images", len(buildLaterList))
|
||||
for _, item := range buildLaterList {
|
||||
err = buildImageMemory(fs, item.Tags, item.Extra)
|
||||
if err != nil {
|
||||
log.Printf("Failed image build memory: %s", err)
|
||||
log.Printf("[INFO] Failed image build memory: %s", err)
|
||||
} else {
|
||||
if len(item.Tags) > 0 {
|
||||
log.Printf("Successfully built image %s", item.Tags[0])
|
||||
log.Printf("[INFO] Successfully built image %s", item.Tags[0])
|
||||
} else {
|
||||
log.Printf("Successfully built Docker image")
|
||||
log.Printf("[INFO] Successfully built Docker image")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5957,8 +5957,49 @@ const AngularWorkflow = (props) => {
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
const HandleJsonCopy = (base, copy, base_node_name) => {
|
||||
console.log("COPY: ", copy)
|
||||
var newitem = JSON.parse(base)
|
||||
var to_be_copied = "$"+base_node_name
|
||||
for (var key in copy.namespace) {
|
||||
if (copy.namespace[key].includes("Results for")) {
|
||||
continue
|
||||
}
|
||||
|
||||
if (newitem !== undefined && newitem !== null) {
|
||||
newitem = newitem[copy.namespace[key]]
|
||||
if (!isNaN(copy.namespace[key])) {
|
||||
to_be_copied += ".#"
|
||||
} else {
|
||||
to_be_copied += "."+copy.namespace[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (newitem !== undefined && newitem !== null) {
|
||||
newitem = newitem[copy.name]
|
||||
if (!isNaN(copy.name)) {
|
||||
to_be_copied += ".#"
|
||||
} else {
|
||||
to_be_copied += "."+copy.name
|
||||
}
|
||||
}
|
||||
|
||||
console.log(to_be_copied)
|
||||
//var copyText = document.getElementById("copy_element_shuffle");
|
||||
//if (copyText !== null) {
|
||||
//navigator.clipboard.writeText(to_be_copied)
|
||||
//copyText.select();
|
||||
//copyText.setSelectionRange(0, 99999); /* For mobile devices */
|
||||
|
||||
///* Copy the text inside the text field */
|
||||
//document.execCommand("copy");
|
||||
//}
|
||||
}
|
||||
|
||||
const executionModal =
|
||||
<Drawer anchor={"right"} open={executionModalOpen} onClose={() => setExecutionModalOpen(false)} PaperProps={{style: {minWidth: 375, maxWidth: 375, backgroundColor: "#1F2023", color: "white", fontSize: 18}}}>
|
||||
<Drawer anchor={"right"} open={executionModalOpen} onClose={() => setExecutionModalOpen(false)} style={{resize: "both", overflow: "auto",}} PaperProps={{style: {resize: "both", overflow: "auto", minWidth: 400, maxWidth: 400, backgroundColor: "#1F2023", color: "white", fontSize: 18}}}>
|
||||
{executionModalView === 0 ?
|
||||
<div style={{padding: 25, }}>
|
||||
<Breadcrumbs aria-label="breadcrumb" separator="›" style={{color: "white", fontSize: 16}}>
|
||||
@@ -6136,6 +6177,10 @@ const AngularWorkflow = (props) => {
|
||||
theme="solarized"
|
||||
collapsed={true}
|
||||
displayDataTypes={false}
|
||||
onSelect={(select) => {
|
||||
HandleJsonCopy(showResult, select, data.action.name)
|
||||
console.log("SELECTED!: ", select)
|
||||
}}
|
||||
name={"Results for "+data.action.label}
|
||||
/>
|
||||
:
|
||||
|
||||
Reference in New Issue
Block a user