diff --git a/seahub/settings.py b/seahub/settings.py index 93326ac3d3..266ab806f0 100644 --- a/seahub/settings.py +++ b/seahub/settings.py @@ -218,6 +218,9 @@ LOGIN_REDIRECT_URL = '/profile/' ACCOUNT_ACTIVATION_DAYS = 7 +# show traffic on the UI +SHOW_TRAFFIC = True + # Enable or disable make group public ENABLE_MAKE_GROUP_PUBLIC = False diff --git a/seahub/templates/snippets/space_and_traffic.html b/seahub/templates/snippets/space_and_traffic.html index a739b474ac..0d0a6d949f 100644 --- a/seahub/templates/snippets/space_and_traffic.html +++ b/seahub/templates/snippets/space_and_traffic.html @@ -25,7 +25,7 @@ {% endif %} -{% if TRAFFIC_STATS_ENABLED %} +{% if SHOW_TRAFFIC and TRAFFIC_STATS_ENABLED %} {% trans "Traffic this month:" %} {{ traffic_stat|filesizeformat }} {% endif %} diff --git a/seahub/views/ajax.py b/seahub/views/ajax.py index e827a37c94..179ed4ccf2 100644 --- a/seahub/views/ajax.py +++ b/seahub/views/ajax.py @@ -49,7 +49,7 @@ from seahub.group.views import is_group_staff import seahub.settings as settings from seahub.settings import ENABLE_THUMBNAIL, THUMBNAIL_ROOT, \ THUMBNAIL_DEFAULT_SIZE, ENABLE_SUB_LIBRARY, ENABLE_REPO_HISTORY_SETTING, \ - ENABLE_FOLDER_PERM + ENABLE_FOLDER_PERM, SHOW_TRAFFIC from seahub.utils import check_filename_with_rename, EMPTY_SHA1, \ gen_block_get_url, TRAFFIC_STATS_ENABLED, get_user_traffic_stat,\ new_merge_with_no_conflict, get_commit_before_new_merge, \ @@ -1684,6 +1684,7 @@ def space_and_traffic(request): "CALC_SHARE_USAGE": CALC_SHARE_USAGE, "show_quota_help": not CALC_SHARE_USAGE, "rates": rates, + "SHOW_TRAFFIC": SHOW_TRAFFIC, "TRAFFIC_STATS_ENABLED": TRAFFIC_STATS_ENABLED, "traffic_stat": traffic_stat, "ENABLE_PAYMENT": ENABLE_PAYMENT,