mirror of https://github.com/jumpserver/jumpserver
Merge branch 'v3' of github.com:jumpserver/jumpserver into v3
commit
15c8c035aa
|
@ -1,6 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
from io import StringIO
|
||||
|
||||
from rest_framework import serializers
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
@ -9,7 +8,6 @@ from django.db.models import F
|
|||
|
||||
from common.drf.serializers import JMSWritableNestedModelSerializer
|
||||
from common.drf.fields import LabeledChoiceField, ObjectRelatedField
|
||||
from common.utils import validate_ssh_private_key, ssh_private_key_gen
|
||||
from ..account import AccountSerializer
|
||||
from ...models import Asset, Node, Platform, Label, Domain, Account, Protocol
|
||||
from ...const import Category, AllTypes
|
||||
|
@ -29,7 +27,7 @@ class AssetProtocolsSerializer(serializers.ModelSerializer):
|
|||
class AssetLabelSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = Label
|
||||
fields = ['name', 'value']
|
||||
fields = ['id', 'name', 'value']
|
||||
extra_kwargs = {
|
||||
'name': {'required': False},
|
||||
'value': {'required': False}
|
||||
|
@ -62,7 +60,7 @@ class AssetAccountSerializer(AccountSerializer):
|
|||
class AssetSerializer(JMSWritableNestedModelSerializer):
|
||||
category = LabeledChoiceField(choices=Category.choices, read_only=True, label=_('Category'))
|
||||
type = LabeledChoiceField(choices=AllTypes.choices(), read_only=True, label=_('Type'))
|
||||
domain = ObjectRelatedField(required=False, queryset=Domain.objects, label=_('Domain'))
|
||||
domain = ObjectRelatedField(required=False, queryset=Domain.objects, label=_('Domain'), allow_null=True)
|
||||
platform = ObjectRelatedField(required=False, queryset=Platform.objects, label=_('Platform'))
|
||||
nodes = ObjectRelatedField(many=True, required=False, queryset=Node.objects, label=_('Nodes'))
|
||||
labels = AssetLabelSerializer(many=True, required=False, label=_('Labels'))
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
amqp==5.0.9
|
||||
ansible==6.4.0
|
||||
ansible-runner==4.8.0
|
||||
ansible-runner==2.2.1
|
||||
asn1crypto==0.24.0
|
||||
bcrypt==3.1.4
|
||||
billiard==3.6.4.0
|
||||
|
|
Loading…
Reference in New Issue