Skip to content

Commit

Permalink
fix: 安装通道list接口数据结构规范 (closed TencentBlueKing#2430)
Browse files Browse the repository at this point in the history
  • Loading branch information
Huayeaaa committed Sep 10, 2024
1 parent a2092c3 commit 05b1ca5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions apps/node_man/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ class TimeUnit:
DEFAULT_AP_ID = int(os.environ.get("DEFAULT_AP_ID", -1))
# 自动选择安装通道ID
DEFAULT_INSTALL_CHANNEL_ID = int(os.environ.get("DEFAULT_AP_ID", -1))
# 自动选择的云区域ID
AUTOMATIC_CHOICE_CLOUD_ID = int(os.environ.get("AUTOMATIC_CHOICE_CLOUD_ID", -1))
# 自动选择
AUTOMATIC_CHOICE = os.environ.get("AUTOMATIC_CHOICE", _("自动选择"))
# 默认安装通道
Expand Down
12 changes: 11 additions & 1 deletion apps/node_man/views/install_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,17 @@ def get_queryset(self):

def list(self, request, *args, **kwargs):
response = super().list(request, *args, **kwargs)
response.data.insert(0, {"id": constants.DEFAULT_INSTALL_CHANNEL_ID, "name": constants.AUTOMATIC_CHOICE})
response.data.insert(
0,
{
"id": constants.DEFAULT_INSTALL_CHANNEL_ID,
"name": constants.AUTOMATIC_CHOICE,
"bk_cloud_id": constants.AUTOMATIC_CHOICE_CLOUD_ID,
"jump_servers": [],
"upstream_servers": {},
"hidden": False,
},
)
return response

@swagger_auto_schema(
Expand Down

0 comments on commit 05b1ca5

Please sign in to comment.