Merge branch 'main' of https://github.com/leafspark/vAnalytics
This commit is contained in:
commit
ba2a610ac5
|
@ -1,4 +1,4 @@
|
||||||
numpy~=1.26.4
|
numpy~=2.1.1
|
||||||
uvicorn~=0.30.6
|
uvicorn~=0.30.6
|
||||||
requests~=2.32.3
|
requests~=2.32.3
|
||||||
pandas~=2.2.3
|
pandas~=2.2.3
|
||||||
|
|
|
@ -250,6 +250,7 @@ def index():
|
||||||
for name in os.listdir(data_dir)
|
for name in os.listdir(data_dir)
|
||||||
if name.endswith(".sqlite") and os.path.isfile(os.path.join(data_dir, name))
|
if name.endswith(".sqlite") and os.path.isfile(os.path.join(data_dir, name))
|
||||||
]
|
]
|
||||||
|
valid_model_names = set(model_names)
|
||||||
|
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
selected_model = request.form.get("model_select")
|
selected_model = request.form.get("model_select")
|
||||||
|
@ -272,6 +273,7 @@ def index():
|
||||||
"An error occurred while creating the plot. Please try again later."
|
"An error occurred while creating the plot. Please try again later."
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if selected_model in valid_model_names:
|
||||||
command = [
|
command = [
|
||||||
"python",
|
"python",
|
||||||
"get_data.py",
|
"get_data.py",
|
||||||
|
@ -279,6 +281,11 @@ def index():
|
||||||
"24",
|
"24",
|
||||||
f".\\data\\{selected_model}.sqlite",
|
f".\\data\\{selected_model}.sqlite",
|
||||||
]
|
]
|
||||||
|
result = subprocess.run(command, capture_output=True, text=True)
|
||||||
|
else:
|
||||||
|
logging.error(f"Invalid model selected: {selected_model}")
|
||||||
|
error_message = "Invalid model selected. Please choose a valid model."
|
||||||
|
result = None
|
||||||
|
|
||||||
result = subprocess.run(command, capture_output=True, text=True)
|
result = subprocess.run(command, capture_output=True, text=True)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue