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