Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: project summary add project group name. #1705

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions dongtai_web/views/project_detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
ProjectsVersionDataSerializer,
get_project_version,
)
from dongtai_web.serializers.project import ProjectSerializer
from dongtai_web.utils import extend_schema_with_envcheck, get_response_serializer


Expand Down Expand Up @@ -76,7 +75,6 @@ def get(self, request, id):
"template_id": project.template_id,
"enable_log": project.enable_log,
"log_level": project.log_level,
"project_group_name": ProjectSerializer().get_project_group_name(project),
}
)
return R.failure(status=203, msg=_("no permission"))
4 changes: 4 additions & 0 deletions dongtai_web/views/project_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ class _ProjectSummaryDataSerializer(serializers.Serializer):
)
agent_alive = serializers.IntegerField(help_text="Agent存活数量")
project_version_latest_time = serializers.IntegerField(help_text="项目版本更新时间")
project_group_name = serializers.ListField(
child=serializers.CharField(),
)


_ProjectSummaryResponseSerializer = get_response_serializer(_ProjectSummaryDataSerializer())
Expand Down Expand Up @@ -121,4 +124,5 @@ def get(self, request, id):
data["agent_alive"] = IastAgent.objects.filter(bind_project_id=project.id, online=const.RUNNING).count()
project_version = IastProjectVersion.objects.filter(pk=current_project_version.get("version_id", 0)).first()
data["project_version_latest_time"] = project_version.update_time if project_version else project.latest_time
data["project_group_name"] = ProjectSerializer().get_project_group_name(project)
return R.success(data=data)
Loading