mirror of
https://github.com/Doctorado-ML/beflask.git
synced 2025-08-15 23:25:51 +00:00
Begin with model
This commit is contained in:
29
app/static/js/excelFiles.js
Normal file
29
app/static/js/excelFiles.js
Normal file
@@ -0,0 +1,29 @@
|
||||
function excelFiles(selectedFiles, compare) {
|
||||
var data = {
|
||||
"selectedFiles": selectedFiles,
|
||||
"compare": compare
|
||||
};
|
||||
// send data to server with ajax post
|
||||
$.ajax({
|
||||
type:'POST',
|
||||
url:'/excel',
|
||||
data: JSON.stringify(data),
|
||||
contentType: "application/json",
|
||||
dataType: 'json',
|
||||
success: function(data){
|
||||
if (data.success) {
|
||||
if (data.output == "local") {
|
||||
alert("Se ha generado el archivo " + data.file);
|
||||
} else {
|
||||
window.open('/download/' + data.file, "_blank");
|
||||
}
|
||||
} else {
|
||||
alert(data.file);
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
var mensaje = JSON.parse(xhr.responseText || '{\"mensaje\": \"Error indeterminado\"}');
|
||||
alert(mensaje.mensaje);
|
||||
}
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user