fix: 我的资产列表标签信息没有显示

pull/12422/head
wangruidong 2023-12-25 16:49:39 +08:00 committed by Bryan
parent 81b4909016
commit edb2d1bd7b
1 changed files with 2 additions and 2 deletions

View File

@ -10,6 +10,7 @@ from assets.const import Category, AllTypes
from assets.models import Node, Asset, Platform
from assets.serializers.asset.common import AssetLabelSerializer, AssetProtocolsPermsSerializer
from common.serializers.fields import ObjectRelatedField, LabeledChoiceField
from common.serializers import ResourceLabelsMixin
from orgs.mixins.serializers import OrgResourceModelSerializerMixin
from perms.serializers.permission import ActionChoicesField
@ -19,12 +20,11 @@ __all__ = [
]
class AssetPermedSerializer(OrgResourceModelSerializerMixin):
class AssetPermedSerializer(OrgResourceModelSerializerMixin, ResourceLabelsMixin):
""" 被授权资产的数据结构 """
platform = ObjectRelatedField(required=False, queryset=Platform.objects, label=_('Platform'))
category = LabeledChoiceField(choices=Category.choices, read_only=True, label=_('Category'))
type = LabeledChoiceField(choices=AllTypes.choices(), read_only=True, label=_('Type'))
labels = AssetLabelSerializer(many=True, required=False, label=_('Label'))
domain = ObjectRelatedField(required=False, queryset=Node.objects, label=_('Domain'))
class Meta: