From b1435253f6e448881b843760367e43d473579040 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=99=93=E9=A3=9E?= Date: Fri, 10 May 2024 11:56:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E6=A0=87=E9=A2=98=E5=8A=9F=E8=83=BD-custom?= =?UTF-8?q?=5Ftitle=5Fsuffix=20(#2631)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 添加favicon图片 * 修改favicon * 修改favicon.ico * 添加自定义环境标题 * update * update 自定义环境标题 * update custom_environment_title * update custom_environment_title * 添加favicon图片 * 修改favicon * 修改favicon.ico * 添加自定义环境标题 * update * update 自定义环境标题 * update custom_environment_title * update custom_environment_title * 修改字段名称,添加环境变量 * Update __init__.py * Update settings.py * update CUSTOM_TITLE_SUFFIX * 从env读写。env("CUSTOM_TITLE_SUFFIX", default="") * docker的环境变量加上此配置 --------- Co-authored-by: 王飞 --- archery/settings.py | 3 +++ common/templates/base.html | 4 ++-- common/templates/config.html | 11 +++++++++++ common/templates/login.html | 4 ++-- common/utils/global_info.py | 6 +++++- sql/templates/legacy_login_form.html | 2 +- src/docker-compose/.env | 3 +++ 7 files changed, 27 insertions(+), 6 deletions(-) diff --git a/archery/settings.py b/archery/settings.py index d9ce6f6b1b..de45f1dd41 100644 --- a/archery/settings.py +++ b/archery/settings.py @@ -486,6 +486,9 @@ }, } +# 在网站标题及登录页面追加此内容, 可用于多archery实例的区分。Archery后台也有相同配置,如都做了配置,以后台配置为准 +CUSTOM_TITLE_SUFFIX = env("CUSTOM_TITLE_SUFFIX", default="") + MEDIA_ROOT = os.path.join(BASE_DIR, "media") if not os.path.exists(MEDIA_ROOT): os.mkdir(MEDIA_ROOT) diff --git a/common/templates/base.html b/common/templates/base.html index f0ea044d7c..0f5a4dc6b1 100644 --- a/common/templates/base.html +++ b/common/templates/base.html @@ -7,7 +7,7 @@ - Archery-SQL审核查询平台 + {% block title %}Archery-SQL审核查询平台{{ custom_title_suffix }}{% endblock %} @@ -35,7 +35,7 @@ - Archery + Archery{{ custom_title_suffix }} diff --git a/common/templates/config.html b/common/templates/config.html index c9732458b6..93af8eeb1f 100755 --- a/common/templates/config.html +++ b/common/templates/config.html @@ -1099,6 +1099,17 @@

其他配置

+
+ +
+ +
+

diff --git a/common/templates/login.html b/common/templates/login.html index 817a0d71bf..064ce07926 100644 --- a/common/templates/login.html +++ b/common/templates/login.html @@ -1,7 +1,7 @@ - Login To Archery + Login To Archery{{ custom_title_suffix }} {% load static %} @@ -18,7 +18,7 @@