From 2da7fa4241993580c7571a12f3ecfe7cd860163f Mon Sep 17 00:00:00 2001 From: Thomas Hassenstein <2021544@stud.hs-mannheim.de> Date: Mon, 12 Jun 2023 14:50:34 +0200 Subject: [PATCH] =?UTF-8?q?Dateien=20hochladen=20nach=20=E2=80=9EREST?= =?UTF-8?q?=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update all old Files :) --- REST/I2C_Function.py | 3 --- REST/app.py | 4 ++-- REST/script.js | 3 +++ 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/REST/I2C_Function.py b/REST/I2C_Function.py index 249e600..5fc9d68 100644 --- a/REST/I2C_Function.py +++ b/REST/I2C_Function.py @@ -155,9 +155,6 @@ def analyze_data(num_numbers, bits_per_number, startup): return json.dumps(data) else: - os.unlink(filename) - os.unlink(binary_filename) - os.unlink(hex_filename) return 400 # Teste den Code diff --git a/REST/app.py b/REST/app.py index afbcbd9..ea47dc3 100644 --- a/REST/app.py +++ b/REST/app.py @@ -40,10 +40,10 @@ def get_random_numbers(): bits = request.args.get('numBits') 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: - 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: return create_response(432, 'System not ready; try init') diff --git a/REST/script.js b/REST/script.js index fe6993c..3665ea1 100644 --- a/REST/script.js +++ b/REST/script.js @@ -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 } else { + document.getElementById('status').innerText = 'Status: ' + data.status; + document.getElementById('description').innerText = data.description; + var errorParagraph = document.createElement('p'); errorParagraph.textContent = 'Error: ' + data.message; resultDiv.appendChild(errorParagraph);