mirror of
https://github.com/Doctorado-ML/beflask.git
synced 2025-08-16 23:55:52 +00:00
Add datasets and enhance select
This commit is contained in:
25
app/results/templates/_table_datasets.html
Normal file
25
app/results/templates/_table_datasets.html
Normal file
@@ -0,0 +1,25 @@
|
||||
<table id="file-table"
|
||||
class="table table-striped table-hover table-bordered bg-light">
|
||||
<thead>
|
||||
<tr class="bg-primary text-white">
|
||||
<th class="text-center">Dataset</th>
|
||||
<th class="text-center">Samples</th>
|
||||
<th class="text-center">Features</th>
|
||||
<th class="text-center">Cont. Feat.</th>
|
||||
<th class="text-center">Classes</th>
|
||||
<th class="text-center">Balance</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for dataset in datasets %}
|
||||
<tr>
|
||||
<td>{{ dataset.dataset }}</td>
|
||||
<td class="text-end">{{ "{:,}".format(dataset.samples) }}</td>
|
||||
<td class="text-end">{{ "{:,}".format(dataset.features) }}</td>
|
||||
<td class="text-end">{{ dataset.cont_features }}</td>
|
||||
<td class="text-end">{{ dataset.classes }}</td>
|
||||
<td>{{ dataset.balance }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
@@ -1,7 +1,7 @@
|
||||
{%- macro get_button_tag(icon_name, method, visible=True, name="") -%}
|
||||
<button class="btn btn-primary btn-small" onclick="{{ method }}" {{ "" if visible else "hidden='true'" }} {{ "" if name=="" else "name='" + name +"'"}}><i class="mdi mdi-{{ icon_name }}"></i>
|
||||
</button>
|
||||
{%- endmacro -%}
|
||||
<div class="float-right">
|
||||
<input type="checkbox" id="compare" name="compare" {% if config["COMPARE"] %}{{ "checked" }}{% endif %}>
|
||||
<span class="badge bg-info bg-small" onclick="$('#compare').click()">Comparing with best results</span>
|
||||
</div>
|
||||
<table id="file-table"
|
||||
class="table table-striped table-hover table-bordered">
|
||||
<thead>
|
||||
@@ -39,9 +39,17 @@
|
||||
<td>{{ "%s" % data["title"] }}</td>
|
||||
<td class="text-end">{{ "%.6f" % data["score"] }}</td>
|
||||
<td>
|
||||
{{ get_button_tag("table-eye", "showFile('" ~ file ~ "') ") | safe }}
|
||||
{% set file_best = "best_results_" ~ parts[1] ~ "_" ~ parts[2] ~ ".json" %}
|
||||
{{ get_button_tag("star-circle-outline", "redirectDouble('best_results', '" ~ file_best ~ "') ", visible=False, name="best_buttons") | safe }}
|
||||
<button class="btn btn-primary btn-small"
|
||||
onclick="{{ url_for("results.report", file_name=file) }}">
|
||||
<i class="mdi mdi-table-eye"></i>
|
||||
</button>
|
||||
<button class="btn btn-primary btn-small"
|
||||
onclick="{{ url_for("results.best", file_name=file_best) }}"
|
||||
hidden="true"
|
||||
name="best_buttons">
|
||||
<i class="mdi mdi-star-circle-outline"></i>
|
||||
</button>
|
||||
<input type="checkbox" name="selected_files" value="{{ file }}" />
|
||||
</td>
|
||||
</tr>
|
||||
|
26
app/results/templates/datasets.html
Normal file
26
app/results/templates/datasets.html
Normal file
@@ -0,0 +1,26 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
{% include "_table_datasets.html" %}
|
||||
{% endblock %}
|
||||
{% block jscript %}
|
||||
{{ super() }}
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$(document).ajaxStart(function(){
|
||||
$("body").addClass('ajaxLoading');
|
||||
});
|
||||
$(document).ajaxStop(function(){
|
||||
$("body").removeClass('ajaxLoading');
|
||||
});
|
||||
});
|
||||
// Check if row is selected
|
||||
$('#file-table tbody').on('click', 'tr', function () {
|
||||
if ($(this).hasClass('selected')) {
|
||||
$(this).removeClass('selected');
|
||||
} else {
|
||||
$('#file-table tbody tr.selected').removeClass("selected")
|
||||
$(this).addClass('selected');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
Reference in New Issue
Block a user