Skip to content

Commit

Permalink
feat(backend): 实例列表、实例选择器增加字段 TencentBlueKing#9119
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 29504
  • Loading branch information
ygcyao committed Jan 17, 2025
1 parent 9d91f35 commit f812c8d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dbm-ui/backend/db_services/dbbase/resources/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,9 @@ def _filter_instance_qs(cls, query_filters: Q, query_params: Dict[str, str]) ->
"machine__machine_type",
"machine__bk_sub_zone",
"machine__bk_sub_zone_id",
"machine__bk_os_name",
"machine__bk_rack_id",
"machine__bk_svr_device_cls_name",
]
# 获取storage实例的查询集
storage_queryset = (
Expand Down Expand Up @@ -790,6 +793,9 @@ def _to_instance_representation(
"instance_address": f"{instance['machine__ip']}{IP_PORT_DIVIDER}{instance['port']}",
"bk_host_id": instance["machine__bk_host_id"],
"machine_type": instance["machine__machine_type"],
"bk_os_name": instance["machine__bk_os_name"],
"bk_rack_id": instance["machine__bk_rack_id"],
"bk_svr_device_cls_name": instance["machine__bk_svr_device_cls_name"],
"role": instance["role"],
"master_domain": cluster_entry_map.get(instance["cluster__id"], {}).get("master_domain", ""),
"slave_domain": cluster_entry_map.get(instance["cluster__id"], {}).get("slave_domain", ""),
Expand Down
3 changes: 3 additions & 0 deletions dbm-ui/backend/db_services/mongodb/resources/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,9 @@ def _filter_instance_qs(cls, query_filters: Q, query_params: Dict[str, str]) ->
"machine__spec_config",
"machine__bk_sub_zone",
"machine__bk_sub_zone_id",
"machine__bk_os_name",
"machine__bk_rack_id",
"machine__bk_svr_device_cls_name",
"shard",
]
storage_instance = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ def _filter_instance_qs(cls, query_filters, query_params):
"machine__machine_type",
"machine__bk_sub_zone",
"machine__bk_sub_zone_id",
"machine__bk_os_name",
"machine__bk_rack_id",
"machine__bk_svr_device_cls_name",
]

# 获取remote实例的查询集
Expand Down
3 changes: 3 additions & 0 deletions dbm-ui/backend/db_services/quick_search/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ def filter_instance(self, keyword_list: list):
"bk_idc_area": F("machine__bk_idc_area"),
"bk_idc_name": F("machine__bk_idc_name"),
"bk_sub_zone": F("machine__bk_sub_zone"),
"bk_os_name": F("machine__bk_os_name"),
"bk_rack_id": F("machine__bk_rack_id"),
"bk_svr_device_cls_name": F("machine__bk_svr_device_cls_name"),
"ip_port": Concat("machine__ip", Value(":"), "port", output_field=CharField()),
}
fields = [
Expand Down

0 comments on commit f812c8d

Please sign in to comment.