Implement dataset functionality with views, URLs, and management command
This commit is contained in:
parent
45c581715a
commit
a12b34a665
12 changed files with 812 additions and 51 deletions
48
templates/twitch/dataset_backups.html
Normal file
48
templates/twitch/dataset_backups.html
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
{% extends "base.html" %}
|
||||
{% block title %}
|
||||
Dataset Backups
|
||||
{% endblock title %}
|
||||
{% block content %}
|
||||
<main>
|
||||
<h1 id="page-title">Dataset Backups</h1>
|
||||
<p>Scanning {{ data_dir }} for database backups.</p>
|
||||
{% if datasets %}
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Path</th>
|
||||
<th>Size</th>
|
||||
<th>Updated</th>
|
||||
<th>Download</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for dataset in datasets %}
|
||||
<tr id="dataset-row-{{ forloop.counter }}">
|
||||
<td>{{ dataset.name }}</td>
|
||||
<td>{{ dataset.display_path }}</td>
|
||||
<td>{{ dataset.size }}</td>
|
||||
<td>
|
||||
<time datetime="{{ dataset.updated_at|date:'c' }}"
|
||||
title="{{ dataset.updated_at|date:'DATETIME_FORMAT' }}">
|
||||
{{ dataset.updated_at|timesince }} ago
|
||||
</time>
|
||||
</td>
|
||||
<td>
|
||||
{% if dataset.download_path %}
|
||||
<a href="{% url 'twitch:dataset_backup_download' dataset.download_path %}">Download</a>
|
||||
{% else %}
|
||||
-
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<p>Found {{ dataset_count }} datasets.</p>
|
||||
{% else %}
|
||||
<p>No dataset backups found.</p>
|
||||
{% endif %}
|
||||
</main>
|
||||
{% endblock content %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue