From e8ce42e7b4d9ceae5f7ca898efba3c4295f665e8 Mon Sep 17 00:00:00 2001 From: gqp <446105468@qq.com> Date: Wed, 11 Dec 2024 17:04:31 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=8F=90=E4=BE=9B=20Agent=20=E5=8C=85?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=90=8E=E5=8F=B0=E5=9F=BA=E7=A1=80=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=20(closed=20#1683)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/node_man/serializers/package_manage.py | 1 + apps/node_man/views/package_manage.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/node_man/serializers/package_manage.py b/apps/node_man/serializers/package_manage.py index 2827b8816..7ae610061 100644 --- a/apps/node_man/serializers/package_manage.py +++ b/apps/node_man/serializers/package_manage.py @@ -179,6 +179,7 @@ class AgentRegisterTaskResponseSerializer(serializers.Serializer): class DeployedAgentCountSerializer(serializers.Serializer): items = serializers.JSONField(default=[]) project = serializers.CharField(default=GsePackageCode.AGENT.value) + biz_scope = serializers.ListField(child=serializers.IntegerField(), default=[]) class VersionQuerySerializer(serializers.Serializer): diff --git a/apps/node_man/views/package_manage.py b/apps/node_man/views/package_manage.py index 759b97d90..7ee9e8b98 100644 --- a/apps/node_man/views/package_manage.py +++ b/apps/node_man/views/package_manage.py @@ -785,8 +785,8 @@ def deployed_hosts_count(self, request): # 主机和进程连表查询 host_queryset: QuerySet = HostQuerySqlHelper.multiple_cond_sql( params=process_params, - biz_scope=[], - need_biz_scope=False, + biz_scope=validated_data["biz_scope"], + need_biz_scope=True if validated_data["biz_scope"] else False, is_proxy=False if project == constants.GsePackageCode.AGENT.value else True, ).filter(**host_kwargs)