v1.4.0 #14
@@ -121,6 +121,7 @@ def dashboard():
|
|||||||
"""Main dashboard."""
|
"""Main dashboard."""
|
||||||
instances = db.get_all_instances()
|
instances = db.get_all_instances()
|
||||||
all_backups = db.get_all_backups()
|
all_backups = db.get_all_backups()
|
||||||
|
total_backup_size = sum((backup.get('file_size') or 0) for backup in all_backups)
|
||||||
|
|
||||||
# Add instance info to each backup
|
# Add instance info to each backup
|
||||||
for backup in all_backups:
|
for backup in all_backups:
|
||||||
@@ -129,7 +130,13 @@ def dashboard():
|
|||||||
backup['instance_name'] = instance['name']
|
backup['instance_name'] = instance['name']
|
||||||
backup['instance_identifier'] = instance['identifier']
|
backup['instance_identifier'] = instance['identifier']
|
||||||
|
|
||||||
return render_template('dashboard.html', instances=instances, backups=all_backups, sftp_server=sftp_server)
|
return render_template(
|
||||||
|
'dashboard.html',
|
||||||
|
instances=instances,
|
||||||
|
backups=all_backups,
|
||||||
|
sftp_server=sftp_server,
|
||||||
|
total_backup_size=total_backup_size
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.route('/instances')
|
@app.route('/instances')
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Stats Cards -->
|
<!-- Stats Cards -->
|
||||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
|
<div class="grid grid-cols-1 md:grid-cols-4 gap-6">
|
||||||
<div class="bg-neutral-800 rounded-lg p-6 border border-neutral-700">
|
<div class="bg-neutral-800 rounded-lg p-6 border border-neutral-700">
|
||||||
<div class="flex items-center justify-between">
|
<div class="flex items-center justify-between">
|
||||||
<div>
|
<div>
|
||||||
@@ -39,6 +39,30 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="bg-neutral-800 rounded-lg p-6 border border-neutral-700">
|
||||||
|
<div class="flex items-center justify-between">
|
||||||
|
<div>
|
||||||
|
<p class="text-neutral-400 text-sm font-medium">Total Backup Size</p>
|
||||||
|
<p class="text-3xl font-bold text-orange-500 mt-2">
|
||||||
|
{% if total_backup_size >= 1024 * 1024 * 1024 %}
|
||||||
|
{{ "%.2f"|format(total_backup_size / 1024 / 1024 / 1024) }} GB
|
||||||
|
{% elif total_backup_size >= 1024 * 1024 %}
|
||||||
|
{{ "%.2f"|format(total_backup_size / 1024 / 1024) }} MB
|
||||||
|
{% elif total_backup_size >= 1024 %}
|
||||||
|
{{ "%.2f"|format(total_backup_size / 1024) }} KB
|
||||||
|
{% else %}
|
||||||
|
{{ total_backup_size }} B
|
||||||
|
{% endif %}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="p-3 bg-orange-500/20 rounded-lg">
|
||||||
|
<svg class="w-8 h-8 text-orange-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 7h16M4 12h16m-7 5h7"></path>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="bg-neutral-800 rounded-lg p-6 border border-neutral-700">
|
<div class="bg-neutral-800 rounded-lg p-6 border border-neutral-700">
|
||||||
<div class="flex items-center justify-between">
|
<div class="flex items-center justify-between">
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
Reference in New Issue
Block a user