|
{% extends "base.html" %} {% block title %}Dashboard - Grimvault{% endblock %} |
|
{% block content %} |
|
<div class="container"> |
|
<h1>My Files</h1> |
|
<div class="storage-info"> |
|
<p> |
|
Used storage: {{ (used_storage / 1024 / 1024) | round(2) }} MB / {{ |
|
(storage_limit / 1024 / 1024 / 1024) | round(2) }} GB |
|
</p> |
|
<progress |
|
value="{{ used_storage }}" |
|
max="{{ storage_limit }}" |
|
></progress> |
|
</div> |
|
<div class="file-actions"> |
|
<form id="upload-form" enctype="multipart/form-data"> |
|
<input type="file" id="file-input" name="file" required /> |
|
<button type="submit" class="btn btn-primary">Upload</button> |
|
</form> |
|
<button id="empty-vault" class="btn btn-danger">Empty Vault</button> |
|
<a |
|
href="{{ url_for('auth.logout') }}" |
|
class="btn btn-secondary" |
|
id="logout-btn" |
|
>Logout</a |
|
> |
|
</div> |
|
<ul id="file-list"> |
|
{% for file in files %} |
|
<li> |
|
<span>{{ file.filename }}</span> |
|
<span>{{ file.size | filesizeformat }}</span> |
|
<button |
|
class="btn btn-secondary download-btn" |
|
data-filename="{{ file.filename }}" |
|
> |
|
Download |
|
</button> |
|
<button |
|
class="btn btn-danger delete-btn" |
|
data-filename="{{ file.filename }}" |
|
> |
|
Delete |
|
</button> |
|
</li> |
|
{% endfor %} |
|
</ul> |
|
</div> |
|
{% endblock %} {% block scripts %} |
|
<script src="{{ url_for('static', filename='js/dashboard.js') }}"></script> |
|
{% endblock %} |
|
|