Skip to content

Commit

Permalink
feature: 部署时新增导航栏相关链接 (closed TencentBlueKing#1501)
Browse files Browse the repository at this point in the history
  • Loading branch information
CohleRustW committed May 10, 2023
1 parent 0bed2d8 commit a2ed8f8
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 55 deletions.
4 changes: 4 additions & 0 deletions common/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,8 @@ def mysetting(request):
# TAM前端监控
"TAM_ID": os.getenv("BKAPP_TAM_ID"),
"TAM_URL": os.getenv("BKAPP_TAM_URL"),
# 导航栏开源社区地址
"BKAPP_NAV_OPEN_SOURCE_URL": settings.BKAPP_NAV_OPEN_SOURCE_URL,
# 导航栏技术支持地址
"BKAPP_NAV_HELPER_URL": settings.BKAPP_NAV_HELPER_URL,
}
4 changes: 4 additions & 0 deletions config/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,10 @@
BK_IAM_SKIP = False

BK_DOCS_CENTER_HOST = os.getenv("BK_DOCS_CENTER_HOST")
# 导航栏技术支持地址
BKAPP_NAV_HELPER_URL = env.BKAPP_NAV_HELPER_URL
# 导航栏开源社区地址
BKAPP_NAV_OPEN_SOURCE_URL = env.BKAPP_NAV_OPEN_SOURCE_URL

INIT_SUPERUSER = ["admin"]
DEBUG = False
Expand Down
11 changes: 11 additions & 0 deletions env/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
"BKAPP_OTEL_SAMPLER",
"BKAPP_OTEL_BK_DATA_TOKEN",
"BKAPP_OTEL_GRPC_URL",
"BKAPP_NAV_OPEN_SOURCE_URL",
"BKAPP_NAV_HELPER_URL",
"BK_CC_HOST",
"BK_API_URL_TMPL",
"ENVIRONMENT",
Expand Down Expand Up @@ -108,3 +110,12 @@

# APIGW API 地址模板,在 PaaS 3.0 部署的应用,可从环境变量中获取 BK_API_URL_TMPL
BK_API_URL_TMPL = get_type_env(key="BK_API_URL_TMPL", default=BK_COMPONENT_API_URL + "/api/{api_name}", _type=str)

# 导航栏开源社区地址
BKAPP_NAV_OPEN_SOURCE_URL = get_type_env(
key="BKAPP_NAV_OPEN_SOURCE_URL", default="https://bk.tencent.com/s-mart/community/question", _type=str
)
# 导航栏技术支持地址
BKAPP_NAV_HELPER_URL = get_type_env(
key="BKAPP_NAV_HELPER_URL", default="https://wpa1.qq.com/KziXGWJs?_type=wpa&qidian=true", _type=str
)
Loading

0 comments on commit a2ed8f8

Please sign in to comment.