diff --git a/apps/authentication/templates/authentication/login.html b/apps/authentication/templates/authentication/login.html index c535509a7..27ef9d61e 100644 --- a/apps/authentication/templates/authentication/login.html +++ b/apps/authentication/templates/authentication/login.html @@ -5,9 +5,9 @@ - + - {{ JMS_TITLE }} + {{ INTERFACE.login_title }} {% include '_head_css_js.html' %} @@ -183,7 +183,7 @@
- screen-image + screen-image
@@ -206,7 +206,7 @@
- {{ JMS_TITLE }} + {{ INTERFACE.login_title }}
@@ -300,9 +300,6 @@ $('#password-hidden').val(passwordEncrypted); //返回给密码输入input $('#login-form').submit(); //post提交 } - - $(document).ready(function () { - }) diff --git a/apps/authentication/templates/authentication/login_wait_confirm.html b/apps/authentication/templates/authentication/login_wait_confirm.html index 9d2af40a5..bd94c1986 100644 --- a/apps/authentication/templates/authentication/login_wait_confirm.html +++ b/apps/authentication/templates/authentication/login_wait_confirm.html @@ -6,7 +6,7 @@ - + {{ title }} {% include '_head_css_js.html' %} @@ -20,9 +20,9 @@
- +

- {{ JMS_TITLE }} + {{ INTERFACE.login_title }}

diff --git a/apps/jumpserver/conf.py b/apps/jumpserver/conf.py index a3583e69d..c3a0a0210 100644 --- a/apps/jumpserver/conf.py +++ b/apps/jumpserver/conf.py @@ -413,7 +413,6 @@ class Config(dict): 'FORGOT_PASSWORD_URL': '', 'HEALTH_CHECK_TOKEN': '', - } @staticmethod diff --git a/apps/jumpserver/context_processor.py b/apps/jumpserver/context_processor.py index 54a7b856e..1df4ebb17 100644 --- a/apps/jumpserver/context_processor.py +++ b/apps/jumpserver/context_processor.py @@ -4,34 +4,32 @@ from django.templatetags.static import static from django.conf import settings from django.utils.translation import ugettext_lazy as _ +default_interface = dict(( + ('logo_logout', static('img/logo.png')), + ('logo_index', static('img/logo_text.png')), + ('login_image', static('img/login_image.jpg')), + ('favicon', static('img/facio.ico')), + ('login_title', _('JumpServer Open Source Bastion Host')), + ('theme', 'classic'), + ('primary_color', '#1ab394'), +)) + default_context = { 'DEFAULT_PK': '00000000-0000-0000-0000-000000000000', - 'LOGO_URL': static('img/logo.png'), - 'LOGO_TEXT_URL': static('img/logo_text.png'), - 'LOGIN_IMAGE_URL': static('img/login_image.jpg'), - 'FAVICON_URL': static('img/facio.ico'), - 'LOGIN_CAS_LOGO_URL': static('img/login_cas_logo.png'), - 'LOGIN_WECOM_LOGO_URL': static('img/login_wecom_logo.png'), - 'LOGIN_DINGTALK_LOGO_URL': static('img/login_dingtalk_logo.png'), - 'LOGIN_FEISHU_LOGO_URL': static('img/login_feishu_logo.png'), - 'JMS_TITLE': _('JumpServer Open Source Bastion Host'), -} - -default_interface = { - 'login_title': default_context['JMS_TITLE'], - 'logo_logout': default_context['LOGO_URL'], - 'logo_index': default_context['LOGO_TEXT_URL'], - 'login_image': default_context['LOGIN_IMAGE_URL'], - 'favicon': default_context['FAVICON_URL'], + 'LOGIN_CAS_logo_logout': static('img/login_cas_logo.png'), + 'LOGIN_WECOM_logo_logout': static('img/login_wecom_logo.png'), + 'LOGIN_DINGTALK_logo_logout': static('img/login_dingtalk_logo.png'), + 'LOGIN_FEISHU_logo_logout': static('img/login_feishu_logo.png'), + 'COPYRIGHT': 'FIT2CLOUD 飞致云' + ' © 2014-2022', + 'INTERFACE': default_interface, } def jumpserver_processor(request): # Setting default pk - context = default_context + context = {**default_context} context.update({ 'VERSION': settings.VERSION, - 'COPYRIGHT': 'FIT2CLOUD 飞致云' + ' © 2014-2022', 'SECURITY_COMMAND_EXECUTION': settings.SECURITY_COMMAND_EXECUTION, 'SECURITY_MFA_VERIFY_TTL': settings.SECURITY_MFA_VERIFY_TTL, 'FORCE_SCRIPT_NAME': settings.FORCE_SCRIPT_NAME, diff --git a/apps/jumpserver/settings/base.py b/apps/jumpserver/settings/base.py index e34433391..9b4cfb668 100644 --- a/apps/jumpserver/settings/base.py +++ b/apps/jumpserver/settings/base.py @@ -310,23 +310,9 @@ DEFAULT_AUTO_FIELD = 'django.db.models.AutoField' # For Debug toolbar INTERNAL_IPS = ["127.0.0.1"] -if DEBUG_DEV: - INSTALLED_APPS = ['debug_toolbar', 'pympler'] + INSTALLED_APPS - MIDDLEWARE.insert(0, 'debug_toolbar.middleware.DebugToolbarMiddleware') +if os.environ.get('DEBUG_TOOLBAR', False): + INSTALLED_APPS = ['debug_toolbar'] + INSTALLED_APPS + MIDDLEWARE.append('debug_toolbar.middleware.DebugToolbarMiddleware') DEBUG_TOOLBAR_PANELS = [ - 'debug_toolbar.panels.history.HistoryPanel', - 'debug_toolbar.panels.versions.VersionsPanel', - 'debug_toolbar.panels.timer.TimerPanel', - 'debug_toolbar.panels.settings.SettingsPanel', - 'debug_toolbar.panels.headers.HeadersPanel', - 'debug_toolbar.panels.request.RequestPanel', - 'debug_toolbar.panels.sql.SQLPanel', - 'debug_toolbar.panels.staticfiles.StaticFilesPanel', - 'debug_toolbar.panels.templates.TemplatesPanel', - 'debug_toolbar.panels.cache.CachePanel', - 'debug_toolbar.panels.signals.SignalsPanel', - 'debug_toolbar.panels.logging.LoggingPanel', - 'debug_toolbar.panels.redirects.RedirectsPanel', 'debug_toolbar.panels.profiling.ProfilingPanel', - 'pympler.panels.MemoryPanel', ] diff --git a/apps/jumpserver/settings/libs.py b/apps/jumpserver/settings/libs.py index 03fcadfce..b3cc0dfde 100644 --- a/apps/jumpserver/settings/libs.py +++ b/apps/jumpserver/settings/libs.py @@ -20,7 +20,6 @@ REST_FRAMEWORK = { 'rest_framework.renderers.JSONRenderer', 'common.drf.renders.CSVFileRenderer', 'common.drf.renders.ExcelFileRenderer', - ), 'DEFAULT_PARSER_CLASSES': ( 'rest_framework.parsers.JSONParser', diff --git a/apps/ops/templates/ops/celery_task_log.html b/apps/ops/templates/ops/celery_task_log.html index c79ff42b2..599893db8 100644 --- a/apps/ops/templates/ops/celery_task_log.html +++ b/apps/ops/templates/ops/celery_task_log.html @@ -6,7 +6,7 @@ - + - + diff --git a/apps/templates/_without_nav_base.html b/apps/templates/_without_nav_base.html index f0e99902a..6e1c34484 100644 --- a/apps/templates/_without_nav_base.html +++ b/apps/templates/_without_nav_base.html @@ -5,8 +5,8 @@ - {{ JMS_TITLE }} - + {{ INTERFACE.login_title }} + {% include '_head_css_js.html' %} @@ -18,9 +18,9 @@
{% trans 'Home page' %} diff --git a/apps/templates/base.html b/apps/templates/base.html index ce3e453b1..fb15cc79b 100644 --- a/apps/templates/base.html +++ b/apps/templates/base.html @@ -5,11 +5,16 @@ - {{ JMS_TITLE }} - + {{ INTERFACE.login_title }} + {% include '_head_css_js.html' %} {% block custom_head_css_js %} {% endblock %} +
@@ -47,5 +52,6 @@ $(document).ready(function () { var pathKey = getMessagePathKey(); window.localStorage.setItem(pathKey, '1') }) + diff --git a/apps/templates/flash_message_standalone.html b/apps/templates/flash_message_standalone.html index c038beb41..3b1196db1 100644 --- a/apps/templates/flash_message_standalone.html +++ b/apps/templates/flash_message_standalone.html @@ -5,17 +5,20 @@ {% block title %} {{ title }}{% endblock %} {% block content %} +

+

{% if error %} -
{{ error }} -
{% else %} -
{{ message|safe }} -
{% endif %} +

diff --git a/apps/templates/rest_framework/base.html b/apps/templates/rest_framework/base.html deleted file mode 100644 index 7f5170a62..000000000 --- a/apps/templates/rest_framework/base.html +++ /dev/null @@ -1,285 +0,0 @@ -{% load staticfiles %} -{% load i18n %} -{% load rest_framework %} - - - - - {% block head %} - - {% block meta %} - - - {% endblock %} - - {% block title %}{% if name %}{{ name }} – {% endif %}Django REST framework{% endblock %} - - {% block style %} - {% block bootstrap_theme %} - - - {% endblock %} - - - - {% endblock %} - - {% endblock %} - - - {% block body %} - - -
- {% block navbar %} - - {% endblock %} - -
- {% block breadcrumbs %} - - {% endblock %} - - -
- - {% if 'GET' in allowed_methods %} - -
- {% if api_settings.URL_FORMAT_OVERRIDE %} -
- GET - - - -
- {% else %} - GET - {% endif %} -
- - {% endif %} - - {% if options_form %} -
- -
- {% endif %} - - {% if delete_form %} - - - - - {% endif %} - - {% if filter_form %} - - {% endif %} - -
- -
- {% block description %} - {{ description }} - {% endblock %} -
- - {% if paginator %} - - {% endif %} - -
-
{{ request.method }} {{ request.get_full_path }}
-
- -
-
HTTP {{ response.status_code }} {{ response.status_text }}{% autoescape off %}
-  {% for key, val in response_headers.items %}{{ key }}: {{ val|break_long_headers|urlize_quoted_links }}
-  {% endfor %}
-  {{ content|urlize_quoted_links }}
{% endautoescape %} -
-
- - {% if display_edit_forms %} - {% if post_form or raw_data_post_form %} -
- {% if post_form %} - - {% endif %} - -
- {% if post_form %} -
- {% with form=post_form %} -
-
- {% csrf_token %} - {{ post_form }} -
- -
-
-
- {% endwith %} -
- {% endif %} - -
- {% with form=raw_data_post_form %} -
-
- {% include "rest_framework/raw_data_form.html" %} -
- -
-
-
- {% endwith %} -
-
-
- {% endif %} - - {% if put_form or raw_data_put_form or raw_data_patch_form %} -
- {% if put_form %} - - {% endif %} - -
- {% if put_form %} -
-
-
- {{ put_form }} -
- -
-
-
-
- {% endif %} - -
- {% with form=raw_data_put_or_patch_form %} -
-
- {% include "rest_framework/raw_data_form.html" %} -
- {% if raw_data_put_form %} - - {% endif %} - {% if raw_data_patch_form %} - - {% endif %} -
-
-
- {% endwith %} -
-
-
- {% endif %} - {% endif %} -
-
-
- - {% if filter_form %} - {{ filter_form }} - {% endif %} - - {% block script %} - - - - - - - - - {% endblock %} - - - {% endblock %} - diff --git a/apps/tickets/templates/tickets/approve_check_password.html b/apps/tickets/templates/tickets/approve_check_password.html index 78eadbf6f..9fd7e0862 100644 --- a/apps/tickets/templates/tickets/approve_check_password.html +++ b/apps/tickets/templates/tickets/approve_check_password.html @@ -25,7 +25,7 @@
- +

{% trans 'Ticket approval' %}

diff --git a/apps/users/templates/users/user_otp_enable_bind.html b/apps/users/templates/users/user_otp_enable_bind.html index 11e4e01b9..665e31569 100644 --- a/apps/users/templates/users/user_otp_enable_bind.html +++ b/apps/users/templates/users/user_otp_enable_bind.html @@ -30,8 +30,8 @@