From af5de72cd6985719da34b9aec14ee4d27ffa38d6 Mon Sep 17 00:00:00 2001 From: waylon <1158341873@qq.com> Date: Tue, 8 Oct 2024 17:20:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=87=E6=A1=A3=E4=B8=AD=E5=BF=83?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=E8=A7=84=E8=8C=83=E8=B0=83=E6=95=B4=20#7577?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gcloud/conf/default_settings.py | 2 +- gcloud/core/context_processors.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gcloud/conf/default_settings.py b/gcloud/conf/default_settings.py index f4418fcf1..1fb1736a0 100644 --- a/gcloud/conf/default_settings.py +++ b/gcloud/conf/default_settings.py @@ -27,7 +27,7 @@ APP_HOST = env.BK_SOPS_HOST ESB_GET_ALL_USER = "{}/api/c/compapi/v2/usermanage/fe_list_users/".format(settings.BK_PAAS_ESB_HOST) -BK_DOC_URL = "{}/markdown/ZH/SOPS/3.33/UserGuide/Overview/README.md".format(env.BK_DOC_CENTER_HOST) +BK_DOC_URL = f"{env.BK_DOC_CENTER_HOST}/markdown/{{}}/SOPS/3.33/UserGuide/Overview/README.md" FEEDBACK_URL = "https://bk.tencent.com/s-mart/community" APP_MAKER_UPLOAD_LOGO_USER_UIN = "bk_token" APP_MAKER_UPLOAD_LOGO_USER_KEY = "bk_token_null" diff --git a/gcloud/core/context_processors.py b/gcloud/core/context_processors.py index cf9b21c3b..232fc0896 100644 --- a/gcloud/core/context_processors.py +++ b/gcloud/core/context_processors.py @@ -49,6 +49,7 @@ def get_cur_pos_from_url(request): def mysetting(request): # 嵌入CICD,隐藏头部 language = request.COOKIES.get("blueking_language", "zh-cn") + doc_lang_mappings = {"zh-cn": "ZH", "en": "EN"} run_ver_key = "BKAPP_RUN_VER_NAME" if language == "zh-cn" else "BKAPP_RUN_VER_NAME_{}".format(language.upper()) file_manager_type = "BKAPP_FILE_MANAGER_TYPE" hide_header = int(request.GET.get("hide_header", "0") == "1") @@ -117,7 +118,7 @@ def mysetting(request): "FILE_UPLOAD_ENTRY": env.BKAPP_FILE_UPLOAD_ENTRY, "MEMBER_SELECTOR_DATA_HOST": settings.BK_MEMBER_SELECTOR_DATA_HOST, "BK_STATIC_URL": frontend_entry_url, - "BK_DOC_URL": settings.BK_DOC_URL, + "BK_DOC_URL": settings.BK_DOC_URL.format(doc_lang_mappings.get(language, "ZH")), "FEEDBACK_URL": settings.FEEDBACK_URL, "FILE_MANAGER_TYPE": EnvironmentVariables.objects.get_var(file_manager_type, env.BKAPP_FILE_MANAGER_TYPE), "MAX_NODE_EXECUTE_TIMEOUT": settings.MAX_NODE_EXECUTE_TIMEOUT,