mirror of
https://github.com/Doctorado-ML/benchmark.git
synced 2025-08-15 07:25:53 +00:00
Fix compare problem in Excel files
This commit is contained in:
@@ -63,7 +63,7 @@ def index(compare="False"):
|
||||
@app.route("/show", methods=["post"])
|
||||
def show():
|
||||
selected_file = request.form["selected-file"]
|
||||
compare = request.form["compare"] == "true"
|
||||
compare = request.form["compare"].capitalize() == "True"
|
||||
with open(os.path.join(Folders.results, selected_file)) as f:
|
||||
data = json.load(f)
|
||||
try:
|
||||
@@ -82,8 +82,8 @@ def show():
|
||||
|
||||
@app.route("/excel", methods=["post"])
|
||||
def excel():
|
||||
selected_files = request.json["selected-files"]
|
||||
compare = request.json["compare"] == "true"
|
||||
selected_files = request.json["selectedFiles"]
|
||||
compare = request.json["compare"]
|
||||
book = None
|
||||
try:
|
||||
for file_name in selected_files:
|
||||
|
@@ -17,11 +17,16 @@ $(document).ready(function () {
|
||||
});
|
||||
function excelFile() {
|
||||
var selectedFiles = ["{{ file }}"];
|
||||
var compare = "{{ compare }}" == "True";
|
||||
var data = {
|
||||
"selectedFiles": selectedFiles,
|
||||
"compare": compare
|
||||
};
|
||||
// send data to server with ajax post
|
||||
$.ajax({
|
||||
type:'POST',
|
||||
url:'/excel',
|
||||
data: JSON.stringify(selectedFiles),
|
||||
data: JSON.stringify(data),
|
||||
contentType: "application/json",
|
||||
dataType: 'json',
|
||||
success: function(data){
|
||||
|
@@ -54,11 +54,16 @@ function excel() {
|
||||
alert("Select at least one file");
|
||||
return;
|
||||
}
|
||||
// send data to server with ajax post
|
||||
var compare = $("#compare").is(':checked');
|
||||
// send data to server with ajax post
|
||||
var data = {
|
||||
selectedFiles: selectedFiles,
|
||||
compare: compare
|
||||
};
|
||||
$.ajax({
|
||||
type:'POST',
|
||||
url:'/excel',
|
||||
data: JSON.stringify(selectedFiles),
|
||||
data: JSON.stringify(data),
|
||||
contentType: "application/json",
|
||||
dataType: 'json',
|
||||
success: function(data){
|
||||
|
Reference in New Issue
Block a user