|
{% extends "base.html" %} {% block title %}Admin Dashboard - Grimvault{% |
|
endblock %} {% block content %} |
|
<div class="container"> |
|
<h1>Admin Dashboard</h1> |
|
<table id="user-accounts"> |
|
<thead> |
|
<tr> |
|
<th>Username</th> |
|
<th>Created At</th> |
|
<th>Last Active</th> |
|
<th>Storage Used</th> |
|
<th>Storage Limit</th> |
|
<th>Status</th> |
|
<th>Actions</th> |
|
</tr> |
|
</thead> |
|
<tbody> |
|
{% for account in accounts %} |
|
<tr> |
|
<td>{{ account.username }}</td> |
|
<td>{{ account.created_at.strftime('%Y-%m-%d %H:%M:%S') }}</td> |
|
<td>{{ account.last_active.strftime('%Y-%m-%d %H:%M:%S') }}</td> |
|
<td> |
|
{{ (account.storage_used / 1024 / 1024) | round(2) }} MB |
|
</td> |
|
<td> |
|
{{ (account.storage_limit / 1024 / 1024 / 1024) | round(2) |
|
}} GB |
|
</td> |
|
<td>{{ 'Banned' if account.is_banned else 'Active' }}</td> |
|
<td> |
|
<button |
|
class="btn btn-secondary update-storage" |
|
data-username="{{ account.username }}" |
|
> |
|
Update Storage |
|
</button> |
|
<button |
|
class="btn btn-warning toggle-ban" |
|
data-username="{{ account.username }}" |
|
data-banned="{{ account.is_banned }}" |
|
> |
|
{{ 'Unban' if account.is_banned else 'Ban' }} |
|
</button> |
|
<button |
|
class="btn btn-danger delete-account" |
|
data-username="{{ account.username }}" |
|
> |
|
Delete |
|
</button> |
|
</td> |
|
</tr> |
|
{% endfor %} |
|
</tbody> |
|
</table> |
|
<a |
|
href="{{ url_for('auth.logout') }}" |
|
class="btn btn-secondary" |
|
id="logout-btn" |
|
>Logout</a |
|
> |
|
</div> |
|
{% endblock %} {% block scripts %} |
|
<script src="{{ url_for('static', filename='js/admindash.js') }}"></script> |
|
{% endblock %} |
|
|