This commit is contained in:
dzikafoczka 2024-12-21 22:13:27 +01:00
parent 4250458b60
commit 1a11959c95
2 changed files with 10 additions and 9 deletions

11
ec2.py
View File

@ -233,17 +233,17 @@ def create_js_scripts(ip):
.then(response => response.json()) .then(response => response.json())
.then(data => { .then(data => {
document.getElementById('responseMessage').innerHTML = ` document.getElementById('responseMessage').innerHTML = `
<p>Plik został pomyślnie przesłany!</p> <p>Upload successful!</p>
<pre>${{JSON.stringify(data, null, 2)}}</pre> <pre>${JSON.stringify(data, null, 2)}</pre>
`; `;
}) })
.catch(error => { .catch(error => {
document.getElementById('responseMessage').innerHTML = ` document.getElementById('responseMessage').innerHTML = `
<p>Błąd podczas przesyłania pliku: ${error.message}</p> <p>Error during file upload: ${error.message}</p>
`; `;
}); });
} else { } else {
alert('Proszę wybrać plik!'); alert('Please select file!');
} }
}); });
""" """
@ -289,4 +289,5 @@ def main():
ec2_id = run_instance(ec2_client, launch_template_id, subnet) ec2_id = run_instance(ec2_client, launch_template_id, subnet)
if __name__ == '__main__': if __name__ == '__main__':
main() # main()
create_js_scripts("127.0.0.1")

View File

@ -15,17 +15,17 @@
.then(response => response.json()) .then(response => response.json())
.then(data => { .then(data => {
document.getElementById('responseMessage').innerHTML = ` document.getElementById('responseMessage').innerHTML = `
<p>Plik został pomyślnie przesłany!</p> <p>Upload successful!</p>
<pre>${{JSON.stringify(data, null, 2)}}</pre> <pre>${JSON.stringify(data, null, 2)}</pre>
`; `;
}) })
.catch(error => { .catch(error => {
document.getElementById('responseMessage').innerHTML = ` document.getElementById('responseMessage').innerHTML = `
<p>Błąd podczas przesyłania pliku: ${error.message}</p> <p>Error during file upload: ${error.message}</p>
`; `;
}); });
} else { } else {
alert('Proszę wybrać plik!'); alert('Please select file!');
} }
}); });