1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-16 15:19:06 +00:00

add option 'SHOW_TRAFFIC'

This commit is contained in:
llj
2015-09-11 11:00:54 +08:00
parent 3b00b7cf83
commit 0f5472bdee
3 changed files with 6 additions and 2 deletions

View File

@@ -218,6 +218,9 @@ LOGIN_REDIRECT_URL = '/profile/'
ACCOUNT_ACTIVATION_DAYS = 7 ACCOUNT_ACTIVATION_DAYS = 7
# show traffic on the UI
SHOW_TRAFFIC = True
# Enable or disable make group public # Enable or disable make group public
ENABLE_MAKE_GROUP_PUBLIC = False ENABLE_MAKE_GROUP_PUBLIC = False

View File

@@ -25,7 +25,7 @@
{% endif %} {% endif %}
</div> </div>
{% if TRAFFIC_STATS_ENABLED %} {% if SHOW_TRAFFIC and TRAFFIC_STATS_ENABLED %}
<a class="item" href="http://www.seafile.com/{% if LANGUAGE_CODE != 'zh-cn' %}en/{% endif %}help/traffic/" target="_blank" id="traffic-stat">{% trans "Traffic this month:" %} {{ traffic_stat|filesizeformat }}</a> <a class="item" href="http://www.seafile.com/{% if LANGUAGE_CODE != 'zh-cn' %}en/{% endif %}help/traffic/" target="_blank" id="traffic-stat">{% trans "Traffic this month:" %} {{ traffic_stat|filesizeformat }}</a>
{% endif %} {% endif %}

View File

@@ -49,7 +49,7 @@ from seahub.group.views import is_group_staff
import seahub.settings as settings import seahub.settings as settings
from seahub.settings import ENABLE_THUMBNAIL, THUMBNAIL_ROOT, \ from seahub.settings import ENABLE_THUMBNAIL, THUMBNAIL_ROOT, \
THUMBNAIL_DEFAULT_SIZE, ENABLE_SUB_LIBRARY, ENABLE_REPO_HISTORY_SETTING, \ 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, \ from seahub.utils import check_filename_with_rename, EMPTY_SHA1, \
gen_block_get_url, TRAFFIC_STATS_ENABLED, get_user_traffic_stat,\ gen_block_get_url, TRAFFIC_STATS_ENABLED, get_user_traffic_stat,\
new_merge_with_no_conflict, get_commit_before_new_merge, \ 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, "CALC_SHARE_USAGE": CALC_SHARE_USAGE,
"show_quota_help": not CALC_SHARE_USAGE, "show_quota_help": not CALC_SHARE_USAGE,
"rates": rates, "rates": rates,
"SHOW_TRAFFIC": SHOW_TRAFFIC,
"TRAFFIC_STATS_ENABLED": TRAFFIC_STATS_ENABLED, "TRAFFIC_STATS_ENABLED": TRAFFIC_STATS_ENABLED,
"traffic_stat": traffic_stat, "traffic_stat": traffic_stat,
"ENABLE_PAYMENT": ENABLE_PAYMENT, "ENABLE_PAYMENT": ENABLE_PAYMENT,