FEATURE: Improve backup stats on admin dashboard

* Dashboard doesn't timeout anymore when Amazon S3 is used for backups
* Storage stats are now a proper report with the same caching rules
* Changing the backup_location, s3_backup_bucket or creating and deleting backups removes the report from the cache
* It shows the number of backups and the backup location
* It shows the used space for the correct backup location instead of always showing used space on local storage
* It shows the date of the last backup as relative date
This commit is contained in:
Gerhard Schlager
2018-12-14 23:14:46 +01:00
parent 040ddec63d
commit 1a8ca68ea3
20 changed files with 223 additions and 173 deletions

View File

@ -24,7 +24,11 @@ module BackupRestore
def delete_file(filename)
obj = @s3_helper.object(filename)
obj.delete if obj.exists?
if obj.exists?
obj.delete
reset_cache
end
end
def download_file(filename, destination_path, failure_message = nil)
@ -38,6 +42,7 @@ module BackupRestore
raise BackupFileExists.new if obj.exists?
obj.upload_file(source_path, content_type: content_type)
reset_cache
end
def generate_upload_url(filename)
@ -100,5 +105,9 @@ module BackupRestore
SiteSetting.s3_backup_bucket
end
end
def free_bytes
nil
end
end
end