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

fix: admin42 buildpack/builder/runner 相关页面优化 #1646

Merged
merged 3 commits into from
Oct 10, 2024
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
14 changes: 14 additions & 0 deletions apiserver/paasng/paasng/plat_admin/admin42/serializers/runtimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,15 @@ class BuildPackUpdateInputSLZ(BuildPackCreateInputSLZ):
pass


class BuildPackListInputSLZ(serializers.Serializer):
region = serializers.ChoiceField(default=None, required=False, allow_null=True, choices=RegionType.get_choices())


class BuildPackListOutputSLZ(serializers.ModelSerializer):
display_name = TranslatedCharField()
description = TranslatedCharField()
env_vars = serializers.JSONField(source="environments", help_text="环境变量")
slugbuilders = serializers.PrimaryKeyRelatedField(many=True, read_only=True, help_text="已绑定 slugbuilder id列表")

class Meta:
model = AppBuildPack
Expand Down Expand Up @@ -107,11 +112,16 @@ def validate_name(self, name: str) -> str:
return name


class AppSlugBuilderListInputSLZ(serializers.Serializer):
region = serializers.ChoiceField(default=None, required=False, allow_null=True, choices=RegionType.get_choices())


class AppSlugBuilderListOutputSLZ(serializers.ModelSerializer):
display_name = TranslatedCharField()
description = TranslatedCharField()
env_vars = serializers.JSONField(source="environments", help_text="环境变量")
labels = serializers.JSONField()
buildpacks = serializers.PrimaryKeyRelatedField(many=True, read_only=True, help_text="已绑定 buildpack id 列表")

class Meta:
model = AppSlugBuilder
Expand Down Expand Up @@ -146,6 +156,10 @@ def validate_buildpack_ids(self, buildpack_ids: List[str]) -> List[str]:
return buildpack_ids


class AppSlugRunnerListInputSLZ(serializers.Serializer):
region = serializers.ChoiceField(default=None, required=False, allow_null=True, choices=RegionType.get_choices())


class AppSlugRunnerListOutputSLZ(serializers.ModelSerializer):
display_name = TranslatedCharField()
description = TranslatedCharField()
Expand Down
Loading