Dateien hochladen nach „REST“

Update all old Files :)
main
Thomas Hassenstein 2023-06-12 14:50:34 +02:00
parent 9c01f8281c
commit 2da7fa4241
3 changed files with 5 additions and 5 deletions

View File

@ -155,9 +155,6 @@ def analyze_data(num_numbers, bits_per_number, startup):
return json.dumps(data) return json.dumps(data)
else: else:
os.unlink(filename)
os.unlink(binary_filename)
os.unlink(hex_filename)
return 400 return 400
# Teste den Code # Teste den Code

View File

@ -40,10 +40,10 @@ def get_random_numbers():
bits = request.args.get('numBits') bits = request.args.get('numBits')
if not quantity.isdigit() or not bits.isdigit(): if not quantity.isdigit() or not bits.isdigit():
return create_response(400, 'Invalid input. Quantity and bits must be numeric.') return create_response(400, 'Invalid input. Quantity and bits must be numeric')
if int(quantity) <= 0 or int(bits) <= 0: if int(quantity) <= 0 or int(bits) <= 0:
return create_response(400, 'Invalid input. Quantity and bits must be positive integers.') return create_response(400, 'Invalid input. Quantity and bits must be positive integers')
if not initialized: if not initialized:
return create_response(432, 'System not ready; try init') return create_response(432, 'System not ready; try init')

View File

@ -135,6 +135,9 @@ document.getElementById('generateButton').addEventListener('click', function(eve
resultDiv.insertBefore(copyAllButton, table); // Füge den "Copy all" Button vor der Tabelle ein resultDiv.insertBefore(copyAllButton, table); // Füge den "Copy all" Button vor der Tabelle ein
} else { } else {
document.getElementById('status').innerText = 'Status: ' + data.status;
document.getElementById('description').innerText = data.description;
var errorParagraph = document.createElement('p'); var errorParagraph = document.createElement('p');
errorParagraph.textContent = 'Error: ' + data.message; errorParagraph.textContent = 'Error: ' + data.message;
resultDiv.appendChild(errorParagraph); resultDiv.appendChild(errorParagraph);