Skip to content

Commit

Permalink
print disk space info
Browse files Browse the repository at this point in the history
  • Loading branch information
BernhardKoschicek committed Nov 27, 2023
1 parent 82d34da commit 0e4923c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions openatlas/views/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,14 @@ def get_disk_space_info() -> Optional[dict[str, Any]]:
percent_free = 100 - math.ceil(stats.free / (stats.total / 100))
percent_files = math.ceil(files_size / (stats.total / 100))
other_files = stats.total - stats.free - files_size
print({
'total': convert_size(stats.total),
'project': convert_size(files_size),
'other_files': convert_size(other_files),
'free': convert_size(stats.free),
'percent_used': percent_free,
'percent_project': percent_files,
'percent_other': 100 - (percent_files + percent_free)})
return {
'total': convert_size(stats.total),
'project': convert_size(files_size),
Expand Down

0 comments on commit 0e4923c

Please sign in to comment.