Fixes file views and downloads.

This commit is contained in:
Michael Beck
2025-01-31 00:49:57 +01:00
parent 026d6742db
commit 4eaff5a9b1
3 changed files with 54 additions and 15 deletions

View File

@@ -25,22 +25,55 @@
<main>
<section id="scrapingFormContainer" class="container-fluid d-flex justify-content-center">
<div class="container-md my-5 mx-2 shadow-lg p-4 ">
<h2>Available Files</h2>
<table class="table">
<h2>Data</h2>
<table id="dataFilesTable" class="table table-striped table-bordered table-hover">
<thead>
<tr>
<td>Data</td>
<td>Logs</td>
<th onclick="sortTable(0, 'dataFilesTable')">File Name</th>
<th onclick="sortTable(1, 'dataFilesTable')">Last Modified</th>
<th onclick="sortTable(2, 'dataFilesTable')">Created</th>
<th onclick="sortTable(3, 'dataFilesTable')">Size</th>
<th>Action</th>
</tr>
</thead>
{% for file in files.data %}
<tr>
<td><a href="{{ url_for('download_data_file', filename=file.name.split('/')[-1]) }}" target="_blank">{{ file.name }}</a></td>
<td>{{ file.last_modified | datetimeformat }}</td>
<td>{{ file.created | datetimeformat }}</td>
<td>{{ file.size }}</td>
<td>
<button onclick="deleteFile('{{ file.name }}')">Delete</button>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<h2>Log</h2>
<table id="logFilesTable" class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th onclick="sortTable(0, 'logFilesTable')">File Name</th>
<th onclick="sortTable(1, 'logFilesTable')">Last Modified</th>
<th onclick="sortTable(2, 'logFilesTable')">Created</th>
<th onclick="sortTable(3, 'logFilesTable')">Size</th>
<th>Action</th>
</tr>
</thead>
<tbody>
{% for file in files %}
<tr>
<td><a href="{{ url_for('download_results', filename=file) }}">{{ file }}</a></td>
<td><a href="{{ url_for('download_logs', filename=file) }}">{{ file }}</a></td>
</tr>
{% for file in files.log %}
<tr>
<td><a href="{{ url_for('download_log_file', filename=file.name.split('/')[-1]) }}" target="_blank">{{ file.name }}</a></td>
<td>{{ file.last_modified | datetimeformat }}</td>
<td>{{ file.created | datetimeformat }}</td>
<td>{{ file.size }}</td>
<td>
<button onclick="deleteFile('{{ file.name }}')">Delete</button>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</section>
</main>