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 0e4923c commit 39f68fb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion install/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN --mount=type=cache,target=/var/cache/apt \
apt install -y --no-install-recommends apache2 libapache2-mod-wsgi-py3 python3-coverage python3-nose exiftran &&\
apt install -y --no-install-recommends iipimage-server libvips-tools &&\
apt install -y --no-install-recommends gettext npm python3-pip git postgresql-client-13 &&\
apt install -y --no-install-recommends dos2unix locales locales-all w3c-sgml-lib &&\
apt install -y --no-install-recommends dos2unix locales locales-all w3c-sgml-lib vim nano &&\
mkdir -p /var/www/openatlas /var/www/.cache /var/www/.local /var/www/.npm &&\
chown -R www-data:www-data /var/www/.cache /var/www/.local /var/www/.npm /var/log/apache2 /var/run/apache2
RUN cp -rp /usr/lib/iipimage-server/ /var/www/iipsrv/ &&\
Expand Down
15 changes: 7 additions & 8 deletions openatlas/views/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -779,14 +779,13 @@ 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)})
print(files_size)
print(stats)
print(stats.free)
print(stats.total)
print(percent_free)
print(percent_files)
print(other_files)
return {
'total': convert_size(stats.total),
'project': convert_size(files_size),
Expand Down

0 comments on commit 39f68fb

Please sign in to comment.