diff --git a/.gitignore b/.gitignore index ded541e..aec56e9 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ create-schematic-gen-site-test-* *.obj *.lst *.jar +extracts/ \ No newline at end of file diff --git a/dub.json b/dub.json index ce30453..469ea33 100644 --- a/dub.json +++ b/dub.json @@ -4,7 +4,7 @@ ], "copyright": "Copyright © 2023, Andrew Lalis", "dependencies": { - "handy-httpd": "~>7.6.1", + "handy-httpd": "~>7.6.3", "slf4d": "~>2.4.1" }, "description": "HTTP server for generating schematic materials lists.", diff --git a/dub.selections.json b/dub.selections.json index cda082b..d350906 100644 --- a/dub.selections.json +++ b/dub.selections.json @@ -1,7 +1,7 @@ { "fileVersion": 1, "versions": { - "handy-httpd": "7.6.1", + "handy-httpd": "7.6.3", "httparsed": "1.2.1", "slf4d": "2.4.1", "streams": "3.5.0" diff --git a/site/files.js b/site/files.js index 3139f49..13a018d 100644 --- a/site/files.js +++ b/site/files.js @@ -1,6 +1,8 @@ const form = document.getElementById("schematic-form"); +const resultContainer = document.getElementById("result-container"); form.onsubmit = async (e) => { e.preventDefault(); + resultContainer.innerHTML = ""; console.log(e); const data = new FormData(form); console.log(data); @@ -10,9 +12,12 @@ form.onsubmit = async (e) => { body: data }); const result = await response.json(); - console.log("Success:", result); + const extractId = result.extractId; + const url = window.location.origin + "/extracts/" + extractId; + resultContainer.innerHTML = `
Copy this URL, and provide it to the computer: ${url}
`; form.reset(); } catch (error) { console.error("Error: " + error); + resultContainer.innerHTML = `An error occurred: ${error}
`; } }; \ No newline at end of file diff --git a/site/index.html b/site/index.html index 5cc0148..d287d61 100644 --- a/site/index.html +++ b/site/index.html @@ -14,6 +14,9 @@ +