mirror of
https://github.com/Doctorado-ML/benchmark.git
synced 2025-08-18 00:45:54 +00:00
Add excel to report
This commit is contained in:
@@ -67,6 +67,7 @@ def show():
|
|||||||
return render_template(
|
return render_template(
|
||||||
"report.html",
|
"report.html",
|
||||||
data=data,
|
data=data,
|
||||||
|
file=selected_file,
|
||||||
summary=summary,
|
summary=summary,
|
||||||
framework=app.config[FRAMEWORK],
|
framework=app.config[FRAMEWORK],
|
||||||
)
|
)
|
||||||
|
@@ -9,3 +9,21 @@ $(document).ready(function () {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
function excelFile() {
|
||||||
|
var selectedFiles = ["{{ file }}"];
|
||||||
|
// send data to server with ajax post
|
||||||
|
$.ajax({
|
||||||
|
type:'POST',
|
||||||
|
url:'/excel',
|
||||||
|
data: JSON.stringify(selectedFiles),
|
||||||
|
contentType: "application/json",
|
||||||
|
dataType: 'json',
|
||||||
|
success: function(data){
|
||||||
|
alert("Se ha generado el archivo "+data.file);
|
||||||
|
},
|
||||||
|
error: function (xhr, ajaxOptions, thrownError) {
|
||||||
|
var mensaje = JSON.parse(xhr.responseText || '{\"mensaje\": \"Error indeterminado\"}');
|
||||||
|
alert(mensaje.mensaje);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
@@ -79,6 +79,9 @@
|
|||||||
Total score: {{ "%.6f" % (data.results | sum(attribute="score")) }}
|
Total score: {{ "%.6f" % (data.results | sum(attribute="score")) }}
|
||||||
</b></h7>
|
</b></h7>
|
||||||
<h7>Number of files: {{ data.results | length }}</h7>
|
<h7>Number of files: {{ data.results | length }}</h7>
|
||||||
|
<div>
|
||||||
|
<input type="button", class="{{ button }}", value="Excel", onclick="excelFile()">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
@@ -85,6 +85,9 @@
|
|||||||
Total score: {{ "%.6f" % (data.results | sum(attribute="score")) }}
|
Total score: {{ "%.6f" % (data.results | sum(attribute="score")) }}
|
||||||
</b></h2>
|
</b></h2>
|
||||||
<h2>Number of files: {{ data.results | length }}</h2>
|
<h2>Number of files: {{ data.results | length }}</h2>
|
||||||
|
<div>
|
||||||
|
<input type="button", class="{{ button }}", value="Excel", onclick="excelFile()">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
@@ -4,10 +4,12 @@
|
|||||||
{% if framework == "bootstrap" %}
|
{% if framework == "bootstrap" %}
|
||||||
{% set center = "text-center" %}
|
{% set center = "text-center" %}
|
||||||
{% set right = "text-end" %}
|
{% set right = "text-end" %}
|
||||||
|
{% set button = "btn btn-primary" %}
|
||||||
{% include "partials/table_report_bootstrap.html" %}
|
{% include "partials/table_report_bootstrap.html" %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% set center = "has-text-centered" %}
|
{% set center = "has-text-centered" %}
|
||||||
{% set right = "has-text-right" %}
|
{% set right = "has-text-right" %}
|
||||||
|
{% set button = "button is-primary" %}
|
||||||
{% include "partials/table_report_bulma.html" %}
|
{% include "partials/table_report_bulma.html" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Reference in New Issue
Block a user